Re: Giving Parametres to an snmp-trap

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2008/7/3 Giuseppe Barbieri <[email protected]>:
> If I have to send a string using snmp trap v 1 I have to write something
> like this:
>
> snmptrap -v 1 -c public IP-DESTINATION enterprise-oid agent trap-type
> specific-type uptime [OID TYPE VALUE] string
>
> Is it right?

No.

The fixed elements of an SNMPv1 trap are everything up to "uptime".
The triplet that follows ([OID TYPE VALUE]) is how you specify an
extra value.  (or several such triplets if you need several extra values).


> Searching I found only tha enterprise-oid is always 6...and the others one?

No - the enterprise OID is an OID - not a number.
It identifies the organisation who defined this trap.

The generic-trap will always be 6 (for enterprise-defined traps)
The specific-trap will indicate which of the various traps
defined by that organisation this is.


Please see any book on SNMP for more details.



> I dont want to transmit any MIB, only a string or a value

Tough - SNMP doesn't work that way.

SNMP always works with "varbinds" - a name-value pair.
(Or strictly speaking, a name-type-value triplet).

You can't simply report a value of "42" or "yes"
You always have to include an indication of what this value means -
   "number of interruptions in the last hour = 42"
or
   "is Dave getting increasingly crabby = yes"

Dave

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.