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:Mar 31, 2011 9:39:27 am
List:net.java.dev.opendmk.users

On 3/31/11 6:18 PM, Lucio Crusca wrote:

Sorry to resume an old thread, but I'm going on only now with my work from where I left off more than a month ago...

In data lunedì 21 febbraio 2011 18:28:44, Daniel Fuchs ha scritto:

On 2/21/11 5:18 PM, Lucio Crusca wrote:

in order to programmatically populate my mib

you may have to subclass the MIB bean, and possibly any other intermediate group beans in order to get hold of the table bean in which you will add your entries.

The relevant section is '16.4 Standalone SNMP Agents' page 283.

In that code the IfTable (TableIfTable.java) is populated in the the constructor of the Interfaces group (subclassed in InterfaceImpl.java) which contains it.

So if you have a Mib MX containing a group GX containing a table XTable, I think you will need to create a subclass of Mib MX (MX_Impl) in order to instantiate a subclass of group GX (GX_Impl) in order to either populate directly the table TableXTable from GX_Impl, or create a subclass of TableXTable (TableXTable_Impl).

I think this procedure is like the one explained here:

http://techdive.in/snmp/snmp-agent-using-jdmk-api

but, besides the fact mibgen did not generate any *myMibName*Info.java in my case, and besides the fact I don't know what a SNMP group even is (but here RTFM is the obvious answer), I wonder if I can solve the problem in a faster way. In my case I just need to simulate a real snmp agent, using static values read from a file. The file is the output of snmpwalk run against the real agent. So I wonder if I could just use snmpset to inject the values in my java agent simulator, leaving it as it is now (only the mibgen generated classes).

That would be more difficult - I think - because most of the OIDs you retrieve will probably be of things contained in tables. A MIB will usually not allow remote creation of rows in tables, and if it does - the way in which rows are created may not be standard. SMIv2 defines the RowStatus type which is a convention that can be used to implement tables which support remote creation of rows, but using it will require to know and understand the MIB defining the tables.

I obviously already tried that, but it succeeds only for a subset of all the OIDs. Some OIDs are r/o and that's fine, but for the most part the snmpset reply is like:

.1.3.6.1.4.1.8698.1000.1.4.1.1.2.2.3.109.99.109.14 s "mcm" Error in packet. Reason: noAccess Failed object: iso.3.6.1.4.1.8698.1000.1.4.1.1.2.2.3.109.99.109.14

Does that suggest anything to you, snmp expterts?

By default remote creation of rows in tables is disabled in the SNMP agent. You might try to switch that on, but some (and probably most) of the columns in a table row will be read-only anyway - meaning that the only time you can set them is at row creation - which also means that two blind set request directed at the same row will fail - you will need to group all the OIDs for a given row in the same request.

hope this helps,

-- daniel