-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19/08/09 01:15 AM, Chris wrote: > On Wed, Aug 19, 2009 at 1:09 PM, Thomas Guyot-Sionnest<derm...@aei.ca> wrote: >> On 18/08/09 10:13 PM, Onotsky, Steve x55328 wrote: >>>> -----Original Message----- >>>> From: Chris [mailto:atst...@gmail.com] >>>> Sent: August 18, 2009 21:56 >>>> To: nagios-users ML >>>> Subject: [Nagios-users] check_ntp offsets >>>> >>>> I am running check_ntp plugin and I have setup an offset threshold of >>>> -w 200 -c 300 but Nagios is still showing "Offset -102.234564 secs" >>>> (Warning) >>>> >>>> Running check_ntp from command line shows NTP OK >>>> (/usr/lib/nagios/plugins/check_ntp -H hostname -w 200 -c 300) >>>> >>>> Output: NTP OK: Offset -102.234564 >>>> secs|offset=-102.234564s;200.000000;300.000000; >>>> >>>> Here is what I have added: >>>> >>>> edit /etc/nagios/objetcs/command.cfg and add: >>>> >>>> define command{ >>>> command_name check_ntp >>>> command_line $USER1$/check_ntp -H $HOSTADDRESS$ -w $ARG1$ -c >>>> $ARG2$ >>>> } >>>> >>>> edit /etc/nagios/objetcs/server.cfg and add: >>>> >>>> define service{ >>>> use critical-service >>>> host_name hostname >>>> service_description NTP >>>> check_command check_ntp!200!300 >>>> } >>> According to your check definition, the result is absolutely correct. >>> You asked it to warn you if the offset is more than 200 seconds, and go >>> critical if over 300 seconds. >>> >>> What you were probably hoping for were thresholds in milliseconds. In >>> that case, you'll want to set -w and -c to fractional values ("-w 0.2 -c >>> 0.3", or whatever values you actually want as thresholds). >> The offset and thresholds are both in seconds: >> >> $ ./check_ntp -H pool.ntp.org -w 0.001 -c 0.01 >> NTP WARNING: Offset 0.008824706078 secs |offset=0.008825s;0.001000;0.010000; >> > > I have tried all the suggestions but still a no go. > > I still get "offset=-105.293049s;60.000000;120.000000;" > and "Offset -105.293049 secs"
According to that result above you're using the default thresholds (60.000000;120.000000), meaning that you're not passing the arguments correctly. Verify your definitions (especially look for typos - you may have two very-similar "check_ntp" commands defined), or use the echo trick to see which what command you're actually running. Use: command_line echo $USER1$/check_ntp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ This will skip the check and print the command that normally runs instead. - -- Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKi6sb6dZ+Kt5BchYRAsfIAKCosd5iB9nhDFXLZVZxls9DlWmHiwCgpQ+D CsXIrBr63mx7axlJ5/+p2aY= =PXRE -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null