# greater then 1
+$TCP_SIMPLE_TIMEOUT{"DEFAULT"}=[3,5,12] ; # default timeout for the tcp test ( like pop3,smtp )
+ # for all plugins that use &check_simple
+
+$TCP_SIMPLE_TIMEOUT{"smtp"}=[12,24] ; # default timeout for the tcp test
+ # for the plugin who use &check_simple with service equal "smtp"
+
+
# ---------------------------------------------------------------------------
# Thresholds, season to taste. These can be overridden on a host by host
# case in a spong.conf.<hostname> file.
my( $color, $summary ) = ( "red", "" );
my( $attempt, $start, $message, $diff, $errcd );
- for $timeout ( 3, 5, 12 ) {
+ for $timeout (@{( $TCP_SIMPLE_TIMEOUT{$service} || $TCP_SIMPLE_TIMEOUT{'DEFAULT'} || [3,5] )}) {
$start = $hires ? main::time() : time();
($errcd,$message) = &check_tcp( $host, $port, $send, $timeout );
$diff = ($hires ? main::time() : time()) - $start;
$attempt++;
if( $message =~ /$check/ ) { $color = "green"; last; }
- &debug("check_simple: $service - $host - attempt $attempt failed");
+ &debug("check_simple: $service - $host - timeout $timeout - attempt $attempt failed");
}
$diff = sprintf("%.3f",$diff);