Re: Generating a trap with table infomation

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 13 August 2010 13:28, Norasyikin MD Ali <[email protected]> wrote:
> I'm trying to generate a trap containing all the information from my
> activeAlarmTable which has 8 columns.
> In my agent, I created a function :
> tr_status tr_mib_agent_generate_alarm_event_trap(int type,
>                         const char *oidstr1, uint32_t id,
>                         const char *oidstr2, int class,
>                         const char *oidstr3, char *oid,
>                         const char *oidstr4, int cause,
>                         const char *oidstr5, int type,
>                         const char *oidstr6, int severity,
>                         const char *oidstr7, char *reason,
>                         const char *oidstr8, char *time){

Why are you passing the OIDs into the routine?

The list of varbinds is fixed for a given trap, so the list of
OIDs is basically known, and can be defined within the
body of the routine itself.   (Or as Wes suggests, use a
single OID buffer, and tweak the column subidentifier for
each varbind in turn).
   In either case, all you need to pass in as parmeters are
the index of the row concerned, and the list of values.

You can use 'mib2c.notify.conf' to generate a suitable template
for this routine.

Dave

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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.