[SNMP4J] How to hook up a trap trigger from application?

Frank Fock fock at agentpp.com
Fri Jun 3 01:48:17 CEST 2011


Hi Binh,

To send notifications from a SNMP4J-Agent
agent use the NotificationOriginator
interface:

http://www.snmp4j.org/agent/doc/org/snmp4j/agent/NotificationOriginator.html

You can access it through the AgentConfigManager:
http://www.snmp4j.org/agent/doc/org/snmp4j/agent/AgentConfigManager.html#getNotificationOriginator()

Best regards,
Frank

On 02.06.2011 23:24, Binh Le wrote:
> Greetings,
>
> I'm new to SNMP4J so forgive me if I'm taking a foreign language as example :).
>
> In NetSNMP/C for example, we can just define a function
> send_xyz_trap(int value1, int value2, ...) and call the function from
> wherever a trap is need to be triggered.
>
> Can someone please help to tell whether we can do that, and how, via SNMP4J?
>
> Let take snmp4jAgentHBEvent in SNMP4J-HEARTBEAT-MIB as the example.
> How can I trigger the trap from with just a passing Counter32 value
> (snmp4jAgentHBCtrlEvents which is a varbind of the snmp4jAgentHBEvent
> notification, per the MIB's definition) from another java class, and
> the notification will be sent to all trap receivers defined in V3
> related MIBs?
>
> Thanks,
> Binh
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list