> Sorry that I went on your nerve again:
No - you haven't annoyed me.
The only reason I responded on the -coders list was that
Robert's response was misleading in terms of the question
that you'd asked.
Since these messages are archived, I'm reluctant to let
inaccurate replies go unchallenged, in case they mislead
people in the future.
(Yes, I know - it's naive in the extreme to expect people
to read the documentation, let alone search mailing list
archives. But I can dream....)
> my question was how I can send a trap with all informations
> like MIB, Trapname , OID etc.
OK - in that situation, Robert's response would be quite correct.
The call "send_easy_trap" will trigger a notification, but
doesn't allow ypu to specify a varbind list to accompany it.
To do that you need to use one of:
send_v2trap
send_trap_vars
or send_enterprise_trap_vars
send_v2trap requires you to specify the trap as a varbind
snmpTrapOID.0 = {yourTrap}
at the head of the varbind list - even if you actually want
to send an SNMP v1 trap.
The other two take v1-style (trap,specific) numbers as well
as the varbind list to add.
If you're wanting to specify your own enterprise OID,
then you probably need to use send_enterprise_trap_vars
Something like:
oid myEntOid[] = { 1,3,6,1,..... };
send_enterprise_trap_vars( SNMP_TRAP_ENTERPRISESPECIFIC, 1,
myEntOid, OID_LENGTH(myEntOid),
myTrapVarbindList);
where myTrapVarbindList is the head of a list of the varbinds that
you want to include.
> i can send a trap manualy like :
>
> snmptrap -v 2c -c public localhost '' SIP-SER-MIB::sipserMaxUsersTrap
> SIP-SERVER-MIB::sipRegMaxUsers.1 u 2222
> how can i handle that with send_easy_trap or sendv2_trap ?
With sendv2_trap, you'd need to create two 'netsnmp_variable_list'
structures - holding
snmpTrapOID.0 = SIP-SER-MIB::sipserMaxUsersTrap
and
SIP-SERVER-MIB::sipRegMaxUsers.1 = 33
respectively (and linked together using 'next_variable')
With send_enterprise_trap_vars, you'd only need a varbind for
the sipRegMaxUsers.1 = 33 assignment, and would specify the
trap as
send_enterprise_trap_vars( SNMP_TRAP_ENTERPRISESPECIFIC, N,
sipserTrapPrefix, .... )
(where
sipserMaxUsersTrap := { sipserTrapPrefix N }
)
Dave
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
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