Weathermap permnissions

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

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

Re: Weathermap permnissions

Post by Howie »

Nothing at all in the cacti.log? Even with no maps, you should get one or two lines (unless quiet logging is enabled in the Weathermap settings in Cacti).

But: you do get the Manage..Weathermaps page? And you do have a list of maps in that page?

That indicates that the plugin is installed OK, and the database tables exist (otherwise you would have no maps listed).
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!)
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

Weathermap management works fine , i can see my added maps listed. Nothing in cacti log, weathermap "chatty"chatty logging enabled , cacti debug log enabled. No maps are generated. I am using editor and i see config is saved properly , i have edited weathermap script so it can display name of thumbnail. Then i used cli to manually generate it. When doing it manually all works fine. I am suspecting that there is some issue with calling weathermap script by cacti poller, need to have a look into cmd.php , but you probably know how it works so if you give some tips that will save my time on reverse engineering troubleshooting ;)
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

Do you have any ideas where to look , I would like to trace how weathermap script is being initiated.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

The weathermap *script* isn't initiated. Parts of the weathermap plugin are called by the Cacti plugin architecture.

I guess you need to look at the plugin_* database tables to check if there is a weathermap entry for the poller_bottom hook.
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!)
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

Hah , didn't know about that, ok so here are my findings.

1. In the Plugin Management I can see Weathermap with type "old PIA"
2. In the cacti database , I have displayed plugin_config table and weathermap is not there
3. In the cacti database , I have displayed plugin_realms and I can see weathemap displays there

Is this correct ?
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

So I have found sort of workaround , first I gather info about current maps and their filehash from database, then I run command weathermap from a script specifying config files and html output , at the end I use convert to generate thumbnails for existing maps. I agree its very dirty way but I havent found solution for my problem.

PS. All works fine when I generate html manually , when I dod that from script using exactly the same commands , html file is not being diplayed , it has slighlty larger size , I had a glance on the content and it looks the same as when generate manually from cli. So I got stuck again. Need to look at it again today.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

There's actually already a command-line script to use the cacti database settings... check out cacti-weathermap-rebuild.php

This does what the poller does, but from the command line.
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!)
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

It seems that everything works when the maps are generated using weathermap *script* when it's generated withing the folder, so I actually ended up with following script running every hour (probably I will modify it in a way that it only acts upon config change for particular map):

Code: Select all

#!/bin/bash
#

path=/var/www/cacti/plugins/weathermap/
pathcfg=/var/www/cacti/plugins/weathermap/configs/
bin=/var/www/cacti/plugins/weathermap/weathermap
pathout=/var/www/cacti/plugins/weathermap/output/
mysql --skip-column-names --user='root' --password='XXXXX' --database='cacti' --execute='select configfile,filehash from weathermap_maps' > "$path"weathemap_maps_list
mapslist="$path"weathemap_maps_list

if [ -f $mapslist ]
then
	while read maps
	    do
		config=$(echo $maps | awk '{$NF=""; print $0}')
                map=$(echo $maps | awk '{print $NF}')
		cd /var/www/cacti/plugins/weathermap/
                ./weathermap  --config configs/$config --output output/$map.png --htmloutput output/$map.html #--debug
		sleep 5
		convert -thumbnail 300x300 $pathout$map.png $pathout$map.thumb.png
	    done < $mapslist
fi
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

Yeah, weathermap-cacti-rebuild.php does that for you. I still don't see why the regular poller function isn't called though.
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!)
bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

Post by bartc »

Me neither, but at least I have workaround that works pretty well.

I would like to thank you for all help and suggestions, now I can proceed with installation of nagios plugin and more.
squintero
Posts: 3
Joined: Sun Apr 23, 2017 2:17 am

Re: Weathermap permnissions

Post by squintero »

Hello,

I have a problem with the Weathermap plugin. I did all the steps but I still do not see the map.

The warning is displayed:

Last Completed Run: Sun, 23 Apr 17 23:20:01 -0500: 0 maps were run in 0 seconds with 1 warnings. (Permissions problem prevents any maps running WMPOLL06)

I already gave permissions to the folders as they have suggested but I still do not see the network map.

What I can do ?

Thank you
Attachments
Weathermap.png
Weathermap.png (31.32 KiB) Viewed 6794 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

Please show the permissions (ls -ld output/ then ls -l output/ )

Which user does the cacti poller run as?
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!)
squintero
Posts: 3
Joined: Sun Apr 23, 2017 2:17 am

Re: Weathermap permnissions

Post by squintero »

Howie wrote:Please show the permissions (ls -ld output/ then ls -l output/ )

Which user does the cacti poller run as?
The user is admin.

Hi Howie, I ran the commands you gave me and this is the result ...
Attachments
Weathermap3.PNG
Weathermap3.PNG (18.97 KiB) Viewed 6713 times
Weathermap2.PNG
Weathermap2.PNG (17.61 KiB) Viewed 6713 times
Weathermap.png
Weathermap.png (51.21 KiB) Viewed 6716 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

No, not the user inside Cacti. What linux user runs the Cacti poller.php process?

The output directory should be owned by that user.
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!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap permnissions

Post by Howie »

Another way to check: do an 'ls -l' in the cacti rra directory. Whatever user owns that directory should also own the output directory. It is probably a user called 'cacti', but it can be different depending on the installation.
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 1 guest