Example scripts using the SNMP API
- Last Updated: April 2, 2026
- 2 minute read
- WhatsUp Gold
- Version 2026
These example scripts demonstrate the SNMP API in use. All of these examples are written in JScript:
Initialize an SNMP object with error check from a device ID
The SnmpRqst.Initialize method returns a ComResult object that tells if the initialization succeeded or failed.
This script uses the Failed method to detect an error and logs an error message using GetErrorMsg if the initialization failed:

Alternatively, initialization using a device address and an SNMP credential ID:

Send a standard Get and log the polled value
Send a Get using non-standard port and timeout

Walk the MIB using GetNext

Read multiple objects in one request

Reboot a Cisco device using Set

Note: As of WhatsUp Gold v14, SNMP values can be set using the built-in SNMP Set
Action. For more information, see Using an SNMP Set
Action.