[SNMP4J] Subagent startup question
Frank Fock
fock at agentpp.com
Sun Dec 17 13:29:32 CET 2006
Hi Ray,
Please check your routing setup. I think,
the Gateway for network destination "127.0.0.0"
should be "127.0.0.1" or am I missing something?
Best regards,
Frank
Meluch, Ray wrote:
>
>
> -----Original Message-----
> From: Meluch, Ray
> Sent: Friday, December 15, 2006 2:13 PM
> To: 'Frank Fock'
> Subject: RE: [SNMP4J] Subagent startup question
>
> Frank,
>
> Thanks for the prompt reply.
>
> Using 127.0.0.1 for the Master/705 address, I have succeeded in getting
> SNMP4J_tool to GETBULK the master's MIB tree - thank you!
>
> However, I get 'noSuchObject' from a GET on the subagent's
> 1.3.6.1.4.1.4976.200.1.0 scalar OID.
>
> These are the messages I get as the subagent starts, including some of
> my own debugs in connect() and addMaster():
>
> ------------------------------------------------------------
>> $ sudo java -jar SNMP4J-agentX-subagent.jar 127.0.0.1/705 &
>
> 0 [main] DEBUG org.snmp4j.agent.DefaultMOServer - Registered MO
> org.snmp4j.agent.mo.MOScalar at 1239a8 in default context with scope
> org.snmp4j.agent.mo.MOScalar at 1239a8
> 23 [main] DEBUG org.snmp4j.agent.DefaultMOServer - Registered MO
> DefaultMOTable[id=1.3.6.1.4.1.4976.200.2.1,
> .....
>
> RWM_DEBUG: Subagent connect()
> RWM_DEBUG: Master Address: 127.0.0.1/705
> RWM_DEBUG: Local Address: 0.0.0.0/0
> RWM_DEBUG: Session::
> org.snmp4j.agent.agentx.AgentXSession[peer=null,sessionID=1,byteOrder=nu
> ll,timeout=5,consecutiveTimeouts=0,agentCaps=null]
>
> RWM_DEBUG: Connection-oriented TransportMapping created on local address
> 0.0.0.0/0.
> RWM_DEBUG: Transport added to agentX instance.
> RWM_DEBUG: Transport listening...
> RWM_DEBUG: Session
> org.snmp4j.agent.agentx.AgentXSession[peer=org.snmp4j.agent.agentx.Agent
> XPeer[transport=org.snmp4j.transport.DefaultTcpTransportMapping at 416a10,a
> ddress=127.0.0.1/705,connectionTime=0,timeout=5,id=null,closing=false],s
> essionID=1,byteOrder=null,timeout=5,consecutiveTimeouts=0,agentCaps=null
> ] has set
> org.snmp4j.agent.agentx.AgentXPeer[transport=org.snmp4j.transport.Defaul
> tTcpTransportMapping at 416a10,address=127.0.0.1/705,connectionTime=0,timeo
> ut=5,id=null,closing=false] as peer.
>
> RWM_DEBUG: opening session...
>
> RWM_DEBUG: Sending openPDU, creating target...
>
> 379 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping -
> Looking up connection for destination '127.0.0.1/705' returned: null
> 379 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping - {}
> 380 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping -
> Socket for address '127.0.0.1/705' is closed, opening it...
> 27203 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.TcpTransportMapping - Firing transport state
> event:
> org.snmp4j.transport.TransportStateEvent[source=org.snmp4j.transport.Def
> aultTcpTransportMapping at 44fd20,peerAddress=127.0.0.1/42632,newState=1,ca
> usingException=null]
> 27204 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Reading header 0
> bytes from 127.0.0.1/42632
>
> 383 [main] DEBUG org.snmp4j.transport.DefaultTcpTransportMapping -
> Trying to connect to 127.0.0.1/705
>
> 384 [main] DEBUG org.snmp4j.agent.agentx.AgentX - New pending request
> org.snmp4j.agent.agentx.AgentXOpenPDU[type=1,version=1,sessionID=0,trans
> actionID=0,packetID=1,byteOrder=LITTLE_ENDIAN] with handle PduHandle[1]
> 27206 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Reading header 20
> bytes from 127.0.0.1/42632
>
> 27207 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Message length is
> org.snmp4j.transport.MessageLength[headerLength=20,payloadLength=32]
>
> 27207 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Received message from
> 127.0.0.1/42632 with length 52:
> 01:01:00:00:00:00:00:00:00:00:00:00:01:00:00:00:20:00:00:00:05:00:00:00:
> 00:00:00:00:13:00:00:00:41:67:65:6e:74:58:34:4a:20:54:65:73:74:20:61:67:
> 65:6e:74:00
>
> 27212 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.agent.agentx.AgentX - Fire process PDU event:
> org.snmp4j.agent.agentx.AgentXCommandEvent[peerTransport=org.snmp4j.tran
> sport.DefaultTcpTransportMapping at 44fd20,peerAddress=127.0.0.1/42632,proc
> essed=false,command=org.snmp4j.agent.agentx.AgentXOpenPDU[type=1,version
> =1,sessionID=0,transactionID=0,packetID=1,byteOrder=LITTLE_ENDIAN]]
>
> 27383 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.agent.agentx.master.AgentXCommandProcessor - Processing
> AgentX PDU
> org.snmp4j.agent.agentx.AgentXOpenPDU[type=1,version=1,sessionID=0,trans
> actionID=0,packetID=1,byteOrder=LITTLE_ENDIAN] for session null
>
> 27384 [DefaultTCPTransportMapping_127.0.0.1/705] INFO
> org.snmp4j.agent.agentx.master.AgentXCommandProcessor - Session
> org.snmp4j.agent.agentx.master.AgentXMasterSession[peer=org.snmp4j.agent
> ..agentx.AgentXPeer[transport=org.snmp4j.transport.DefaultTcpTransportMap
> ping at 44fd20,address=127.0.0.1/42632,connectionTime=0,timeout=0,id=2,clos
> ing=false],sessionID=1,byteOrder=null,timeout=5,consecutiveTimeouts=0,ag
> entCaps=null] opened
>
> 27386 [DefaultTCPTransportMapping_127.0.0.1/705] INFO
> org.snmp4j.agent.agentx.master.AgentXCommandProcessor - Sending AgentX
> response
> org.snmp4j.agent.agentx.AgentXResponsePDU[type=18,version=1,sessionID=1,
> transactionID=0,packetID=1,byteOrder=LITTLE_ENDIAN,sysUpTime=2738,errorS
> tatus=0,errorIndex=0,vbs=[]] to session
> org.snmp4j.agent.agentx.master.AgentXMasterSession[peer=org.snmp4j.agent
> ..agentx.AgentXPeer[transport=org.snmp4j.transport.DefaultTcpTransportMap
> ping at 44fd20,address=127.0.0.1/42632,connectionTime=0,timeout=0,id=2,clos
> ing=false],sessionID=1,byteOrder=null,timeout=5,consecutiveTimeouts=0,ag
> entCaps=null]
>
> 27388 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Looking up connection
> for destination '127.0.0.1/42632' returned:
> SocketEntry[peerAddress=127.0.0.1/42632,socket=Socket[addr=/127.0.0..1,po
> rt=42632,localport=705],lastUse=Fri Dec 15 09:17:10 PST 2006]
> 27389 [DefaultTCPTransportMapping_127.0.0.1/705] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping -
> {127.0.0.1/42632=SocketEntry[peerAddress=127.0.0.1/42632,socket=Socket[a
> ddr=/127.0.0.1,port=42632,localport=705],lastUse=Fri Dec 15 09:17:10 PST
> 2006]}
>
> 567 [DefaultTCPTransportMapping_0.0.0.0/0] DEBUG
> org.snmp4j.transport.DefaultTcpTransportMapping - Send message with
> length 52 to 127.0.0.1/705:
> 01:01:00:00:00:00:00:00:00:00:00:00:01:00:00:00:20:00:00:00:05:00:00:00:
> 00:00:00:00:13:00:00:00:41:67:65:6e:74:58:34:4a:20:54:65:73:74:20:61:67:
> 65:6e:74:00
>
> 5391 [Timer-1] DEBUG org.snmp4j.agent.agentx.AgentX - AgentX request
> timed out: 1
>
> RWM_DEBUG: No Response!
>
> 5391 [main] ERROR org.snmp4j.agent.agentx.subagent.AgentXSubagent -
> Timeout on connection to master 127.0.0.1/705
>
> RWM_DEBUG: Timed out while opening session.
>
> ------------------------------------------------------------
> /etc/hosts on this machine has '127.0.0.1 localhost' present.
>
> Routing table contains:
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> 10.201.0.0 0.0.0.0 255.255.0.0 U 0 0 0
> eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
> lo
> 0.0.0.0 10.201.0.1 0.0.0.0 UG 0 0 0
> eth0
>
>
> The fact that the master is working now is immensely valuable to me in
> any case - thank you again for your help!
>
> Ray
>
>
>
>
> -----Original Message-----
> From: Frank Fock [mailto:fock at agentpp.com]
> Sent: Thursday, December 14, 2006 5:35 PM
> To: Meluch, Ray
> Cc: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] Subagent startup question
>
> Hi Ray,
>
> The local address of the sub-agent is not used for TCP (which is the
> only currently supported transport mapping by SNMP4J-Agent). For AgentX
> over a connection-less transport mapping, the local address might be
> used in the future.
>
> So when the communication fails, there must be another reason for that.
> Have you tried to use 127.0.0.1 instead of 10.201.1.98? I am asking
> because this might also be a routing or permission problem.
>
> Best regards,
> Frank
>
> Meluch, Ray wrote:
>> Hi all,
>>
>> I'm trying out AgentX to run under Linux, and am having trouble
>> getting the test cases to come up cleanly.
>>
>> I've created .jars for the TestMaster and TestSubagent; I invoke the
>> master first, then the subagent (ubuntu 6.06) :
>> % sudo java -jar SNMP4J-agentX-master.jar 10.201.1.98/161
>> 10.201.1.98/705 &
>> % sudo java -jar SNMP4J-agentX-subagent.jar 10.201.1.98/705 &
>>
>> When the subagent connects to the master, it sends an OpenPDU. The
>> master responds, but the subagent times out waiting for a response.
>> The subagent seems to be listening to 0.0.0.0/0 instead of the given
>> masterAddress, and missing the msg as a consequence.
>>
>> The empty address is the value of the subagent's localAddress. What is
>
>> the role of this element of the subagent? Do I need to add any
>> localizing information to the code to get the subagent working
>> correctly?
>>
>> When later attempting to query the master agent using SNMP4J, it does
>> not respond, and the request times out.
>>
>> java -jar SNMP4J.jar -c private -v 2c -p GETBULK -Ow udp:localhost/161
>
>> "1.3.6.1.2"
>>
>> DEC 14, 2006 9:33:33 AM org.snmp4j.log.JavaLogAdapter log
>> INFO: UDP receive buffer socket size for 127.0.0.1/0 is set to: 52736
>>
>> Total requests sent: 1
>> Total objects received: 0
>> Total walk time: 2011 milliseconds
>> Request timed out.
>>
>> Again, dealing with port 0 ... ???
>>
>>
>> I'm new to AgentX, and I think the problems must be due to some small
>> misconfiguration error - I see no other reports here of such basic
>> problems. Any insights gratefully received and appreciated.
>>
>> Thanks,
>>
>> Ray Meluch
>>
>>
>>
>>
>>
>> -----------------------------------------
>> This message (including any attachments) may contain confidential
>> information intended for a specific individual and purpose. If you
>> are not the intended recipient, delete this message. If you are not
>> the intended recipient, disclosing, copying, distributing, or taking
>> any action based on this message is strictly prohibited.
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
--
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the SNMP4J
mailing list