Enabling the ditor on fresh install

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

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

Enabling the ditor on fresh install

Post by malgoe »

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: 185
Joined: Wed Jul 20, 2016 8:00 pm

Re: Enabling the ditor on fresh install

Post by Pucho »

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.2.15
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
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Enabling the ditor on fresh install

Post by Rno »

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.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

Post by malgoe »

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

Post by malgoe »

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: [weathermap_memory_check@poller-common.php:11] MEM Initial: memory_get_usage() says 4.6MBytes used. Limit is 512M "
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Enabling the ditor on fresh install

Post by Rno »

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.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
User avatar
Pucho
Cacti User
Posts: 185
Joined: Wed Jul 20, 2016 8:00 pm

Re: Enabling the ditor on fresh install

Post by Pucho »

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: [weathermap_memory_check@poller-common.php: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.2.15
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
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Enabling the ditor on fresh install

Post by malgoe »

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

Post by malgoe »

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

Post by malgoe »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

Post by Howie »

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.98a 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

Post by malgoe »

Howie, thanks for your reply.

Are we talking days, weeks, or months for 0.98a? ;)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

Post by Howie »

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.98a 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

Post by malgoe »

Cannot promise any contributions, but what branch is for 0.98a? Database-refactor?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Enabling the ditor on fresh install

Post by Howie »

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.98a 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

Who is online

Users browsing this forum: No registered users and 3 guests