diff options
author | Niko Tyni <ntyni@iki.fi> | 2007-10-27 15:00:42 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2007-10-27 15:00:42 +0200 |
commit | b2974cc84cbbefb8d117765acb7230530963aa5c (patch) | |
tree | 684981e37a36174d707e48bcf268317a7157f513 /lib/Smokeping/probes/Curl.pm | |
parent | 51243891b9e493882c59e582c5188f48e1127bed (diff) | |
download | smokeping-b2974cc84cbbefb8d117765acb7230530963aa5c.tar.gz smokeping-b2974cc84cbbefb8d117765acb7230530963aa5c.tar.xz |
* removed all the 'live' tests from the echoping probes --niko
* log a warning message on the first 'round' of pinging if curl or
echoping exits with non-zero status --niko
Diffstat (limited to 'lib/Smokeping/probes/Curl.pm')
-rw-r--r-- | lib/Smokeping/probes/Curl.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Smokeping/probes/Curl.pm b/lib/Smokeping/probes/Curl.pm index 7328e35..166333f 100644 --- a/lib/Smokeping/probes/Curl.pm +++ b/lib/Smokeping/probes/Curl.pm @@ -303,7 +303,20 @@ sub pingone { $self->do_debug("curl output: '$_', result: $val"); }; } - close P and defined $val and push @times, $val; + close P; + if ($?) { + my $status = $? >> 8; + my $signal = $? & 127; + my $why = "with status $status"; + $why .= " [signal $signal]" if $signal; + + # only log warnings on the first ping of the first ping round + my $function = ($self->rounds_count == 1 and $i == 0) ? + "do_log" : "do_debug"; + + $self->$function(qq(WARNING: curl exited $why on $t->{addr})); + } + push @times, $val if defined $val; } # carp("Got @times") if $self->debug; |