checker: make port 22 probe optional
Port 22 is now the default when no ports are configured, rather than being unconditionally appended. Users can now probe non-standard ports without also probing port 22.
This commit is contained in:
parent
f77895dcab
commit
bf28f6a8b2
3 changed files with 6 additions and 7 deletions
|
|
@ -57,9 +57,8 @@ func (p *sshProvider) Collect(ctx context.Context, opts sdk.CheckerOptions) (any
|
||||||
includeAuthProbe := sdk.GetBoolOption(opts, OptionIncludeAuthProbe, true)
|
includeAuthProbe := sdk.GetBoolOption(opts, OptionIncludeAuthProbe, true)
|
||||||
|
|
||||||
ports := parsePorts(optString(opts, OptionPorts, ""))
|
ports := parsePorts(optString(opts, OptionPorts, ""))
|
||||||
// Port 22 is always probed.
|
if len(ports) == 0 {
|
||||||
if !containsUint16(ports, DefaultSSHPort) {
|
ports = []uint16{DefaultSSHPort}
|
||||||
ports = append([]uint16{DefaultSSHPort}, ports...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Origin is the FQDN where the service is mounted: svc.Domain holds the
|
// Origin is the FQDN where the service is mounted: svc.Domain holds the
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,9 @@ func (p *sshProvider) Definition() *sdk.CheckerDefinition {
|
||||||
{
|
{
|
||||||
Id: OptionPorts,
|
Id: OptionPorts,
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Label: "Additional ports",
|
Label: "Ports",
|
||||||
Placeholder: "22, 2222",
|
Placeholder: "22, 2222",
|
||||||
Description: "Comma-separated list of additional TCP ports to probe. Port 22 is always probed.",
|
Description: "Comma-separated list of TCP ports to probe. Defaults to port 22 when empty.",
|
||||||
Default: "",
|
Default: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,9 @@ func (p *sshProvider) RenderForm() []sdk.CheckerOptionField {
|
||||||
{
|
{
|
||||||
Id: OptionPorts,
|
Id: OptionPorts,
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Label: "Additional ports",
|
Label: "Ports",
|
||||||
Placeholder: "22, 2222",
|
Placeholder: "22, 2222",
|
||||||
Description: "Comma-separated list of additional TCP ports to probe. Port 22 is always probed.",
|
Description: "Comma-separated list of TCP ports to probe. Defaults to port 22 when empty.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Id: OptionProbeTimeoutMs,
|
Id: OptionProbeTimeoutMs,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue