Random Project

Very good plugin, just another check

Hey,

added a check for Runtime againt Warning / Critical Values. Noticed that one of our UPS had a remaining runtime of 6! Minutes, but the Replacement Flag for the battery was not set.

case “runtime” {
my $ups_runtime_ticks = query_oid($oid_runtimeleft);
my $ups_runtime_mins = int($ups_runtime_ticks / 100 / 60);
my $perf_data = “|’Runtime Remaining’=$ups_runtime_mins,$warning_threshold,$critical_threshold;;”;

if ($ups_runtime_mins > $warning_threshold) {
print “OK, (Runtime remaining: $ups_runtime_mins minutes)$perf_datan”;
exit $OKAY;
} elsif ($ups_runtime_mins > $critical_threshold) {
print “Warning, (Runtime remaining: $ups_runtime_mins minutes)$perf_datan”;
exit $WARNING;
} else {
print “Critical, (Runtime remaining: $ups_runtime_mins minutes)$perf_datan”;
exit $CRITICAL;
}

#print “MINUTES: $ups_runtime_minutesn”;
#exit $OKAY;
}

Host File:

define service{
use local-service ; Name of service template to use
host_name
service_description RUNTIME
check_command check_apc!runtime -w 20 -c 10
}