if ( $cmd eq "status" ) {
- # Remove current np files if event is a change in status (i.e. dur = 0)
- if ( $duration == 0 ) {
- &remove_np_files($host,$service);
- }
-
# If the color is 'red' and duration is non-zero, call spong-message for
# escalation notifications
if ($color eq 'red' && $duration != 0) {
&debug("change in state to red, messaging a human",2);
&send_message( $host, $service, $color, $time, $sum, $duration );
}
+
+ # Remove current np file if service has recovered
+ # Normally this would be done in spong-message, but spong-messsage
+ # is not called when $SEND_MESSAGE = "RED" for recovery events
+ if ( $duration == 0 && $color ne 'red' ) {
+ &remove_np_files($host,$service);
+ }
+
} elsif ( $SEND_MESSAGE eq "RED-CHANGE" ) {
# If status has changed and either color is red, call spong-message
if ( ( -f "$SPONGDB/$host/services/$service-red" or $color eq "red" )