[SNMP4J] how to run the TestAgent.java?

Frank Fock fock at agentpp.com
Thu Aug 20 08:23:17 CEST 2009


I have updated the FAQ with:

3.The address does not belong to the local host. For example, if the 
local host has interfaces with address 127.0.0.1 (local loop), 
192.168.0.1 (eth0), and 192.168.1.1 (eth1) then you will get a bind 
exception when trying to init a transport mapping on 192.168.2.1. In 
most cases, using 0.0.0.0/<port> is the best choice. This special 
address binds all available local interfaces.

Best regards,
Frank

Tong Kwok Kei wrote:
> 1) Still have exception
> Caused by: java.net.BindException: Cannot assign requested address: Cannot
> bind
> 
> 	at java.net.PlainDatagramSocketImpl.bind0(Native Method)
> 
> 	at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
> 
> 	at java.net.DatagramSocket.bind(Unknown Source)
> 
> 	at java.net.DatagramSocket.<init>(Unknown Source)
> 
> 	at java.net.DatagramSocket.<init>(Unknown Source)
> 
> 	at
> org.snmp4j.transport.DefaultUdpTransportMapping.<init>(DefaultUdpTransportMa
> pping.java:99)
> 
> 	... 8 more
> 
> Our system use windows network, not Unix network, and we have checked that
> no application using port 161.
> 2)In TestAgent.java, the error prompt when testAgent1.init(); which is
> before 
> testAgent1.sendColdStartNotification();
> is it abnormal?
> 3) under normal circumstances, is it just assign 192.168.20.72/161 to
> TestAgent.java without any modification and the program should run
> successfully? What is the message sent to manager? If I want to send the CPU
> or Memory utilization to manager, what should I change in the
> TestAgent.java? 
> 
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
> Behalf Of Frank Fock
> Sent: Thursday, August 20, 2009 2:34 AM
> To: Tong Kwok Kei
> Cc: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] how to run the TestAgent.java?
> 
> Please read the SNMP4J FAQs at:
> 
> http://wiki.oosnmp.net/confluence/pages/viewpage.action?pageId=884741
> 
> and
> 
> http://wiki.oosnmp.net/confluence/pages/viewpage.action?pageId=884739
> 
> Best regards,
> Frank
> 
> Tong Kwok Kei wrote:
>> In TestAgent.java, public static void main, there is statement
>>
>> TestAgent testAgent1 = new TestAgent(new File("SNMP4JTestAgentBC.cfg"),
>>
>>                                            new
>> File("SNMP4JTestAgentConfig.cfg"));
>>
>> but I can't found these two files in the downloaded source, where is it? 
>>
>> Also, if I want to write an example to simulate an agent using
>> TestAgent.java and the manager ip is 192.168.20.72/162, then is it just
> pass
>> 192.168.20.72/162 in the main method of TestAgent.java is enough? But I
>> encounter the exception as follow:
>>
>> Caused by: java.net.BindException: Cannot assign requested address: Cannot
>> bind 
>>
>> What is the problem?
>>
>> _______________________________________________
>> 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