[Nagiosplug-help] check_ntp errors cause UNKNOWN status

Subhendu Ghosh sghosh at sghosh.org
Wed Aug 24 13:58:46 CEST 2005


yes on the server.  If you don't have access to modify it then, you are 
stuck with the basic offset data from ntpdate.


Workaround: (until we correct the behavior in perfdata output)
copy a create a new plugin (check_ntpdate or whatever)
Comment out the perfdata line (421) and uncomment the print line above it:

foreach my $key (keys %ERRORS) {
 	if ($state==$ERRORS{$key}) {
 		print ("NTP $key: $answer");
#		print ("NTP $key: $answer|offset=$offset, jitter=" . $jitter/1000 .	",peer_stratum=$stratum\n");
 		last;
 	}
}


If you need perfdata - then you could instead initialize $jitter=0 instead 
of undef (line 158).



On Wed, 24 Aug 2005, Aaron Carr wrote:

> If you mean look at the ntp.conf file on the ntp server, I cannot.  I
> do not have access, nor is it likely that I will be granted access.
>
> On 8/24/05, Subhendu Ghosh <sghosh at sghosh.org> wrote:
>>
>> ntpdate will get an answer when ntpq will not due to the fact that ntpq
>> exposes much more info than ntpdate.  Take a look at the restrict line in
>> ntp.conf
>>
>> On Wed, 24 Aug 2005, Aaron Carr wrote:
>>
>>> All I get is 156.70.35.1: timed out, nothing received
>>> ***Request timed out
>>>
>>> This is for multiple hosts that definitely DO have ntpd running on
>>> them.  If I use "ntpdate host", it works fine.
>>>
>>> Perhaps some of the features have been disabled?  There are some areas
>>> of the company that are freakishly locked down.
>>>
>>> Aaron
>>>
>>> On 8/24/05, Subhendu Ghosh <sghosh at sghosh.org> wrote:
>>>>
>>>> Can you check if "ntpq -np host" gets a response - if not you need to
>>>> modify ntp.conf access control on host.
>>>>
>>>> On Wed, 24 Aug 2005, Aaron Carr wrote:
>>>>
>>>>> I removed the code you mentioned, and tried it on both Linux and
>>>>> Solaris hosts, but I'm still getting the same error on both:
>>>>>
>>>>> "Use of uninitialized value in division (/) at ./check_ntp line 421."
>>>>>
>>>>> Line 421 is "print ("NTP $key: $answer|offset=$offset, jitter=" .
>>>>> $jitter/1000 .     ",peer_stratum=$stratum\n");"
>>>>>
>>>>> On 8/24/05, Subhendu Ghosh <sghosh at sghosh.org> wrote:
>>>>>>
>>>>>> Bug 1267741
>>>>>>
>>>>>> Can you remove the $jitter = statement in the else branch at line 309:
>>>>>> }else {
>>>>>>       print "No match!\n" if $verbose;
>>>>>> #    $jitter = '(not parsed)';
>>>>>> }
>>>>>>
>>>>>>
>>>>>> On Wed, 24 Aug 2005, Aaron Carr wrote:
>>>>>>
>>>>>>> plugin version - 1.4.1
>>>>>>> ntpdc version - 4.2.0a at 1.1190-r
>>>>>>> ntpq version - 4.2.0a at 1.1190-r
>>>>>>>
>>>>>>> On 8/24/05, Subhendu Ghosh <sghosh at sghosh.org> wrote:
>>>>>>>> On Wed, 24 Aug 2005, Aaron Carr wrote:
>>>>>>>>
>>>>>>>>> I've been digging through the archives, but I don't see any solid
>>>>>>>>> answers to this question.
>>>>>>>>>
>>>>>>>>> If I execute check_ntp at the command line, I get the following as my
>>>>>>>>> first line of output:
>>>>>>>>> "Use of uninitialized value in division (/) at check_ntp line 424."
>>>>>>>>> The next line reads "NTP OK: Offset 0.023199 secs|offset=0.023199,
>>>>>>>>> jitter=0,peer_stratum=5", which is great, but with the first line
>>>>>>>>> being the error, Nagios has already changed the status to "UNKNOWN".
>>>>>>>>>
>>>>>>>>> Does anyone have a working check_ntp?
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> Aaron
>>>>>>>>>
>>>>>>>>
>>>>>>>> plugin version
>>>>>>>> ntpdc version
>>>>>>>> ntpq version
>>>>>>>>

-- 





More information about the Help mailing list