Page 1 of 1

Bug in check_nagios_performance.php

Posted: Fri Aug 01, 2025 8:36 am
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.

Re: Bug in check_nagios_performance.php

Posted: Thu Aug 14, 2025 10:31 am
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

Re: Bug in check_nagios_performance.php

Posted: Tue Aug 19, 2025 9:25 pm
by polinkuer12
how was the problem solved specifically? sorry i am really curious about this! :geek: fnfgo

Re: Bug in check_nagios_performance.php

Posted: Wed Aug 20, 2025 9:49 am
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.

Re: Bug in check_nagios_performance.php

Posted: Wed Aug 20, 2025 3:28 pm
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