------------------ Original ------------------
From: "Dave Shield"<[email protected]>;
Date: Sat, Jan 23, 2010 05:04 PM
To: "Alexander King"<[email protected]>;
Cc: "net-snmp-users"<[email protected]>;
Subject: Re: when snmpwalk query my private trap OID the snmpd routine auto
termination
On 23 January 2010 05:33, Alexander King <[email protected]> wrote:
> But I do not know how to implement the trap in the MIB file
"Implementing a trap" means writing code to construct and send the trap,
and invoking this at the appropriate time.
This is handled (at least in part) by the mib2c template "mib2c.notify.conf"
>>>>"at least in part",maybe I get something really true in your word.below are
>>>>something my ideas:
1. I define a completed MIB file(included scalars,tables,traps),and make it
right.
2.Get the generated code use the
tools:mib2c.iterate.conf,mib2c.scalar.conf,mib2c.table.conf,and modify them.and
delete the traps's OIDs
3.Delete the traps definitions in the MIB file,and keep all the other
unchange.especially the structure of the MIB and their OID relationship.
Am I right?I really think it is wrong.
> the trap is a part of the MIB file,and traps have their own OIDs
Correct.
> and related some specific OBJECT-TYPE value(s),
Typically, yes.
Those related OBJECT-TYPE values are often accessible to GET*
requests, as well as being included in the payload of the relevant traps.
But these payload OIDs are different from the OID of the trap itself.
Don't get the two confused.
> how to define the trap can make the walk routine donot walk it?
If the agent does not include code to handle incoming requests
for a particular OID, then walking the agent will ignore that OID.
In particular, if you don't register a given OID, then the walk will
ignore it.
The code generated by mib2c.notify.conf does not include any
registration of the OID. Contrast this with the code generated by
the other (OBJECT-TYPE) mib2c templates.
> All I need is some prototype for my reference,so I can imitate,
> modify,implement in my project.(I know it is hard to find one,they are all
> difference.)
Why not start with the code in 'agent/mibgroup/examples/notification.c' ?
That's probably as simple a setup as you're likely to find.
Dave
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
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