Bug in check_nagios_performance.php
Posted: Fri Aug 01, 2025 8:36 am
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):
For a comparison, here is select from database:
After checking source code of check_nagios_performance.php, I'd suggest any of these:
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.
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;Code: Select all
> select avg(latency) from nagios_servicestatus
avg(latency) |
------------------+
0.5030855557981578|
1 row(s) fetched.- 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'.
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.