0

Recently I have been asked a Q in interview. If SNMP agent is sending a "clear alarm" to SNMP manager , and "clear alarm" get lost in network , how will you recover that , given that SNMP uses UDP. How will SNMP manager get to know that there was a "clear alarm" which agent sent ,but SNMP manager didn't receive it? I was not able to answer, Can somebody please clarify?

pankaj kushwaha
  • 369
  • 5
  • 20
  • You can't know about things that didn't happen. Maybe there's something in the SNMP protocol that lets the server ask for updates, but it's getting pretty abstruse for an interview unless it's an SNMP position, in which case you either knew the answer or weren't qualified to apply. – user207421 Aug 11 '15 at 08:09
  • Unlike your lost keys, you can't recover a lost UDP packet - so you wouldn't know about that "clear alarm". If the SNMP server exposes the same alarm/trap as a variable, you'd have to poll that variable in addition to receiving traps. – nos Aug 11 '15 at 08:28
  • You cannot recover lost trap messages, but inform messages are (or should be) resent until the receiver sends an acknowledgement. – user1793963 Aug 11 '15 at 09:41
  • Just send the clear message twice everytime. – Chris Desjardins Aug 11 '15 at 10:46
  • Not a programming question, I think. Anyway, the comments above are right (and they should be answers). – Jolta Aug 11 '15 at 15:46

1 Answers1

1

Paraphrasing earlier comments, options are

  1. A more more robust notification mechanism e.g INFORMs (which are an application-level acknowledged version) not TRAPs. TCP not UDP is also possible though doesn't guarantee application logic actually processes the notification. However UDP is the default for SNMP for good reasons, as described at this SO answer.

  2. Look at bigger picture (which I suspect the interviewer wanted!) and say SNMP manager should treat notifications regarding that alarm, as just an optimization (so it usually get alerted very quickly regarding alarm changes) but do not rely on them solely. Hence, SNMP manager should also poll the agent regularly to get the real state of that alarm, and use that as that polled state as the definite version, regardless of what earlier notifications imply. See this article.

Community
  • 1
  • 1
k1eran
  • 4,492
  • 8
  • 50
  • 73