Help: how I try my trap

"michael liu" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
 Hi, every one,

I just wrote a code to test snmp program according to an example
program(which is example.c and example.h in net-5.1.4).

and now, everything is ok, I can set, get, bulk, but I don't know how to
trap.

In my code, I used send_easy_trap(SNMP_TRAP_ENTERPREISES, 99) ,which same is
the example.c code, but how do I know this trap is sent or received?

or how can I test this trap is actived?

After searching the website, I think I can use *snmpset* to active a trap:
snmpset -c public localhost NET-MY-MIB::netSnmpExampleTrap.0 int 1
and then showed I can set the value to 1 of netSnmpExampleTrap, but how do I
know the manager receive this trap?

BTW, do I need add *trapsink localhost public* in snmpd.conf ?




My MIB define:
netSnmpExamples OBJECT IDENTIFIER is 1.3.6.1.4.1.8888.2.1
netExampleTrap OBJECT-TYPE
    SYNTAX      Integer32
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
 "Trap information"
    ::= { netSnmpExample 3 }
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.