From 9d4aa5f51cc6486b86020b99998ce35185fe565b Mon Sep 17 00:00:00 2001 From: Ryan Rawdon Date: Tue, 5 Dec 2023 14:27:32 -0500 Subject: [PATCH 1/2] 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 --- lib/Smokeping/probes/SSH.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/Smokeping/probes/SSH.pm b/lib/Smokeping/probes/SSH.pm index f21f53e8..677665f1 100644 --- a/lib/Smokeping/probes/SSH.pm +++ b/lib/Smokeping/probes/SSH.pm @@ -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++) { @@ -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; From 44f66d335037f3b38a455b4b89f2f9d1fa8d076b Mon Sep 17 00:00:00 2001 From: Ryan Rawdon Date: Mon, 29 Jan 2024 10:16:04 -0500 Subject: [PATCH 2/2] Updated CHANGES for #385 #390 --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index c253fb69..96ed58e7 100644 --- a/CHANGES +++ b/CHANGES @@ -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