diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2009-12-30 17:04:14 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2009-12-30 17:04:14 +0100 |
commit | 9eb3e9ccd4d3d9fa6494a4e543d2948ceacf3639 (patch) | |
tree | 00b6933624afab57940f71027a871d06c5194b58 | |
parent | 892f12c656500ae9460250db5337cb12eb70ffe2 (diff) | |
download | smokeping-9eb3e9ccd4d3d9fa6494a4e543d2948ceacf3639.tar.gz smokeping-9eb3e9ccd4d3d9fa6494a4e543d2948ceacf3639.tar.xz |
add support for TOS setting in fping
-rw-r--r-- | lib/Smokeping/probes/FPing.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Smokeping/probes/FPing.pm b/lib/Smokeping/probes/FPing.pm index fc56ae5..66f9a07 100644 --- a/lib/Smokeping/probes/FPing.pm +++ b/lib/Smokeping/probes/FPing.pm @@ -65,6 +65,7 @@ sub new($$$) my $testhost = $self->testhost; my $return = `$binary -C 1 $testhost 2>&1`; $self->{enable}{S} = (`$binary -h 2>&1` =~ /\s-S\s/); + $self->{enable}{O} = (`$binary -h 2>&1` =~ /\s-O\s/); croak "ERROR: fping ('$binary -C 1 $testhost') could not be run: $return" if $return =~ m/not found/; croak "ERROR: FPing must be installed setuid root or it will not work\n" @@ -124,6 +125,11 @@ sub ping ($){ } push @params, "-S$self->{properties}{sourceaddress}" if $self->{properties}{sourceaddress} and $self->{enable}{S}; + if ($self->rounds_count == 1 and $self->{properties}{tos} and not $self->{enable}{O}){ + $self->do_log("WARNING: your fping binary doesn't support type of service setting (-O), I will ignore any tos configurations."); + } + push @params, "-O$self->{properties}{tos}" if $self->{properties}{tos} and $self->{enable}{O}; + my $pings = $self->pings; if (($self->{properties}{blazemode} || '') eq 'true'){ $pings++; @@ -229,6 +235,15 @@ The fping "-S" parameter . From fping(1): Set source address. DOC }, + tos => { + _re => '\d+|0x[0-9a-zA-Z]+', + _example => '0x20', + _doc => <<DOC, +Set the type of service (TOS) of outgoing ICMP packets. +You need at laeast fping-2.4b2_to3-ipv6 for this to work. Find +a copy on www.smokeping.org/pub. +DOC + }, }); } |