use Carp;
use lib "@@LIBDIR@@";
-$CRIT_WARN_LEVEL = 1;
-
$0 = "spong-network";
use Sys::Hostname;
# If counter < $CRIT_WARN_LEVEL, reduce status to yellow
# else pass a critical as a critical
# If current status is not red, reset the critical level counter.
-# if ($status eq 'red') {
-# $crit_count += 1;
-# $color = ($crit_count < $CRIT_WARN_LEVEL) ? 'yellow' : 'red';
-# $summary = "($crit_count/$CRIT_WARN_LEVEL) " . $summary
-# } else {
+ if ($status eq 'red') {
+ $crit_count += 1;
+ $color = ($crit_count < $CRIT_WARN_LEVEL) ? 'yellow' : 'red';
+ $summary = "($crit_count/$CRIT_WARN_LEVEL) " . $summary
+ } else {
$crit_count = 0;
$color = $status;
-# }
+ }
&debug("$status - $crit_count - $CRIT_WARN_LEVEL - $color - $summary");
# Save the critical counter in the host for the service
-# if ($color ne "green") {
-# $HOSTS{$host}->{'service'}->{$service}->{'count'} = $crit_count;
-# } else {
-# undef $HOSTS{$host}->{'service'}->{$service}->{'count'};
-# }
+ if ($color ne "green") {
+ $HOSTS{$host}->{'service'}->{$service}->{'count'} = $crit_count;
+ } else {
+ undef $HOSTS{$host}->{'service'}->{$service}->{'count'};
+ }
eval {
&status( $SPONGSERVER, $host, $service, $color, $summary, $message );