Bug in check_nagios_performance.php

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
smoren
Posts: 62
Joined: Tue Sep 29, 2015 7:24 am

Bug in check_nagios_performance.php

Post by smoren »

Hello,

I believe I have found a bug in calculation performed by check_nagios_performance.php. I was checking the Average Active Service Check Latency (but this issue likely affects all other metrics measured in miliseconds).
Here is output of few commands (all run within few seconds, hence slight variations):

Code: Select all

# php ./check_nagios_performance.php aslat
OK - Average latency:0.0499ms | Avg_Latency=0.0499ms;;;

Code: Select all

# /usr/local/nagios/bin/nagiostats -m -D ';' -d AVGACTSVCLAT
500;
For a comparison, here is select from database:

Code: Select all

> select avg(latency) from nagios_servicestatus

avg(latency)      |
------------------+
0.5030855557981578|

1 row(s) fetched.
After checking source code of check_nagios_performance.php, I'd suggest any of these:
  • use $data=$data * .001; (instead of $data=$data * .0001;) AND set UOM in performance output to 's' (instead of 'ms').
  • do not change value of $data (instead of $data=$data * .0001;) AND leave UOM in performance output set to 'ms'.
Personally, I'd prefer performance data in seconds. :)

Originally, i thought my system had good performance, but then I discovered that latency was not just a few milliseconds - it was over 20 seconds. Current value of 0.5s is the result of some additional tuning.

Thanks.
zrobinson
Posts: 20
Joined: Thu Aug 14, 2025 9:03 am

Re: Bug in check_nagios_performance.php

Post by zrobinson »

Hi @smoren,

Thank you for reaching out. I've created an internal bug report, and this issue will be reviewed and resolved by our team. Once resolved, you will be able to find the changelog information with issue number #2025.

Please let us know if you have any further questions!

Thanks,
Zach Robinson
polinkuer12
Posts: 4
Joined: Fri Dec 08, 2023 10:46 pm

Re: Bug in check_nagios_performance.php

Post by polinkuer12 »

how was the problem solved specifically? sorry i am really curious about this! :geek: fnfgo
sgardil
Posts: 349
Joined: Wed Aug 09, 2023 9:58 am

Re: Bug in check_nagios_performance.php

Post by sgardil »

polinkuer12 wrote: Tue Aug 19, 2025 9:25 pm how was the problem solved specifically? sorry i am really curious about this! :geek: fnfgo
This hasnt been resolved yet but an internal ticket has been open. When this issue gets resolved you should be able to see a message in our changelog about it with the tag #2025. If you want to re-inquire about what the fix was when you see it we should be able to fill you in more. We don't have a time frame in mind for this fix but you can view our changelog here.
zrobinson
Posts: 20
Joined: Thu Aug 14, 2025 9:03 am

Re: Bug in check_nagios_performance.php

Post by zrobinson »

polinkuer12 wrote: Tue Aug 19, 2025 9:25 pm how was the problem solved specifically? sorry i am really curious about this! :geek: fnfgo
Hi,
The current plan is to record these latency checks in seconds, as that seems to be the intended UoM. Of course, until a fix is released, this is subject to change. Please let us know if you have any further questions.

Thanks,
Zachary Robinson
Post Reply