[snmp] SNMP trap problem (thread count)

Vijay Gholap vijay_gholap at datamatics.com
Wed Oct 24 15:54:07 BST 2007


Hi,

   I have an application in which i have implemented SNMP Trap sending
functionality. My problem is that, i am able to send snmp trap(version 1/2)
without any problem, but my applications thread count getting incremented on
every send. So please help me to reduce this. Bellow is code snap of my
appliaction...

try {


	SnmpContext context = new SnmpContext(host, port, bindAddr, socketType);
        context.setCommunity(community);

       TrapPduv1 pdu = new TrapPduv1(context);
        pdu.setIpAddress(InetAddress.getLocalHost().getAddress());
        pdu.setEnterprise("1.3.6.1.4.1.12.1");
        pdu.setSpecificTrap(6);
        pdu.setTimeTicks(10000);


       pdu.addOid(sysUpTime, new AsnUnsInteger(5));
       pdu.addOid(snmpTrapOID, new AsnObjectId("1.3.6.1.4.1.12.1"));
 	 pdu.send();

	} catch (java.io.IOException exc) {
	    System.out.println("IOException " + exc.getMessage());
	} catch (uk.co.westhawk.snmp.stack.PduException exc) {
	    System.out.println("PduException " + exc.getMessage());
	}



Regards,

Vijay Gholap.



Disclaimer: The information contained in this e-mail and attachments if any are privileged and confidential and are intended for the individual(s) or entity(ies) named in this e-mail. If the reader or recipient is not the intended recipient, or employee or agent responsible for delivering to the intended recipient, you are hereby notified that dissemination, distribution or copying of this communication or attachments thereof is strictly prohibited. IF YOU RECEIVE this communication in error, please immediately notify the sender and return the original message.


More information about the snmp mailing list