perfdata.inc.php Division by zero

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Bitflogger
Posts: 226
Joined: Mon Oct 16, 2017 9:24 am

perfdata.inc.php Division by zero

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: perfdata.inc.php Division by zero

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Bitflogger
Posts: 226
Joined: Mon Oct 16, 2017 9:24 am

Re: perfdata.inc.php Division by zero

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: perfdata.inc.php Division by zero

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Bitflogger
Posts: 226
Joined: Mon Oct 16, 2017 9:24 am

Re: perfdata.inc.php Division by zero

Post 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!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: perfdata.inc.php Division by zero

Post by npolovenko »

@Bitflogger, Closing the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked