This is a discussion on Re: AgentX Notify-PDU example? - SNMP ; Robert Davis wrote: > I'm writing an AgentX sub-agent and I'm looking at the Notify-PDU now > to implement traps. Are you writing this subagent from scratch, or are you working with an existing subagent toolkit? If so, which one? ...
Robert Davis wrote:
> I'm writing an AgentX sub-agent and I'm looking at the Notify-PDU now
> to implement traps.
Are you writing this subagent from scratch, or are you working
with an existing subagent toolkit? If so, which one?
> Not having a lot of experience with SNMP in
> general, I'm a little unclear on the references to sysUpTime.0 and
> snmpTrapOID.0, and about exactly what gets communicated in the
> eventual SNMP trap.
sysUpTime.0 indicates how long "the agent" has been running, and is
used to compare timestamps without requiring the agent to have to
support a real-time clock. Part of the AgentX communication involves
keeping the master agent and sub-agent ideas of sysUpTime in sync.
sysTrapOID.0 indicates which notification is being sent.
An outgoing SNMPv2 or SNMPv3 notification will include these two
variable bindings, and will look very similar to the AgentX Notify-PDU
(just with different header information).
An outgoing SNMPv1 trap will be structured quite differently, but
will hold effectively the same information in its header fields.
But dealing with that is the responsibility of the master agent.
> It sounds to me like I just need to include a single varbind with
> 220.127.116.11.18.104.22.168.4.1.0 as the OID and the OID of the trap from my
> private enterprise MIB (e.g. 22.214.171.124.4.1.165126.96.36.199) as the value.
It depends on the subagent toolkit that you're using, as to whether
it will insert the sysUpTime varbind for you. But this is quite
possible - the Net-SNMP agent certainly works that way.
Whether this is *all* that you need depends on the MIB definition
of your private trap. If that specifies any other objects to include,
then you'll need to provide varbinds for those too.
> Also, any suggestions for a free (Windows?) utility I could use to see
> the traps I create?
All of the Net-SNMP tools (including agent and trap handler) support
the '-d' flag to dump the raw PDU data, and '-Ddump' to display this
in a reasonably structured manner.
Those should work on Windows too.