let's say i want to make a monitoring application to monitor a bunch of devices in my network, my question is quite simple: why use SNMP-Get requests when devices can send trap to the manager ? does popular monitoring applications use traps or SNMP-get requests ? thanks.
1 Answers
There are a couple of considerations, and this can be generalized to the management philosophies of push (traps, notifications) vs. pull (get* requests):
1) only the management application knows exactly the information it wants to get from the device. In pull architectures (ie. SNMP). it asks for the information via GET* requests. In push architectures, it has to configure a push, eg. the device has to be setup to send the notifications, eg. if a instrumented value is above a certain threshold, which is expensive.
2) maintaining the push configuration on the device is expensive. In SNMP, the device is supposed to be dumb, the manager is supposed to be smart. These days devices are getting more powerful, thus you are seeing more push models (certain MIBs, NetFlow, sFlow, etc).
3) besides configuration, just making notifications reliable is expensive. In SNMP there are TRAP and Inform-Request PDUs. The former is unreliable, and is regarded merely as a hint that something happened on the device, the application then uses pull to get all the info. The latter is acknowledged, with the device having to maintain information to make it reliable (timeouts, retransmits, etc).
With the above, just think of the effort to setup push (traps) on a device exclusively:
1) your application (one of potentially multiple) has to configure the device to tell it that you want traps/notifications. That in itself cannot be done exclusively via push, there MUST be some SET requests;
2) your app has to tell it exactly what traps you want, again SET requests;
3) your device now has to make sure each notification reliably gets to all the applications that have registered themselves with the device.
As far as "popular monitoring applications", in SNMP the vast majority of info is pulled, notifications are used to indicate an exception that prompts pulling information.

- 1,432
- 1
- 7
- 17
-
1The trouble with informs is that if they're failing, the agent knows about it, but the manager still doesn't. Thus at the end of the day information is still missing and this can be problematic. It's mitigated a little by a periodic _heartbeat_ notification but really you want to be using Gets for anything but point-in-time alarm notifications. – Lightness Races in Orbit Nov 09 '18 at 10:47