diff --git a/galanga/nagios-irc-bot.pl b/galanga/nagios-irc-bot.pl index d482fd9..bb96a77 100755 --- a/galanga/nagios-irc-bot.pl +++ b/galanga/nagios-irc-bot.pl @@ -335,7 +335,11 @@ sub on_public { printf CMDPIPE "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%lu\n",time(),$host,$svc,time(); printf "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%lu\n",time(),$host,$svc,time(); close CMDPIPE; - $conn->privmsg([ @to ], sprintf ( "Recheck forcé pour %s: %s", $host, $svc ) ); + if ( scalar @ACKS <= $FLOOD_MAX ) + { + usleep ( $USLEEP_TIME ); + $conn->privmsg([ @to ], sprintf ( "Recheck forcé pour %s: %s", $host, $svc ) ); + } &refresh (); my $msg; if( scalar @ACKS == 0 or scalar @ACKS == 1) { @@ -343,6 +347,7 @@ sub on_public { } else { $msg = "%d problemes enregistres"; } + usleep ( $USLEEP_TIME ); $conn->privmsg([ @to ], sprintf ( $msg, ( scalar @ACKS )) ); } else