Search code examples
snmpmonitorsnmp-trap

How to monitor a device with SNMP


I've been given a task to write some code to notify administrators if the device sends a trap. Also I'd like to be able to check upon the device as well.

I'm not so sure where to begin. Is there a test server online where I can test if I setup the device correctly? (Whether it send traps according to the condition I set?)

If I were to write code to monitor this device, I think I should learn how the snmp and mib files work exactly. Is there good summary and reference for me?

Is there some simple example code for snmp?


Solution

  • You can consider 2 basic ways to check whether the device of interest generating/sending out SNMP traps.

    1. You can just run wireshark on the device (if possible) or on the target server (where the traps supposed to arrive). Then you can filter the traffic using default SNMP ports. For example it could be one of the following: 161, 162, 10161, 10162.
    2. You can install a MIB browser on the target server and see if any traps arrive. There are number of available free applications on the web.