aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_uptime.pl
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/check_uptime.pl')
-rwxr-xr-xplugins-scripts/check_uptime.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
index f2b47be5..1f844ff6 100755
--- a/plugins-scripts/check_uptime.pl
+++ b/plugins-scripts/check_uptime.pl
@@ -107,9 +107,9 @@ if ( $days > 14 ) {
my $pretty_uptime = "";
$pretty_uptime .= sprintf( "%d week%s, ", $weeks, $weeks == 1 ? "" : "s" ) if $weeks;
-$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days;
+$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days;
$pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours;
-$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins;
+$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins;
# Replace last occurence of comma with "and"
$pretty_uptime =~ s/, $/ and /;
# Always print the seconds (though it may be 0 seconds)
@@ -123,16 +123,16 @@ my $state_str = "UNKNOWN";
my $out_of_bounds_text = "";
if ( $uptime_seconds > $upper_crit_threshold ) {
$state_str = "CRITICAL";
- $out_of_bounds_text = "Exceeds upper crit threshold";
+ $out_of_bounds_text = "upper crit";
} elsif ( $uptime_seconds < $lower_crit_threshold ) {
$state_str = "CRITICAL";
- $out_of_bounds_text = "Exceeds lower crit threshold";
+ $out_of_bounds_text = "lower crit";
} elsif ( $uptime_seconds > $upper_warn_threshold ) {
$state_str = "WARNING";
- $out_of_bounds_text = "Exceeds upper warn threshold";
+ $out_of_bounds_text = "upper warn";
} elsif ( $uptime_seconds < $lower_warn_threshold ) {
$state_str = "WARNING";
- $out_of_bounds_text = "Exceeds lower warn threshold";
+ $out_of_bounds_text = "lower warn";
} else {
$state_str = "OK";
}
@@ -140,7 +140,7 @@ if ( $uptime_seconds > $upper_crit_threshold ) {
$msg = "$state_str: ";
$msg .= "uptime is $uptime_seconds seconds. ";
-$msg .= "$out_of_bounds_text. " if $out_of_bounds_text;
+$msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text;
$msg .= "Running for $pretty_uptime. " if $opt_f;
if ( $opt_s ) {
chomp( my $up_since = `uptime -s` );