Re: SNMP traps

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 16/05/07, pavithra s <[email protected]> wrote:
> My doubt is how should the traps be generated in snmp.I m using
> snmp_alarm_register function to generate trapd in snmptrapd.

There are actually two separate questions here:

  a)  How to generate traps       (i.e. what code to use)
  b)  When to generate traps   (i.e. what should trigger this code).

I'd suggest that you approach this as two separate issues.

The mib2c config 'mib2c.notify.conf'  can be used to generate
template code for a suitable routine to generate such a trap.
(The output is primarily intended for use within an agent or
 subagent, but it would be relatively straightforward to adapt
 this for use in a standalong application).

The question of *when* to invoke this code is a harder one.
Essentially, you need to think about the normal behaviour
of your application.   What are the circumstances in which
you'd want to generate this trap?   Is there a code path that
would naturally be invoked in these circumstances?
   In which case, it might be possible to insert a call to this
notification routine in that code path.  That would automatically
trigger sending the trap.


If there isn't such a code path (or it can't be changed), then
you would typically use 'snmp_alarm_register' (or similar)
to invoke some checking code on a regular basis.
   That code would test whether the appropriate circumstances
have arisen for generating the trap - and if so, then invoke
the first notification routine.

  If this is happening within the context of an SNMP agent
(and is triggered by other SNMP MIB variables) then it
might be possible to use the DisMan Event MIB to handle
this without requiring any new code at all.  But if this is a
standalone application, then you'd need to run the checks
yourself.


But if coding this yourself, I would definitely attack this
using two separate routines, as described above.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.