Hi Frank,
I am not able to send traps using org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.sendNotification. I am getting following error stacktrace
org.snmp4j.MessageException: Invalid argument (sendto failed)
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:545)
at org.snmp4j.Snmp.sendMessage(Snmp.java:1087)
at org.snmp4j.Snmp.send(Snmp.java:968)
at org.snmp4j.Snmp.send(Snmp.java:961)
at org.snmp4j.Snmp.send(Snmp.java:926)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.sendNotification(NotificationOriginatorImpl.java:272)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:378)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:140)
at com.ericsson.vil.pms.snmp.NodeAgent.sendTrap(NodeAgent.java:463)
at com.ericsson.vil.pms.watcher.filesystem.LogWatcher.detectTrap(LogWatcher.java:87)
at com.ericsson.vil.pms.watcher.filesystem.FileMonitor$1.onFileChange(FileMonitor.java:72)
at org.apache.commons.io.monitor.FileAlterationObserver.doMatch(FileAlterationObserver.java:410)
at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:333)
at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:303)
at org.apache.commons.io.monitor.FileAlterationMonitor.run(FileAlterationMonitor.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Invalid argument (sendto failed)
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:693)
at org.snmp4j.transport.DefaultUdpTransportMapping.sendMessage(DefaultUdpTransportMapping.java:117)
at org.snmp4j.transport.DefaultUdpTransportMapping.sendMessage(DefaultUdpTransportMapping.java:42)
at org.snmp4j.MessageDispatcherImpl.sendMessage(MessageDispatcherImpl.java:203)
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:522)
I am Using following dependencies:
org.snmp4j snmp4j 2.8.2 org.snmp4j snmp4j-agent 2.7.9
Can you please help here? What could be the possible reasons?
–Anirban