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:
nemunaire 2026-05-15 17:18:49 +08:00
commit bf28f6a8b2
3 changed files with 6 additions and 7 deletions

View file

@ -57,9 +57,8 @@ func (p *sshProvider) Collect(ctx context.Context, opts sdk.CheckerOptions) (any
includeAuthProbe := sdk.GetBoolOption(opts, OptionIncludeAuthProbe, true)
ports := parsePorts(optString(opts, OptionPorts, ""))
// Port 22 is always probed.
if !containsUint16(ports, DefaultSSHPort) {
ports = append([]uint16{DefaultSSHPort}, ports...)
if len(ports) == 0 {
ports = []uint16{DefaultSSHPort}
}
// Origin is the FQDN where the service is mounted: svc.Domain holds the