Can't generate .png from poller.php

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
Jeb
Posts: 38
Joined: Tue May 24, 2005 2:50 am

Can't generate .png from poller.php

Post by Jeb »

Hello, i was using weathermap 0.82 and i upgraded to 0.91 today and since this time the generation from poller.php fail

PHP Warning: Division by zero in /.../cacti-0.8.6i/plugins/weathermap/setup.php on line 314
PHP Fatal error: Out of memory (allocated 131334144) (tried to allocate 1050 bytes) in /.../cacti-0.8.6i/plugins/
weathermap/Weathermap.class.php on line 176

I was using memory_limit = 64M, i tried with memory_limit = 256M but it still don't work.
If i use the "recalculate all maps now" button or if i run weathermap from cli (php weathermap --config configs/MPLS.conf) it works fine. (weathermap-cacti-rebuild.php also work)
So i think there is a bug somewhere (may be related to the division by zero warning ?)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Can't generate .png from poller.php

Post by Howie »

Jeb wrote:Hello, i was using weathermap 0.82 and i upgraded to 0.91 today and since this time the generation from poller.php fail

PHP Warning: Division by zero in /.../cacti-0.8.6i/plugins/weathermap/setup.php on line 314
PHP Fatal error: Out of memory (allocated 131334144) (tried to allocate 1050 bytes) in /.../cacti-0.8.6i/plugins/
weathermap/Weathermap.class.php on line 176

I was using memory_limit = 64M, i tried with memory_limit = 256M but it still don't work.
If i use the "recalculate all maps now" button or if i run weathermap from cli (php weathermap --config configs/MPLS.conf) it works fine. (weathermap-cacti-rebuild.php also work)
So i think there is a bug somewhere (may be related to the division by zero warning ?)
That's odd. It seems that some of the new settings in 0.9 weren't automatically created for you. You might like to try: Settings, Misc and then just Save (don't change anything). That ought to fill in any gaps, I think.

However, assuming that fixes the divide-by-zero, you might now have permissions problems as a result of using Recalc Now - just be aware...
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!)
Jeb
Posts: 38
Joined: Tue May 24, 2005 2:50 am

Post by Jeb »

Thanks for your quick answer. It doesn't solve my problem, i still get the same error :/
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Jeb wrote:Thanks for your quick answer. It doesn't solve my problem, i still get the same error :/
If you are able to log into the mysql database for your cacti and run the following commands:

Code: Select all

replace into settings values('weathermap_render_counter',0);
replace into settings values('weathermap_render_period',1);
That should take care of it then. I still don't know why it happened 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!)
Jeb
Posts: 38
Joined: Tue May 24, 2005 2:50 am

Post by Jeb »

Ok, in fact weathermap_render_period value is 0 in the database when i chose every poller cycle.
In the html code :
<option value="0" selected>Every Poller Cycle (default)</option>

I think it should be 1 instead of 0 !
Jeb
Posts: 38
Joined: Tue May 24, 2005 2:50 am

Post by Jeb »

Patch:

Change 0 to 1 in setup.php line 97

0 => "Every Poller Cycle (default)",
-> 1 => "Every Poller Cycle (default)",
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Jeb wrote:Ok, in fact weathermap_render_period value is 0 in the database when i chose every poller cycle.
In the html code :
<option value="0" selected>Every Poller Cycle (default)</option>

I think it should be 1 instead of 0 !
No, it should be 0.
anything mod 0 == 0

It doesn't really make much difference if it's 1, but it was 0 for a reason (I don't recall the reason right now :oops: ). Besides which, it is working for several hundred other people.

I've just tried 0%0, 0%1, 1%0 and 1%1 and none of those give me a div-by-zero, in fact. Even NULL%0 didn't. So I'm a little puzzled.
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!)
Jeb
Posts: 38
Joined: Tue May 24, 2005 2:50 am

Post by Jeb »

<?
if ((1 % 0) == 0) {
echo "Ok";
}
?>
Give me "PHP Warning: Division by zero"
0%0 give me the same.

1%1 and 0%1 are ok

i'am using PHP 5.2.1, i've tested with a PHP 5.1.6 and with it %0 is Ok, on PHP 5.2.0-8+etch4 there is a warning...

But i may have said too fast that saving setting didn't solve my problem because i put back weathermap_render_period to 0 and it's working... may be there was the need to way for 2 cycle after saving data for the "bug" to go out...

Anyway thank you :)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests