Page 1 of 1

perfdata.inc.php Division by zero

Posted: Wed Oct 17, 2018 9:14 am
by Bitflogger
Hello, I'm running v5.5.3 64 bit VM CentOS 7

I see a number of lines in /var/log/httpd/ssl_error_log like this:

/usr/local/nagiosxi/html/includes/components/graphexplorer/templates/perfdata.inc.php on line 97, referer: https://nagiosxi.doit.wisc.edu/nagiosxi ... t.wisc.edu

It seems to be happening for one host. That host has perf data processing ON for a load test, which is currently reporting 0% load.

Earl

Re: perfdata.inc.php Division by zero

Posted: Wed Oct 17, 2018 9:59 am
by npolovenko
Hello, @Bitflogger. Let's try removing the RRD and XML files for the load service and have Nagios automatically recreate them.
Go to the following folder on the Nagios server:
/usr/local/nagios/share/perfdata/
Open the folder that corresponds to the Hostname, and inside that folder delete the RRD and XML files that correspond to the "Load test" service.
Then wait 15 minutes and check on the service graph again and let me know if it started working.

PS: ALso, delete everything from this folder:
/usr/local/nagios/var/spool/perfdata

Re: perfdata.inc.php Division by zero

Posted: Wed Oct 17, 2018 4:12 pm
by Bitflogger
Hello,

That did not seem to work. I seem to be getting 2 of the alerts for the same host, so I did as you suggested for each of the services on the host. Still no change.

I see other servers with a average load of 0%, but no warning in ssl_error_log.

[Wed Oct 17 16:10:32.014504 2018] [:error] [pid 20132] [client 146.151.222.234:55949] PHP Warning: Division by zero in /usr/local/nagiosxi/html/includes/components/graphexplorer/templates/perfdata.inc.php on line 97, referer: https://nagiosxi.doit.wisc.edu/nagiosxi ... t.wisc.edu
[Wed Oct 17 16:10:48.482173 2018] [:error] [pid 27559] [client 146.151.222.234:55972] PHP Warning: Division by zero in /usr/local/nagiosxi/html/includes/components/graphexplorer/templates/perfdata.inc.php on line 97, referer: https://nagiosxi.doit.wisc.edu/nagiosxi ... t.wisc.edu

Earl

Re: perfdata.inc.php Division by zero

Posted: Wed Oct 17, 2018 4:28 pm
by npolovenko
@Bitflogger, Can you show me what's on line 97 of this php file on your system?
/usr/local/nagiosxi/html/includes/components/graphexplorer/templates/perfdata.inc.php
I wonder if the device itself is not returning anything causing the PHP error. Can you run these service checks from the command line and post the output?

Re: perfdata.inc.php Division by zero

Posted: Thu Oct 18, 2018 8:28 am
by Bitflogger
Hello,

Line 97 is: $avg = $avg_total / $avg_num;

This morning the problem seems to have gone away. The load average for that host is still %0.

Please close the case.

Thanks!

Re: perfdata.inc.php Division by zero

Posted: Thu Oct 18, 2018 9:57 am
by npolovenko
@Bitflogger, Closing the thread.