Skip to content

Commit

Permalink
Proposed enhancement for #385 to allow IPv4 or IPV6 preference in SSH… (
Browse files Browse the repository at this point in the history
#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]>
  • Loading branch information
FliesLikeABrick and Ryan Rawdon authored Feb 2, 2024
1 parent 2038866 commit 89df55b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

- Enhancement to SSHProbe allows specification of IPv4 vs IPv6 transport, #385
- InfluxDB 2.x v1 (compatibility) api doesn't set the "WWW-Authenticate" header (violating rfc7235).
Work around this issue by manually setting the Authorization header @HandyMenny
- use actual link for form submission @michaelharo
Expand Down
13 changes: 12 additions & 1 deletion lib/Smokeping/probes/SSH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ sub pingone ($){

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

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

# if ipv4/ipv6 proto was specified in the target, add it unless it is "0"
if ($target->{vars}->{ssh_af} && $target->{vars}->{ssh_af} ne "0") {
$query .= " -$target->{vars}->{ssh_af}";
}
$query .= " $host";
# get the user and system times before and after the test
$self->do_debug("query=$query\n");
for (my $run = 0; $run < $self->pings; $run++) {
Expand Down Expand Up @@ -142,6 +147,12 @@ sub targetvars {
_example => '5000',
_default => '22',
},
ssh_af => {
_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.",
_re => '\d+',
_example => '4',
_default => '0',
},
})
}
1;

0 comments on commit 89df55b

Please sign in to comment.