WHD Asset Discovery
The built in asset discovery features of WHD certainly cater for most scenarios and can easily synchronize with other Solarwinds solutions such as Network Performance Monitor, Network Configuration Monitor and Server & Application Monitor to provide asset management of network devices however there are some limitations with these options.
SNMP Asset Discovery
Devices such as printers, MFD's etc are often not monitored as nodes within NPM or other solutions and the built in discovery option in WHD do not provide an SNMP discovery option. With that in mind I set out to create a custom solution.
The Solution 1.0
The following Powershell script can be used to scan a subnet for SNMP assets and insert these into a table on your chosen SQL server for the purposes of synchronization with WHD.
How does this script work?
This script is designed to poll SNMP devices and add the results of this scan to a database Table. The script will delete all entries in the table prior to commencing the scan (One area which could be improved in any future edit) This script works by calling the iterate-subnet function. Calling the function requires passing it the 1st 3 octets of the subnet e.g iterate-subnet -Subnet "10.199.4." The function will the loop through each I.P in the subnet and check for an ICMP response using the Test-Connection cmdlet with a -quiet switch which returns a True or False value. If "True" the I.P will be polled for 3 seperate OID's in the 220.127.116.11.2.1.1 branch of the SNMP MIB-2 System Mib. These are
Based on the value returned for sysDescrp, the Vendor can be identified and is selected using the switch -wilcard method , perhaps not as elegant a solution as I would like but certainly easier than maintaining a separate table just for this purpose :-)
Once the SNMP values are polled, the script will add these values to the variables required by the SQL stored procedure.
The idea is that this could be run as a windows scheduled tasks to automate the discovery of any IP & SNMP assets. The attached filed are all that are required to create the Stored procedures and table used by the script.
I hope this may server as a starting point for anyone looking to add these asset types into WHD.
With obvious room for improvement and refinement All Comments and suggestions are welcome!
Sales Engineer - Solarwinds