2009/3/1 pch0317 <pch0...@gmail.com>:
> ok, I read this document but i don't understand it very well.
> I write:
> snmptrap -v 1 -c public 127.0.0.1 "a" "10.0.0.1" "c" "d"
> I only know that I:
> (-v 1)   use SNMPv1,
> (-c public)   use password,
> but I'm not sure this fields:
> (127.0.0.1)   Send I trap to this host?
> (a)   I don't know what is it
> (10.0.0.1)   In this place must be adress. Hmmm???
> (c)   ???
> (d)   ???
>
> I don't know ASN.1 so please explain me this fields.

   $ man snmptrap
      snmptrap  -v 1 [COMMON OPTIONS]
           enterprise-oid agent generic-trap specific-trap uptime

[COMMON OPTION] covers both "-c public" and the trap destination
(127.0.0.1 - i.e. localhost - i.e. the machine you are running the command on).

So:
     "a"  -  enterprise-oid
     "10.0.0.1"  -  agent
     "c"  -  generic-trap
     "d"  -  specific-trap

and you are missing the final parameter "e" - uptime

Let's leave "enterprise-oid" for a moment.

"agent" (10.0.0.1) is an indication of the host where the trap is
being sent from.
This will default to the IP address of the local host, so is typically
left empty - ""

"generic-trap" and "specific-trap" indicate what tryp of trap is being sent.
There are six standard traps, with "generic-trap" values of 0..5.
   (In each case, "specific-trap" will have the value 0)
For everything else, you have to use a private (or "enterprise-specific") trap,
   with a "generic-trap" value of 6, and the "specific-trap" value indicating
   which private trap is being sent.

The missing parameter - uptime - is an indication of how long the
"sending SNMP engine" has been running.   This is not really relevant
for traps sent using the snmptrap command, so is typically left empty.
The command will fill in a suitable value automatically.


But there's a problem with interpreting private traps.
Suppose I have a set of private traps where:
   1 = My house is on fire
   2 = I've just been asked a silly question
    etc

and you have a different set of private traps where:
   1 = You've just won the lottery
   2 = You've just received a sarcastic answer
    etc

How should the trap receiver know what "trap 1" means?
Is it good news or bad?
  That's where "enterprise oid" comes in.

If the trap is one of my private traps, then it will be sent using my
enterprise oid (1.2.3.4.5)
If it's one of yours, then it will be send using your enterprise oid (9.8.7.6.5)

So
    snmptrap .... 1.2.3.4.5 ""  6 1  ""
                       is bad news ("My house is on fire")
while
    snmptrap .... 9.8.7.6.5 ""  6 1  ""
                       is good news ("You've just won the lottery")

If you're not sending a private trap, then again you would typically leave this
field empty, and the snmptrap command will fill in a suitable value.

So a coldStart trap (generic-trap #0) would be sent using

    snmptrap ....  ""  ""  0 0  ""

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to