Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed enhancement for #385 to allow IPv4 or IPV6 preference in SSH… #390

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading