Thanks Dave.
The only other way I can think of is using netsnmp_variable_list instead of
netsnmp_pdu and calling snmp_varlist_add_var() instead of
snmp_pdu_add_variable(). Do you think that would work?
I am not sure if I can simply call the function send_v2trap() to send the
notification, because how would the function know the target address?
Right now my build environment is broken, so it'd be a couple of hours before I
fix that and make these changes and recompile to see if it is working.
Thanks much for your help.
Kapil
Dave Shield <[EMAIL PROTECTED]> wrote: On 08/01/07, Kapil Sharma wrote:
> I have some legacy code that I worked on a bit, and I am able to get it to
> send SNMPv1 traps. I want it to send SNMPv2c traps, and that's not happening
> (The SNMP trap receiver gets the varbinds, community string, timestamps and
> everything allright, but says "Invalid Notification Format").
Are you constructing the varbind list appropriate for an SNMPv2c trap?
This is *not* the same as the SNMPv1 trap format.
> The NET-SNMP FAQ reads that only the entry trapsink/trap2sink/trapinform in
> the file snmpd.conf determines which kind of trap is sent out.
It also says that traps should be sent using 'send_easy_trap()' or
'send_v2trap()'
(or similar). It's the code behind these routines that handles
converting between
v1 and v2 formats.
If you are sending the traps directly yourself, then it's your
responsibility to
construct the trap PDU in the appropriate format.
Dave
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders