Snmp-scan.php more info

Hey,

I’m using snmp-scan.php to add servers to LibreNMS every day using a cron job. The downside is that we don’t know if a server was added or removed. Is it possible to add a feature or tweak an option to get more information about the process?

Unfortunately, this doesn’t mean much to us:

Range: 10.16.160.0/24

-*..*.*.............**....******.......*............................................................*.........**..............................................................................................................................................

Scanned 254 IPs, Already known 15 Devices, Added 0 Devices, Failed to add 1 Devices.

Runtime: 1002.8228869438 secs
1 Like

You can add the -d for debug info

1 Like

Thanks for the tip, it’s helpful but still not as good as making my own wrapper over the API to get some normal output that can be helpful for troubleshooting and reporting.

Also, FYI, snmp-scan.PHP cannot remove devices.

1 Like

Thanks, I wasn’t sure.

Pull request in:

https://github.com/librenms/librenms/pull/5838

-bash-4.2$ ./snmp-scan.php -i -r 192.168.10.0/24
Range: 192.168.10.0/24
Scanning: 192.168.10.1
Could not connect, please check the snmp details and snmp reachability over udp
  SNMP v2c: No reply with community my-community
  SNMP v3: No reply with credentials root/noAuthNoPriv
  SNMP v1: No reply with community my-community
Could not connect, please check the snmp details and snmp reachability over tcp
  SNMP v2c: No reply with community my-community
  SNMP v3: No reply with credentials root/noAuthNoPriv
  SNMP v1: No reply with community my-community
Failed to Add Device 192.168.10.1

Scanning: 192.168.10.2
Unpingable Device 192.168.10.2

Scanning: 192.168.10.3
Unpingable Device 192.168.10.3

Scanning: 192.168.10.4
Unpingable Device 192.168.10.4

Scanning: 192.168.10.5
Unpingable Device 192.168.10.5