[Solved] Weathermap/Graph Export Issue

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
mexashaggy
Posts: 5
Joined: Tue Mar 01, 2011 3:47 pm

[Solved] Weathermap/Graph Export Issue

Post by mexashaggy »

I have a weathermap that is made up of 8 NODEs whose ICONs are exported graphs. Overall, this seems to be working. About half of the time, all of my maps fail to update, because the one with graphs can't find one of the exported pngs.

Code: Select all

03/01/2011 02:12:04 PM - WEATHERMAP: Poller[0] WARNING: [Map 6] temps.conf: ICON '/var/www/html/export/graphs/graph_212_1.png' does not exist, or is not readable. Check path and permissions. [WMARN38]
03/01/2011 02:12:04 PM - WEATHERMAP: Poller[0] [Map 6] temps.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
What I am assuming is happening, is with the graph export, all the graphs are being deleted about the same time that the weather maps are being generated, so the rest of the poller process aborts. Any one have any ideas on how to fix this?
Last edited by mexashaggy on Thu Mar 03, 2011 10:41 am, edited 1 time in total.
Cacti: 0.8.7g RRDTool: 1.2.23 Weathermap: 0.97a
OS: CentOS 4.8
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap/Graph Export Issue

Post by Howie »

I'm surprised it aborts ALL the maps...

Not sure what to suggest about that missing graph (I've never used Graph Export), but I'll check into why all the maps stop when one icon is missing.
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!)
mexashaggy
Posts: 5
Joined: Tue Mar 01, 2011 3:47 pm

Re: Weathermap/Graph Export Issue

Post by mexashaggy »

I think it actually aborts the entire poller.php. Root gets an email every time it fails:

Code: Select all

Message 156:
From root@cacti  Wed Mar  2 08:04:05 2011
Date: Wed, 2 Mar 2011 08:04:04 -0700
From: root@cacti (Cron Daemon)
To: root@cacti
Subject: Cron <root@cacti> php /var/www/html/poller.php > /dev/null 2>&1
Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

/bin/sh: line 1: 30459 Aborted                 php /var/www/html/poller.php >/dev/null 2>&1
All of my graphs are still updating, so I guess that part of the poller.php happens before the maps are generated. I just wonder if I could place a "wait" somewhere in the weathermap part of the poller, so that it waits a few seconds before trying to generate the maps.
Cacti: 0.8.7g RRDTool: 1.2.23 Weathermap: 0.97a
OS: CentOS 4.8
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap/Graph Export Issue

Post by Howie »

What is your memory_limit?

The last line in your logs is actually "03/01/2011 02:12:04 PM - WEATHERMAP: Poller[0] [Map 6] temps.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]"

Hitting the php memory_limit WILL just kill the poller...
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!)
mexashaggy
Posts: 5
Joined: Tue Mar 01, 2011 3:47 pm

Re: Weathermap/Graph Export Issue

Post by mexashaggy »

I thought that might have been the case also, so yesterday, I set the limit to 256M. I have still gotten those errors since I changed it. (I did verify that the limit is at 256M now). I guess technically, that is not the last line of the log, here is what is printed during a failed run:

Code: Select all

03/02/2011 08:56:06 AM - EXPORT STATS: ExportDate:2011-03-02_8:56:06 ExportDuration:1.9334 TotalGraphsExported:40
03/02/2011 08:56:05 AM - WEATHERMAP: Poller[0] WARNING: [Map 6] temps.conf: ICON '/var/www/html/export/graphs/graph_212_1.png' does not exist, or is not readable. Check path and permissions. [WMARN38]
03/02/2011 08:56:04 AM - WEATHERMAP: Poller[0] [Map 6] temps.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
03/02/2011 08:56:04 AM - WEATHERMAP: Poller[0] [Map 6] temps.conf: Map: /var/www/html/plugins/weathermap/configs/temps.conf -> /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.html & /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.png
03/02/2011 08:56:04 AM - WEATHERMAP: Poller[0] Weathermap 0.97a starting - Normal logging mode. Turn on DEBUG in Cacti for more information
03/02/2011 08:56:04 AM - SYSTEM THOLD STATS: Time:0.0251 Tholds:10 Hosts:0
03/02/2011 08:56:04 AM - SYSTEM STATS: Time:2.4287 Method:cmd.php Processes:3 Threads:N/A Hosts:58 HostsPerProcess:20 DataSources:291 RRDsProcessed:181
And here is a successful run:

Code: Select all

