Enabling the ditor on fresh install

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Author
Message
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Enabling the ditor on fresh install

#1 Post by malgoe » Sun Aug 28, 2016 11:01 am

Hi,

I'm trying to do a fresh install on a new server. Using Ubuntu 16.04 LTS, the Ubuntu repository version of Cacti (0.8.8f) and Network Weathermap 0.98 from here: https://github.com/howardjones/network- ... p-0.98.zip
I manage to follow the installation instructions found here: http://network-weathermap.com/manual/0. ... ditor.html
Installing and enabling network weathermap itself works fine, but then I get to the part where I'm supposed to enable the editor.
Copy the editor-config.php-dist file to editor-config.php
I can't find any such file on my server or in the zip file for network weathermap at all. Where is it supposed to be? Directly in the weathermap dir? In the editor-resources? Separate download? :)

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: Enabling the ditor on fresh install

#2 Post by Pucho » Sun Aug 28, 2016 11:13 pm

I don't quite remember now but, if you have a look at weathermap-cacti-plugin-editor.php file, it tells you what file is currently using (editor.php).
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

Rno
Cacti User
Posts: 350
Joined: Wed Dec 07, 2011 9:19 am

Re: Enabling the ditor on fresh install

#3 Post by Rno » Mon Aug 29, 2016 2:03 am

Don't you have a file call editor.php inside your weathermap directory ?
Inside it you have to set the $ENABLED to true to be able to use the editor online.
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.45, Map 0.37

Test
Cacti 1.2.6
Spine 1.2.6
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.6
Map 1.2.6

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#4 Post by malgoe » Mon Aug 29, 2016 11:48 am

Rno wrote:Don't you have a file call editor.php inside your weathermap directory ?
Inside it you have to set the $ENABLED to true to be able to use the editor online.
Yes I do, but the way it is built, as long as the editor is loaded in the Cacti UI it doesn't care about wether $ENABLED is true or not to start with.
Pucho wrote:I don't quite remember now but, if you have a look at weathermap-cacti-plugin-editor.php file, it tells you what file is currently using (editor.php).
Yes, the editor itself is editor.php.

But I'm looking for a config file that's supposed to be present. Here's the relevant part from the manual:
Once you have weathermap itself working, continue onto the editor:

Copy the editor-config.php-dist file to editor-config.php. If you want to be able to pick data sources from your Cacti installation by name, edit the file and make sure that the line that sets $cacti_base is correct, and that the base URI below that is also correct for your Cacti installation (these two lines are marked CHANGE in the file).

....

Since version 0.98, you no longer need to edit the editor.php to enable it unless you want to use the editor outside of Cacti. Otherwise, you can edit existing maps by clicking on their name in the list of maps in the Cacti Manage..Weathermaps page, or by clicking the 'Weathermap Editor' link at the bottom of the page to create new maps or edit maps not currently being used.

You will need to have the Cacti permission 'Edit Weathermaps' to be able to do this.
Last edited by malgoe on Mon Aug 29, 2016 12:04 pm, edited 1 time in total.

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#5 Post by malgoe » Mon Aug 29, 2016 11:56 am

OK this is weird. I can actually open the editor from cacti. I can also make changes to the original "simple.conf". But I cannot add a new map or create a new one based on simple.conf. When I click create the page just reloads and nothing happens.

Also, when trying to add a weathermap under Console -> Weathermaps -> Add, I'm just presented with a blank page if I try to add simple.conf.

I tried setting logging to DEBUG but I get nothing relevant, just the old "WEATHERMAP: Poller[0] Weathermap 0.98 starting - DEBUG mode is on " and "WEATHERMAP: Poller[0] DEBUG: [[email protected]:11] MEM Initial: memory_get_usage() says 4.6MBytes used. Limit is 512M "

Rno
Cacti User
Posts: 350
Joined: Wed Dec 07, 2011 9:19 am

Re: Enabling the ditor on fresh install

#6 Post by Rno » Tue Aug 30, 2016 1:09 am

I don't know if you can create a map directly from the editor!
Just create a file on CLI, or copy the simple.conf, than under the GUI I add it, and then I'm able to edit it.
And watch for the user right otherwise Cacti will fill your log with error and give you some timeout.
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.45, Map 0.37

Test
Cacti 1.2.6
Spine 1.2.6
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.6
Map 1.2.6

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: Enabling the ditor on fresh install

#7 Post by Pucho » Wed Aug 31, 2016 3:54 pm

malgoe wrote:OK this is weird. I can actually open the editor from cacti. I can also make changes to the original "simple.conf". But I cannot add a new map or create a new one based on simple.conf. When I click create the page just reloads and nothing happens.

Also, when trying to add a weathermap under Console -> Weathermaps -> Add, I'm just presented with a blank page if I try to add simple.conf.

I tried setting logging to DEBUG but I get nothing relevant, just the old "WEATHERMAP: Poller[0] Weathermap 0.98 starting - DEBUG mode is on " and "WEATHERMAP: Poller[0] DEBUG: [[email protected]:11] MEM Initial: memory_get_usage() says 4.6MBytes used. Limit is 512M "

Don't freat out.
You can open the web editor because all you needed was already in place. Doc might be a little bit out of date.
Everytime you create a new map from web editor be sure you are adding .conf at the end, eg sarasa.conf

And you have to check file permissions on weathermap/configs to be writable by the httpd username, probably a chown -R cacti.apache configs (this may be different for you) and chmod 0775 configs will do it. There is a section on the official doc regarding this.

Every installation is a new world =d

Cheers
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#8 Post by malgoe » Sun Sep 04, 2016 2:56 am

Pucho, thank you for the tips. But I have already done chown -R www-data configs and chmod u+w configs
(www-data is the apache user on a ubuntu system). And since I can edit the already existing simple.conf that means I'm allowed to edit things in the config folder.

Any other ideas? :-?

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#9 Post by malgoe » Sun Sep 04, 2016 3:35 am

Half the problem solved. I am allowed to create new weathermaps if only I add ".conf" in the filename. I'm pretty sure that was not necessary in earlier versions, but hey. It works. :D

Now there's just one problem left, adding the weathermap I created to be created by cacti.
Under Console -> Weathermaps -> Add, if I click "Add" for any map I get a blank page and no map is added. However if I click "view" I do get the config for the map, so that works.

EDIT:
So I've been using Firefox for this. If I use Chrome instead I actually get an HTTP error 500 when i click "Add".

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#10 Post by malgoe » Sun Sep 04, 2016 3:43 am

Yay, for this latest problem of adding a weathermap I actually get some error output in apaches error.log. Here you go:
[Sun Sep 04 10:42:19.091503 2016] [:error] [pid 25988] [client <clientIP>:60480] PHP Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /usr/local/share/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php:837\nStack trace:\n#0 /usr/local/share/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php(274): add_config('AndelainHQ.conf')\n#1 {main}\n thrown in /usr/local/share/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 837, referer: http://<serverIP>/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
I'm also getting some errors while picking data sources form cacti in the editor. Here's one example:
[Sun Sep 04 10:29:54.899548 2016] [:error] [pid 25906] [client <clientIP>:60162] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/local/share/cacti/plugins/weathermap/cacti-pick.php:69\nStack trace:\n#0 {main}\n thrown in /usr/local/share/cacti/plugins/weathermap/cacti-pick.php on line 69, referer: http://<serverIP>/cacti/plugins/weathermap/cacti-pick.php?host_id=2&command=link_step1&overlib=1&aggregate=0
The errors seem related, that some sql functions are missing. Could it be a missing package?

EDIT: It seems they are related to my PHP version. I'm on PHP 7, but I could have sworn I saw somewhere that weathermap was updated to handle that. Can't find it now though... :/

Guess I'm looking for some way to make weathermap work with PHP 7 then. :) Any suggestions?

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

#11 Post by Howie » Sun Sep 04, 2016 4:55 am

PHP 7 is the problem. The mysql_*** functions no longer exist. I'm working on replacing all the database code with PDO-based at the moment - there's quite a lot of it, but I'm about 70% through. 0.98a should have those changes.

For the editor in 0.98, you no longer need to do anything to have it work with Cacti and the admin user. For other users, you need to give the the "edit weathermaps" permission in Cacti. For other non-Cacti setups, you still need to edit files.
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#12 Post by malgoe » Sun Sep 04, 2016 5:09 am

Howie, thanks for your reply.

Are we talking days, weeks, or months for 0.98a? ;)

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

#13 Post by Howie » Sun Sep 04, 2016 5:29 am

Yes. ;-)

Seriously: Weeks, I think. Summer vacations are nearly over and I'll get the time to finish the work.

I would be surprised if you don't have other Cacti issues with 7.0 too though. I had a few.

https://network-weathermap.com/2016/09/ ... nt-issues/
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

#14 Post by malgoe » Sun Sep 04, 2016 7:08 am

Cannot promise any contributions, but what branch is for 0.98a? Database-refactor?

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

#15 Post by Howie » Sun Sep 04, 2016 7:15 am

malgoe wrote:Cannot promise any contributions, but what branch is for 0.98a? Database-refactor?
0.97-maintenance is the branch for 0.98 releases, but the database changes (current work-in-progress) are in database-refactor, yes.

0.97-maintenance already has a bunch of other changes for performance - mainly a new map config reader that I wrote a while ago but didn't make it into a release.
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

Post Reply