# HG changeset patch # User Christian Arnold # Date 1327311829 -3600 # Node ID 60373f213ec0009dd725d7b15a107d39e5478b00 # Parent cae04ac746e1515e45efea30bf2ae574893cab4a fixing logically for warning and critical output/return code diff -r cae04ac746e1 -r 60373f213ec0 check_ntp.pl --- a/check_ntp.pl Tue Oct 04 14:47:49 2011 +0200 +++ b/check_ntp.pl Mon Jan 23 10:43:49 2012 +0100 @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# Copyright (C) 2011 Christian Arnold +# Copyright (C) 2012 Christian Arnold # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ sub version($$); my $ME = basename $0; -my $VERSION = "2.2"; +my $VERSION = "2.3"; my %opt = ( host => "de.pool.ntp.org", @@ -83,10 +83,10 @@ my $rc = "OK"; SWITCH: { + $delta < -$opt{critical} and $rc = "CRITICAL", last; $delta < -$opt{warning} and $rc = "WARNING", last; - $delta < -$opt{critical} and $rc = "CRITICAL", last; + $delta > $opt{critical} and $rc = "CRITICAL", last; $delta > $opt{warning} and $rc = "WARNING", last; - $delta > $opt{critical} and $rc = "CRITICAL", last; } $delta = sprintf "%.1fs", $delta; @@ -106,7 +106,7 @@ print <<_VERSION; $progname version $version -Copyright (C) 2011 by Christian Arnold and Schlittermann internet & unix support. +Copyright (C) 2012 by Christian Arnold and Schlittermann internet & unix support. $ME comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. @@ -170,7 +170,7 @@ =head1 VERSION -This man page is current for version 2.2 of check_ntp. +This man page is current for version 2.3 of check_ntp. =head1 AUTHOR @@ -178,7 +178,7 @@ =head1 COPYRIGHT -Copyright (C) 2011 by Christian Arnold and Schlittermann internet & unix support. +Copyright (C) 2012 by Christian Arnold and Schlittermann internet & unix support. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. diff -r cae04ac746e1 -r 60373f213ec0 debian/changelog --- a/debian/changelog Tue Oct 04 14:47:49 2011 +0200 +++ b/debian/changelog Mon Jan 23 10:43:49 2012 +0100 @@ -1,3 +1,9 @@ +nagios-plugin-ntp (2.3) stable; urgency=low + + * fixing logically for warning and critical output/return code + + -- Christian Arnold Mon, 23 Jan 2012 10:23:43 +0100 + nagios-plugin-ntp (2.2) stable; urgency=low * added libnet-ntp-perl to build deps