check_ntp.pl
changeset 4 60373f213ec0
parent 3 cae04ac746e1
--- 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.