[SNMP4J] snmp4j agent interoperability

Marcus Herou marcusherou at gmail.com
Tue Oct 31 13:37:18 CET 2006


Hello.

I'm trying to setup an snmp agent which monitors the JVM and which snmpget
understands.

I've ripped a lot of stuff from the CommandProcessor class since I haven't
understood how to subclass BaseAgent.

I have managed of getting snmp4j "client" to work with my agent but not in
"synchrone" mode and not with snmpget as client.
Synchrone mode always times out and the responsePDU is null. snmpget times
out as well.

I submit my java files which only need log4j, commons-logging and snmp4j to
work ( not work :) ).

SnmpAgent - The agent which should return active threads and used mem.
SnmpClientTest1 - Working clilent test
SnmpClientTest2 - Non working client test.

SnmpClientTest1:
13:03:23.837 INFO DefaultUDPTransportMapping_127.0.1.1/0
test.SnmpClientTest1$SnmpCommandResp - 700
13:03:23.838 INFO DefaultUDPTransportMapping_127.0.1.1/0
test.SnmpClientTest1$SnmpCommandResp - 5

SnmpClientTest2:
13:01:41.415 INFO main test.SnmpClientTest2 - No response because pdu is
null

snmpget:
snmpget -v 1 -c public 127.0.0.1:1161 1.3.6.1.2.1.2.2.1
Timeout: No Response from 127.0.0.1:1161


I get timeouts even though my  agent reports that it gets requests and sends
responses with status = 0 (OK!?)

13:26:29.836 INFO DefaultUDPTransportMapping_127.0.0.1/1161
test.JvmCommandResponder - processPdu - Incoming request pdu:
GET[requestID=1071896316, errorStatus=Success(0), errorIndex=0, VBS[
1.3.6.1.2.1.2.2.1 = Null]]
13:26:29.842 INFO DefaultUDPTransportMapping_127.0.0.1/1161
test.JvmCommandResponder - processPdu - Sending response pdu:
GET[requestID=0, errorStatus=Success(0), errorIndex=0, VBS[ = 660;  = 5]]
13:26:29.844 INFO DefaultUDPTransportMapping_127.0.0.1/1161
test.JvmCommandResponder - responseCode=0


Anyone have a clue ? Or an idea of howto properly subclass the BaseAgent to
monitor the Jvm for example. I cannot be the first person in the world
monitoring the JVM with snmp.

I plan to hook this agent up with cacti and therefor need snmp.



Regards


//Marcus Herou


More information about the SNMP4J mailing list