From: Stephen L Johnson Date: Tue, 11 Apr 2000 00:45:52 +0000 (+0000) Subject: re-instated critical error escalation facility X-Git-Tag: spong-2_7-alpha5~15 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b0abfae072185467d65b49fa91cce671ec3d07;p=spong.git re-instated critical error escalation facility --- diff --git a/src/spong-network.pl b/src/spong-network.pl index ed06155..d5ef92e 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -20,8 +20,6 @@ use Carp; use lib "@@LIBDIR@@"; -$CRIT_WARN_LEVEL = 1; - $0 = "spong-network"; use Sys::Hostname; @@ -125,23 +123,23 @@ sub do_check { # 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 );