Thanks for the answer.

I do the following binding:
snmpTrapOID.0 = .1.3.6.1.4.1.9999.15.5

And then I set the snmpd.conf like this:
trapsink localhost
informsink localhost

And I get the following output from snmptrapd:

2006-07-18 10:27:15 ovidiu.ro [192.168.0.11] (via UDP:
[127.0.0.1]:60763) TRAP, SNMP v1, community public
        MY-MIB::9999.15.5 Enterprise Specific Trap (0) Uptime: 15:28:54.23
        MY-MIB::9999.15.1.1 = Timeticks: (1143696602) 132 days,
8:56:06.02     MY-MIB::9999.15.1.3 = Gauge32: 0      MY-MIB::9999.15.1.2
= Timeticks: (1143695840) 132 days, 8:55:58.40     MY-MIB::9999.15.1.4 =
STRING: "0"

2006-07-18 10:27:15 localhost.localdomain [UDP: [127.0.0.1]:60764]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (5573423) 15:28:54.23 
SNMPv2-MIB::snmpTrapOID.0 = OID: MY-MIB::9999.15.5.0 
MY-MIB::9999.15.1.1 = Timeticks: (1143696602) 132 days, 8:56:06.02    
MY-MIB::9999.15.1.3 = Gauge32: 0      MY-MIB::9999.15.1.2 = Timeticks:
(1143695840) 132 days, 8:55:58.40     MY-MIB::9999.15.1.4 = STRING: "0"

As you can see, when it sends the SNMPv1 trap it says:
"MY-MIB::9999.15.5 Enterprise Specific Trap (0)"

Is this correct?

My understanding is that our customer expects "MY-MIB::9999.15
Enterprise Specific Trap (5)".

Ovidiu

Dave Shield wrote:

> 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
>

-------------------------------------------------------------------------
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-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

Reply via email to