[First thing - please don't Cc: me on new requests. If I am able to help, I'll pick things up from the mailing list - asking me directly as well is likely to prove annoying and potentially counterproductive.]
> * I am using ucd-snmp-4.2.5. How is the agent configured? What "trapsink" or "trap2sink" (or similar) lines are there in the snmpd.conf file. > When I start the agent I get coldStart trap > with following variables: > 12:58 TRAP0.0 from 0.0.0.0 > Trap-Type: Cold Start > Variables: system.sysUpTime.0 = Timeticks: (5) 0:00:00.05 > snmpTrapOID.0 = OID:snmpTraps.coldStart > snmpTrapEnterprise.0 = OID: enterprises.ucdavis.ucdSnmpAgent.linux This actually looks like an SNMPv2 trap, rather than a v1 trap. In which case the v1-header parameters are bogus. > But when I stop my agent then still I get coldStart trap with less > number of variables > 12:58 TRAP0.0 from 0.0.0.0 > Trap-Type: Cold Start > Variables: system.sysUpTime.0 = Timeticks: (1407) 0:00:14.07 > snmpTrapOID.0 = OID: enterprises.ucdavis.ucdTraps.0.2 > and the value as "ucdShutdown".... Yes - that looks like a valid SNMPv2 "ucdShutdown" trap, but interpreted as if it were a v1 trap. Ignore the "trap-type" field - the important thing here is the value of the snmpTrapOID varbind. *That* is what defines the trap. > Why don't I see the value "ucdStart" in the 1st trap when I start agent? Because the v4 agent doesn't send (private) "ucdStart" traps. It sends the standard "coldStart" trap. > * When do we get warmStart, linkDown and linkUp traps? You don't. Not with the v4 agent. The v5 agent supports link{Up,Down} - see the FAQ and snmpd.conf man page. Neither agent generates warmStart traps - again, see the FAQ. > * I want to generate linkDown and linkUp traps at some specific > time (after getting some interrupt from my Hardware). Which is the best > palce(within agent code) where I can call some function to send linkDown > and linkUp traps with my own variables list appended at end? In the interrupt handler. Actually sending a trap is relatively simple - just call 'send_easy_trap' or 'send_trap_vars' with the appropriate parameters. What's harder is knowing *when* to send the trap. If you're receiving a hardware interrupt, then you should be able to detect this, and call the trap sending code during that routine. Dave ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ 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