warning division by zero

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
teemoo
Posts: 1
Joined: Sun Apr 03, 2016 2:39 pm

warning division by zero

Post by teemoo »

hi all
i have propblem after add plugin wearthermap 97c

Warning: Division by zero in C:\xampp\htdocs\cacti\plugins\weathermap\lib\WeatherMap.functions.php on line 569

this is line 569

$ratio=($distance - $pointarray[$index][2]) / ($pointarray[$index + 1][2] - $pointarray[$index][2]);

and fuction
function find_distance_coords(&$pointarray,$distance)
{
// We find the nearest lower point for each distance,
// then linearly interpolate to get a more accurate point
// this saves having quite so many points-per-curve

$index=find_distance($pointarray, $distance);

$ratio=($distance - $pointarray[$index][2]) / ($pointarray[$index + 1][2] - $pointarray[$index][2]);
$x = $pointarray[$index][0] + $ratio * ($pointarray[$index + 1][0] - $pointarray[$index][0]);
$y = $pointarray[$index][1] + $ratio * ($pointarray[$index + 1][1] - $pointarray[$index][1]);

return(array($x,$y,$index));
}

help me pls!

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

Re: warning division by zero

Post by Howie »

Do you still have this issue?

What does your map config look like? This would probably be caused by having a link between two nodes at the same position, or something like that.
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