[SNMP4J] TCP Trap receiver stops working

Frank Fock fock at agentpp.com
Fri Jan 11 21:38:15 CET 2013


Hi Wayne,

I cannot reproduce the issue with the latest SNMP4J 2.1.1 SNAPSHOT
which is identical to 2.1.0 regarding DefaultTcpTransportMapping,
Snmp, and SnmpRequest classes.

What operating system are you using and which JRE version?

Best regards,
Frank



Am 11.01.2013 20:48, schrieb Wayne T:
> I'm using the snmp trap receiver to execute some testing and seem to be getting to a point where the trap receiver stop responding.
>
> To start the trap receiver, I'm using the following command:
>
> java -cp snmp4j-2.1.0.jar:log4j-1.2.15.jar org.snmp4j.tools.console.SnmpRequest -d DEBUG -u aSecurityName -Ol TCP:0.0.0.0/1162
>
>
> The trap receiver is working initially when I start it, but it stops responding after some time.
>
> As far as I've been able to diagnose, it looks like it stops working after a client opens a TCP connection but does not send any traps.
>
>
> So, if  do the following, then TCP trap receiver stops working:
>
> 1 - start the trap receiver with the command above
>
> 2 - send a trap with this command:
> java -cp snmp4j-2.1.0.jar:log4j-1.2.15.jar org.snmp4j.tools.console.SnmpRequest -p INFORM -v 2c -u aSecurityName TCP:127.0.0.1/1162 "1.3.6.1.2.1.1.3.0={t}0"   "1.3.6.1.6.3.1.1.4.1.0={o}1.3.6.1.6.3.1.1.5.1"   "1.3.6.1.2.1.1.1.0={s}System XYZ, Version N.M"
>
> This trap is received
>
> 3 - run the following java program that opens a socket and then closes it:
>    public static void main(String[] args)
>    {
>      try
>      {
>        SocketChannel socketChannel = SocketChannel.open();
>        socketChannel.connect(new InetSocketAddress(-_YOUR_IPADDRESS-, 1162));
>        socketChannel.close();
>      }
>      catch (Throwable t)
>      {
>        System.out.println("Failed to send connect: " + "\nReason: "
>            + t.toString());
>      }
>
>    }
>
>
>
> 4 - repeat the command in step 2, and the trap is not printed in the trap receiver output and the command prints the following message:
>
> 2017 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping  - Socket to 127.0.0.1/1162 closed
> 2017 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping  - Socket channel to 127.0.0.1/1162 closed
> Request timed out.
>
>
>
>   		 	   		
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list