I hope this should be directed to this group...
The check_ntp plugin has an error in it regarding the
reporting of an NTP server down.
When this condition is met:
if (/no server suitable for synchronization found/) {
$ntpdate_error = $ERRORS{"CRITICAL"};
}
it properly returns a numerical error code of 2.
However, by the time it reaches the handler:
if ($ntpdate_error > $ERRORS{'OK'}) {
$state = $ntpdate_error;
$answer = "Server for ntp probably down\n";
if (defined($offset) && abs($offset) > $critical){
$state = $ERRORS{'CRITICAL'};
$answer = "Server Error and time difference
$offset seconds greater than +/- $critical sec\n";
} elsif (defined($offset) && abs($offset) >
$warning) {
$answer = "Server error and time difference
$offsetseconds greater than +/- $warning sec\n";
}
the numerical error code has been changed to 1, which
is a WARNING code, not a CRITICAL code as should be
reported.
Using some debugging statements, I discovered that this
particular line of code:
$ntpdate_error = ($? >> 8) || $ntpdate_error;
was changing the error code from 2 (CRITICAL) to 1
(WARNING). This resulted in the improper reporting of
a serious problem.
To fix it, I simply commented out the line of code. I
am not sure what the purpose of it is in the first
place, but it does not seem to have affected any other
functionality.
- Jay Christopherson
Logged In: YES
user_id=81521
This appears to have been fixed - at least as of version
1.11.2.7 - in netsaint-plugins version 1.2.9-4 ...