Hi Tom,
The 'Check latency' check is not particularly smart. It assumes that every service check is set to run every 5 minutes. I assume you have 5 checks that run less often.
Here's the help from that plugin:
------------------- snip -----------------
Usage: check_statusdat_latency [options]
-h : Display this help text.
-np : Don't output performance data.
-wp : Warning threshold for percentage of checks that are late.
-cp : Critical threshold for percentage of checks that are late.
-wl : Warning threshold for average lateness of late checks.
-cl : Critical threshold for average lateness of late checks.
-i : Check interval of most checks.
-s : Location of nagios status.dat.
Running with no options is equivalent to:
check_statusdat_latency -wp 5 -cp 50 -wl 60 -cl 300
------------------- snip -----------------
That plugin needs an update to do it dynamically, ignoring the -i option. This should fix it (it does for me!):
Find the lines in that plugin:
stat=`sed -n '/servicestatus {/,/ *}/p' $statusdat | \
awk -v interval=$interval -v offset=$offset '
BEGIN { tt=0;t=0;ttn=0;min=1000;
"/bin/date +%s" | getline b
b=b-offset} /current_state=[123]/ { num_warncrit=num_warncrit+1; }
/last_check=/ {
tot=tot+1;
a=substr( $0, index($0, "=")+1 );
if(a<=1) { pending=pending+1; next };
and add the section:
/check_interval=/ {
interval=substr( $0, index($0, "=")+1 );
interval=interval*60;
};
so it looks like:
stat=`sed -n '/servicestatus {/,/ *}/p' $statusdat | \
awk -v interval=$interval -v offset=$offset '
BEGIN { tt=0;t=0;ttn=0;min=1000;
"/bin/date +%s" | getline b
b=b-offset} /current_state=[123]/ { num_warncrit=num_warncrit+1; }
/check_interval=/ {
interval=substr( $0, index($0, "=")+1 );
interval=interval*60;
};
/last_check=/ {
tot=tot+1;
a=substr( $0, index($0, "=")+1 );
if(a<=1) { pending=pending+1; next };
The above fix assumes that "check_interval" always comes before "last_check" in the status.dat file. This is a bad assumption but in reality I think it is always true. If not then some extra checks (flags) would need to be added to the code to cover those cases.
Cheers!
Mark