From ff1664925b367b656092c710d6c21588acbb3b74 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Fri, 17 Mar 2006 23:06:54 +0000 Subject: [PATCH] Replace all OK: WARNING: CRITICAL: UNKOWN: bits with: OK - WARNING - CRITICAL - UNKNOWN - as this was breaking message parsing on the Nagios side. --- check_afsspace | 10 +++++----- check_bos | 8 ++++---- check_rxdebug | 12 ++++++------ check_udebug | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/check_afsspace b/check_afsspace index 2264b8e..e3d7993 100755 --- a/check_afsspace +++ b/check_afsspace @@ -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; } diff --git a/check_bos b/check_bos index af6af95..0b90c3a 100755 --- 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 = ; @@ -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; } } diff --git a/check_rxdebug b/check_rxdebug index 3ee184e..1577ae2 100755 --- a/check_rxdebug +++ b/check_rxdebug @@ -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 () { } 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; } diff --git a/check_udebug b/check_udebug index 266a71f..45cadd4 100755 --- a/check_udebug +++ b/check_udebug @@ -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 () { } 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 will always print out a single line of output. That line -will be C if everything is fine, or C followed by +will be C if everything is fine, or C followed by an error message otherwise. =head1 OPTIONS -- 2.39.5