03/02/2011 09:00:08 AM - WEATHERMAP: Poller[0] STATS: Weathermap 0.97a run complete - Wed, 02 Mar 2011 09:00:08 MST: 3 maps were run in 4 seconds with 0 warnings.
03/02/2011 09:00:08 AM - WEATHERMAP: Poller[0] [Map 5] switches.conf: Wrote map to /var/www/html/plugins/weathermap/output/97958751d53f7687ab94.png and /var/www/html/plugins/weathermap/output/97958751d53f7687ab94.thumb.png
03/02/2011 09:00:07 AM - WEATHERMAP: Poller[0] [Map 5] switches.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
03/02/2011 09:00:07 AM - WEATHERMAP: Poller[0] [Map 5] switches.conf: Map: /var/www/html/plugins/weathermap/configs/switches.conf -> /var/www/html/plugins/weathermap/output/97958751d53f7687ab94.html & /var/www/html/plugins/weathermap/output/97958751d53f7687ab94.png
03/02/2011 09:00:07 AM - WEATHERMAP: Poller[0] [Map 4] main: Wrote map to /var/www/html/plugins/weathermap/output/f5704ae08d0be61e4cc6.png and /var/www/html/plugins/weathermap/output/f5704ae08d0be61e4cc6.thumb.png
03/02/2011 09:00:07 AM - WEATHERMAP: Poller[0] [Map 4] main: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
03/02/2011 09:00:06 AM - WEATHERMAP: Poller[0] [Map 4] main: Map: /var/www/html/plugins/weathermap/configs/main -> /var/www/html/plugins/weathermap/output/f5704ae08d0be61e4cc6.html & /var/www/html/plugins/weathermap/output/f5704ae08d0be61e4cc6.png
03/02/2011 09:00:06 AM - WEATHERMAP: Poller[0] [Map 6] temps.conf: Wrote map to /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.png and /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.thumb.png
03/02/2011 09:00:06 AM - EXPORT STATS: ExportDate:2011-03-02_9:00:06 ExportDuration:2.3186 TotalGraphsExported:40
03/02/2011 09:00:04 AM - WEATHERMAP: Poller[0] [Map 6] temps.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
03/02/2011 09:00:04 AM - WEATHERMAP: Poller[0] [Map 6] temps.conf: Map: /var/www/html/plugins/weathermap/configs/temps.conf -> /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.html & /var/www/html/plugins/weathermap/output/61141716c18116f2fdc7.png
03/02/2011 09:00:04 AM - WEATHERMAP: Poller[0] Weathermap 0.97a starting - Normal logging mode. Turn on DEBUG in Cacti for more information
03/02/2011 09:00:04 AM - SYSTEM THOLD STATS: Time:0.0251 Tholds:10 Hosts:0
03/02/2011 09:00:04 AM - SYSTEM STATS: Time:2.4384 Method:cmd.php Processes:3 Threads:N/A Hosts:58 HostsPerProcess:20 DataSources:291 RRDsProcessed:181
Any other info you would like, just let me know.
Cacti: 0.8.7g RRDTool: 1.2.23 Weathermap: 0.97a
OS: CentOS 4.8
mexashaggy
Posts: 5
Joined: Tue Mar 01, 2011 3:47 pm

Re: Weathermap/Graph Export Issue

Post by mexashaggy »

Well, I was able to somewhat solve this. I modified /plugins/weathermap/lib/poller-common.php to include a sleep() function:

Code: Select all

...
// this is the easiest way to keep it all consistent!

// sleep for 5 seconds to hopefully allow the graph export to finish
sleep(5);

function weathermap_memory_check($note="MEM")
...
I have not had a failure since I made this change. I do have one more question though, is that the best place to insert the sleep function?
Thanks.
Cacti: 0.8.7g RRDTool: 1.2.23 Weathermap: 0.97a
OS: CentOS 4.8
thieums
Posts: 2
Joined: Thu Jul 19, 2012 6:17 am

Re: [Solved] Weathermap/Graph Export Issue

Post by thieums »

Hello,
i had the same problem but your solution didn't help in my case.
I had to comment the call to del_directory() in the export fonction in lib/graph_export.php

Mathieu
cacti 0.8.8a (debian wheezy)
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re: [Solved] Weathermap/Graph Export Issue

Post by classen »

Ahhh I just found this thread after posting my own very similar question over here

I will try adding the sleep function to see if it helps my situation.
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re: [Solved] Weathermap/Graph Export Issue

Post by classen »

My setup requires a sleep(16); in order for graph export to finish, but this is now working for me too.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests