Skip to content

Host Discovery

Terminal window
# Standard discovery
sonar-catalog discover
# Deep discovery (SSH into hosts to find remote mounts)
sonar-catalog discover --deep

Parses fully resolved autofs maps from automount -m. Falls back to reading /etc/auto.master and referenced map files directly.

/export/data
# What sonar-catalog reads:
automount -m

Queries known NFS servers for their exports:

Terminal window
showmount -e sonar-server-01
# /export/survey (everyone)
# /export/data 192.168.1.0/24

Reads the kernel ARP table to find recently-contacted hosts:

Terminal window
ip neigh
# 192.168.1.10 dev eth0 lladdr aa:bb:cc:dd:ee:ff REACHABLE

Probes TCP port 22 across configured subnets. Disabled by default — enable in config:

{
"discovery": {
"use_subnet_scan": true,
"scan_subnets": ["192.168.1.0/24", "10.0.0.0/16"]
}
}

Only discover hosts matching glob patterns:

{
"discovery": {
"hostname_patterns": ["sonar-*", "nas-*", "ss-*"]
}
}

Never discover or crawl these hosts:

{
"discovery": {
"host_blacklist": ["192.168.1.1", "gateway"]
}
}

Only these hosts are allowed (overrides pattern matching):

{
"discovery": {
"host_whitelist": ["sonar-01", "sonar-02", "nas-backup"]
}
}
FieldDefaultDescription
ssh_user"xyz"Username for SSH probes
ssh_timeout3Connection timeout (seconds)
ssh_auth_method"key""key", "sshpass_file", or "sshpass_env"
ssh_key_pathnullPath to SSH private key (uses ssh-agent if null)
ssh_host_key_policy"accept-new""accept-new", "no", or "yes"

With --deep, the discovery engine SSHes into each accessible host and runs mount discovery remotely — finding NFS mounts that aren’t visible from the local machine.

Terminal window
sonar-catalog discover --deep
Terminal window
sonar-catalog hosts
sonar-catalog hosts --output json