Skip to content

Commit 89df55b

Browse files
FliesLikeABrickRyan Rawdon
and
Ryan Rawdon
authored
Proposed enhancement for #385 to allow IPv4 or IPV6 preference in SSH… (#390)
* Proposed enhancement for #385 to allow IPv4 or IPV6 preference in SSH probe, passing -4 or -6 to ssh-keyscan process. Also with an option to override/reset parent section inheritance * Updated CHANGES for #385 #390 --------- Co-authored-by: Ryan Rawdon <[email protected]>
1 parent 2038866 commit 89df55b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
- Enhancement to SSHProbe allows specification of IPv4 vs IPv6 transport, #385
23
- InfluxDB 2.x v1 (compatibility) api doesn't set the "WWW-Authenticate" header (violating rfc7235).
34
Work around this issue by manually setting the Authorization header @HandyMenny
45
- use actual link for form submission @michaelharo

lib/Smokeping/probes/SSH.pm

+12-1
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,14 @@ sub pingone ($){
8282

8383
my $host = $target->{addr};
8484

85-
my $query = "$self->{properties}{binary} -t $target->{vars}->{keytype} -p $target->{vars}->{port} $host";
85+
my $query = "$self->{properties}{binary} -t $target->{vars}->{keytype} -p $target->{vars}->{port}";
8686
my @times;
8787

88+
# if ipv4/ipv6 proto was specified in the target, add it unless it is "0"
89+
if ($target->{vars}->{ssh_af} && $target->{vars}->{ssh_af} ne "0") {
90+
$query .= " -$target->{vars}->{ssh_af}";
91+
}
92+
$query .= " $host";
8893
# get the user and system times before and after the test
8994
$self->do_debug("query=$query\n");
9095
for (my $run = 0; $run < $self->pings; $run++) {
@@ -142,6 +147,12 @@ sub targetvars {
142147
_example => '5000',
143148
_default => '22',
144149
},
150+
ssh_af => {
151+
_doc => "Address family (IPv4/IPV6) to use when testing the ssh connection, specify 4 or 6. Specify 0 to reset to default system preference, instead of inheriting the value from parent sections.",
152+
_re => '\d+',
153+
_example => '4',
154+
_default => '0',
155+
},
145156
})
146157
}
147158
1;

0 commit comments

Comments
 (0)