]> git.michaelhowe.org Git - packages/a/afs-monitor.git/commitdiff
Replace all OK: WARNING: CRITICAL: UNKOWN: bits with:
authorQuanah Gibson-Mount <quanah@stanford.edu>
Fri, 17 Mar 2006 23:06:54 +0000 (23:06 +0000)
committerQuanah Gibson-Mount <quanah@stanford.edu>
Fri, 17 Mar 2006 23:06:54 +0000 (23:06 +0000)
OK -
WARNING -
CRITICAL -
UNKNOWN -

as this was breaking message parsing on the Nagios side.

check_afsspace
check_bos
check_rxdebug
check_udebug

index 2264b8e82408b38c517adf2beb3939079abaf152..e3d79931cf7ebc6d4bdad8ef966a9804feea586c 100755 (executable)
@@ -78,7 +78,7 @@ if ($WARNINGS > $CRITICAL) {
 
 # Set up the alarm.
 $SIG{ALRM} = sub {
-    print "AFS CRITICAL: network timeout after $TIMEOUT seconds\n";
+    print "AFS CRITICAL - network timeout after $TIMEOUT seconds\n";
     exit 2;
 };
 alarm ($TIMEOUT);
@@ -89,7 +89,7 @@ alarm ($TIMEOUT);
 my (@critical, @warnings, @all);
 my @data = `$VOS partinfo '$host' 2> /dev/null`;
 if ($? != 0) {
-    print "AFS CRITICAL: cannot contact server\n";
+    print "AFS CRITICAL - cannot contact server\n";
     exit 2;
 }
 for (@data) {
@@ -105,13 +105,13 @@ for (@data) {
 
 # Exit with the appropriate error messages.
 if (@critical) {
-    print "AFS CRITICAL: @critical\n";
+    print "AFS CRITICAL - @critical\n";
     exit 2;
 } elsif (@warnings) {
-    print "AFS WARNING: @warnings\n";
+    print "AFS WARNING - @warnings\n";
     exit 1;
 } else {
-    print "AFS OK: @all\n";
+    print "AFS OK - @all\n";
     exit 0;
 }
 
index af6af9552b3aa94ac796bd01c3d58712353a26c8..0b90c3a88098021172fee0b4ffd0a0e6d2fa7eb4 100755 (executable)
--- a/check_bos
+++ b/check_bos
@@ -84,14 +84,14 @@ if (@ARGV) {
 
 # Set up the alarm.
 $SIG{ALRM} = sub {
-    print "BOS CRITICAL: network timeout after $TIMEOUT seconds\n";
+    print "BOS CRITICAL - network timeout after $TIMEOUT seconds\n";
     exit 2;
 };
 alarm ($TIMEOUT);
 
 # Collect the bos output into a variable.
 unless (open (BOS, "$BOS status $host -noauth -long 2>&1 |")) {
-    print "BOS UNKNOWN: cannot run bos\n";
+    print "BOS UNKNOWN - cannot run bos\n";
     exit 3;
 }
 my @bos = <BOS>;
@@ -100,7 +100,7 @@ close BOS;
 # Make sure that bos was successful.  Note that it generally does return
 # success even if it can't contact the bos server.
 if ($? != 0) {
-    print "BOS CRITICAL: bos status failed\n";
+    print "BOS CRITICAL - bos status failed\n";
     exit 2;
 }
 
@@ -117,7 +117,7 @@ for my $line (@bos) {
     unless ($okay) {
         $line =~ s/^\s+//;
         $line =~ s/\s+$//;
-        print "BOS CRITICAL: $line\n";
+        print "BOS CRITICAL - $line\n";
         exit 2;
     }
 }
index 3ee184ed0c9096b5ff8ee0c2c9dcfd553f3d4f72..1577ae2b444cda5085d74073a751b01033be7bde 100755 (executable)
@@ -79,7 +79,7 @@ if ($WARNINGS > $CRITICAL) {
 
 # Set up the alarm.
 $SIG{ALRM} = sub {
-    print "AFS CRITICAL: network timeout after $TIMEOUT seconds\n";
+    print "AFS CRITICAL - network timeout after $TIMEOUT seconds\n";
     exit 2;
 };
 alarm ($TIMEOUT);
@@ -99,23 +99,23 @@ while (<RXDEBUG>) {
 }
 close RXDEBUG;
 if ($? != 0) {
-    print "AFS CRITICAL: cannot contact server\n";
+    print "AFS CRITICAL - cannot contact server\n";
     exit 2;
 }
 unless (defined $blocked) {
-    print "AFS CRITICAL: cannot parse rxdebug output\n";
+    print "AFS CRITICAL - cannot parse rxdebug output\n";
     exit 2;
 }
 
 # Check the connection count against our limits and make sure that it's okay.
 if ($blocked >= $CRITICAL) {
-    print "AFS CRITICAL: $blocked blocked connections\n";
+    print "AFS CRITICAL - $blocked blocked connections\n";
     exit 2;
 } elsif ($blocked >= $WARNINGS) {
-    print "AFS WARNING: $blocked blocked connections\n";
+    print "AFS WARNING - $blocked blocked connections\n";
     exit 1;
 } else {
-    print "AFS OK: $blocked blocked connections\n";
+    print "AFS OK - $blocked blocked connections\n";
     exit 0;
 }
 
index 266a71fc9e9880f621b57f077b7839a49b536135..45cadd48d6f290d7990f657320b6318a5913e9e5 100755 (executable)
@@ -67,7 +67,7 @@ if (@ARGV || !(defined ($host) && defined ($port))) {
 
 # Set up the alarm.
 $SIG{ALRM} = sub {
-    print "UBIK CRITICAL: network timeout after $TIMEOUT seconds\n";
+    print "UBIK CRITICAL - network timeout after $TIMEOUT seconds\n";
     exit 2;
 };
 alarm ($TIMEOUT);
@@ -88,16 +88,16 @@ while (<UDEBUG>) {
 }
 close UDEBUG;
 if ($? != 0) {
-    print "UBIK CRITICAL: udebug failed\n";
+    print "UBIK CRITICAL - udebug failed\n";
     exit 2;
 }
 
 # Check the results.
 if ($issync && !$recovery) {
-    print "UBIK CRITICAL: recovery state not 1f\n";
+    print "UBIK CRITICAL - recovery state not 1f\n";
     exit 2;
 } elsif (!$issync && !$synchost) {
-    print "UBIK CRITICAL: no sync site\n";
+    print "UBIK CRITICAL - no sync site\n";
     exit 2;
 } else {
     print "UBIK OK\n";
@@ -127,7 +127,7 @@ recovery state is 1f if that server is the sync site, or that a sync site is
 known if that server doesn't claim to be the sync site.
 
 B<check_udebug> will always print out a single line of output.  That line
-will be C<UBIK OK> if everything is fine, or C<UBIK CRITICAL: > followed by
+will be C<UBIK OK> if everything is fine, or C<UBIK CRITICAL - > followed by
 an error message otherwise.
 
 =head1 OPTIONS