[snmp] Problem: SNMP application with different versions.

Vijay Gholap vijay_gholap at datamatics.com
Mon Oct 29 17:17:41 GMT 2007



Hi all,

   I have a list (ArrayList)  contains the snmp paramaters. I have created
one factory class which will return the reference of passed version. i.e. if
i passed version 1, it will return me reference of class which has a logic
of sending trap of version 1. I have iterated list and sended the trap for
the list data.

for(i=0;i<list.size();i++){
ISNMPClient snmpcilent =SNMPFactory.getSNMPFactory(list.get(i));
	snmpcilent.setManagerConfig(manager);
			snmpcilent.sendTrap(pdu);
		}

ISNMPClient is iterface implemented by two classes...
1. SNMPClienV1
2. SNMPClientV2

which has a logic of sending snmp v1 and v2 trap respectively.
SNMPFactory retuns the reference of one of above class... i.e if i pass
version=1; it will give me reference of SNMPClientV1 class.

My problem is....

If my list contains the first data is version1... it sends the trap only for
version 1.. but not for version2.
and if my list contains first snmp version 2 data.. then its sends only snmp
2 related trap.


Suppose if my list is like this...
 list[1,1,2,1,2] .... i.e contans the snmp version of which i want to send a
trap.
Then,
  My application send the trap of SNMPClientV1 only but not SNMPClientV2..
If my list is like this...
 list[2,1,2,1,2] ...
Then,
  My application send the trap of SNMPClientV2 only but not SNMPClientV1..

 As per my observation.. application sending trap for the version which is
the first version in list.


So please help me out ....

Thanks,
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