On 17/07/06, Ovidiu Deac <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I am working on an application that sends SNMP traps when some special
> conditions occur. The traps are sent using send_v2trap() like this:
>
> 1. create a netsnmp_variable_list
> 2. add to it the trap oid as a variable of type Object Identifier
Can you expand on this step please?
What is the exact varbind that you are adding?
Is the OID of your trap the _name_ of this varbind, or the _value_?
Since you're using the SNMPv2-style API, this varbind ought to
be of the form:
snmpTrapOID.0 = .1.3.6.1.4.1.23668.9999.15.5
> But we have the following problem: one of our customer complains that
> the Trap Packet is wrong formatted and he asks that the trap should have
> the following fields like this:
> enterprise-code - should have the oid of the trap EXCEPT the last number in
> the OID
> specific-trap - should have the last number of the trap's OID
> He says that this way he can identify the trap via the specific code.
That is the correct format for traps sent using SNMPv1.
As long as you are setting up the trap correctly, the Net-SNMP agent should
convert this into the SNMPv1 equivalent when required.
Note that the version of the trap as sent, may not match the format that you
supplied - see the FAQ entry:
How can I get the agent to send an SNMPv1 (or SNMPv2c) trap?
> Now my questions are:
> 1. Is his request correct? Is this the way other people identify the traps?
When using SNMPv1, yes.
When using SNMPv2c or SNMPv3, no.
> 2. Isn't it more handy to identify a trap by its enterprise code?
Yes - that's why it was changed for SNMPv2.
But when using SNMPv1, things have to follow the SNMPv1 specs.
> 3. How can I set up the value for the field specific-code?
The Net-SNMP agent should handle this automatically.
One final comment - ideally, your trap OIDs should be of the
form
.1.3.6.1.4.1.23668.9999.15.0.5
(i.e. with a '0' value as the penultimate subidentifier).
I won't go into the details of why - it's all to do with converting
SNMPv2 traps into SNMPv1 ones, and back again.
It's probably too late for your currently-defined traps, but this
is something worth bearing in mind if you define new groups
of traps in the future.
Dave
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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