# 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);
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) {
# 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;
}
# 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>;
# 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;
}
unless ($okay) {
$line =~ s/^\s+//;
$line =~ s/\s+$//;
- print "BOS CRITICAL: $line\n";
+ print "BOS CRITICAL - $line\n";
exit 2;
}
}
# 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);
}
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;
}
# 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);
}
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";
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