Weathermap permnissions

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

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

Re: Weathermap permnissions

#31 Post by Howie » Thu Aug 21, 2014 5:12 pm

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.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!)

bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

#32 Post by bartc » Sun Aug 24, 2014 4:14 am

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

#33 Post by bartc » Tue Sep 02, 2014 11:19 am

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

Re: Weathermap permnissions

#34 Post by Howie » Tue Sep 02, 2014 1:01 pm

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.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!)

bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

#35 Post by bartc » Thu Sep 04, 2014 2:23 pm

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

#36 Post by bartc » Tue Sep 09, 2014 7:18 am

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

Re: Weathermap permnissions

#37 Post by Howie » Tue Sep 09, 2014 7:26 am

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.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!)

bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

#38 Post by bartc » Thu Sep 11, 2014 11:03 am

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

Re: Weathermap permnissions

#39 Post by Howie » Fri Sep 12, 2014 10:02 am

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.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!)

bartc
Posts: 17
Joined: Wed Aug 20, 2014 11:06 am

Re: Weathermap permnissions

#40 Post by bartc » Fri Sep 12, 2014 12:36 pm

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

#41 Post by squintero » Sun Apr 23, 2017 11:38 pm

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 1923 times

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

Re: Weathermap permnissions

#42 Post by Howie » Mon Apr 24, 2017 4:22 am

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

Which user does the cacti poller run as?
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!)

squintero
Posts: 3
Joined: Sun Apr 23, 2017 2:17 am

Re: Weathermap permnissions

#43 Post by squintero » Mon Apr 24, 2017 9:11 pm

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 1842 times
Weathermap2.PNG
Weathermap2.PNG (17.61 KiB) Viewed 1842 times
Weathermap.png
Weathermap.png (51.21 KiB) Viewed 1845 times

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

Re: Weathermap permnissions

#44 Post by Howie » Tue Apr 25, 2017 7:26 am

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.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!)

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

Re: Weathermap permnissions

#45 Post by Howie » Tue Apr 25, 2017 4:00 pm

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