atom feed14 messages in net.java.dev.opendmk.usersRe: starting a standalone snmp agent
FromSent OnAttachments
Lucio CruscaFeb 10, 2011 9:03 am 
Daniel FuchsFeb 10, 2011 9:22 am 
Lucio CruscaFeb 11, 2011 6:49 am 
Daniel FuchsFeb 11, 2011 7:04 am 
Lucio CruscaFeb 11, 2011 8:20 am 
Lucio CruscaFeb 15, 2011 8:48 am 
Daniel FuchsFeb 20, 2011 6:10 am 
Lucio CruscaFeb 21, 2011 8:17 am 
Daniel FuchsFeb 21, 2011 9:28 am 
Lucio CruscaFeb 22, 2011 7:02 am 
Daniel FuchsFeb 22, 2011 9:07 am 
Lucio CruscaMar 31, 2011 9:17 am 
Daniel FuchsMar 31, 2011 9:39 am 
Daniel FuchsMar 31, 2011 9:53 am 
Subject:Re: starting a standalone snmp agent
From:Daniel Fuchs (dani@oracle.com)
Date:Feb 10, 2011 9:22:24 am
List:net.java.dev.opendmk.users

Hi Lucas,

I think you're trying to get an intermediate node in the OID tree. As a reminder, SNMP only allows you to get leaf node.

Instead of using snmpget, try with snmpgetnext: this will return the next leaf in the tree (that is, the first leaf-node that immediately follows 10.0.0.239:5162 1.3.6.1.4.1.8698.1000.1).

As a reminder also - if you have defined a scalar object in your mib (a leaf) then to get that leaf you need to append a .0 to the OID.

I have explained some of this in my blog - where you can find a trail of articles on SNMP. http://blogs.sun.com/jmxetc/entry/understanding_the_structure_of_management

Cheers,

-- daniel

On 2/10/11 6:04 PM, Lucio Crusca wrote:

Hi,

I'm making some progress with my snmp server (agent) simulator... btw now I've quite clear what a snmp manager is (the client!).

Following the JDMK tutorial [1], I'm trying to code a standalone SNMP agent, and here is the relevant snippet:

SnmpAdaptorServer snmpserv = new SnmpAdaptorServer(port, addr);

snmpserv.start();

// Send a coldStart SNMP Trap snmpserv.setTrapPort(new Integer(port+1)); snmpserv.snmpV1Trap(0, 0, null);

SURFBEAM_SYSTEM_MIB snmpMib = new SURFBEAM_SYSTEM_MIB(); snmpMib.init(); snmpserv.addMib(snmpMib); snmpMib.setSnmpAdaptor(snmpserv);

...

protected void initSurfBeamSystem(MBeanServer server) throws Exception { final String oid = getGroupOid("SurfBeamSystem", "1.3.6.1.4.1.8698.1000.1");

where SURFBEAM_SYSTEM_MIB is the name of the class generated with mibgen.

When I run this code the agent start listening on the specified port. However if I try to query it with snmpget (from linux command line), I get:

$ snmpget -v1 -c public 10.0.0.239:5161 1.3.6.1.4.1.8698.1000.1 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: iso.3.6.1.4.1.8698.1000.1

and if I try to use version 2c I get:

$ snmpget -v2c -c public 10.0.0.239:5162 1.3.6.1.4.1.8698.1000.1 iso.3.6.1.4.1.8698.1000.1 = No Such Instance currently exists at this OID

What am I doing wrong?

Thanks in advance, Lucio.

[1]. http://java.sun.com/products/jdmk/docs/JDMK51TUTOR.pdf