Réda BENKIRANE | 30 Oct 15:59 2015

FW: Is it possible to create an OID in the agent (server) MIB from the manager (client)?


From: reda.benkirane <at> hotmail.fr
To: fock <at> agentpp.com
Subject: RE: [SNMP4J] Is it possible to create an OID in the agent (server) MIB from the manager (client)?
Date: Thu, 29 Oct 2015 14:55:08 +0000

Hi Frank,
Thank you very much for your clear answer.
I tried to gather what you told me and what I understood to continue building my Agent.
What I want exactly is to create a conceptual table that has zero (or one "test" unuseful row) at the
beginning and then, to be able to send a SET from the Manager. I want a structure of columns like that : {
IPAddress IPAdd, Integer32 NodeID, Integer32 Counter }. 
=> For IP Adresses that already exist in the MIB, I will simply increment the counter by sending a SET. => For
IP Addresses that doesn't exist I want to CREATE a NEW row by sending a SET. 
Do you think that this is possible ? Particularly, what do you think is the best way to increment the counter ?
I have thought about GET-ting the value and then SET-ting it but I don't know if this operation is safe (If
another client thread tries to do the same thing at the same time).
For what I have done till now, it unfortunately doesn't work. When I run the Agent, everything is okay, the
conceptual table is created (Verified with an SNMP Walk on the root OID "" using Paessler
SNMP Tester 5.2.1).
The problem occurs when I send the SET to the agent FROM the client (manager) (Please see the SET
Implementation below).
I get this error in the Agent Side :
java.lang.Exception: Error 'Inconsistent naming used' generated at: =	at
org.snmp4j.agent.request.SnmpRequest$SnmpSubRequest.requestStatusChanged(SnmpRequest.java:621)	at
(...)	at java.lang.Thread.run(Thread.java:745)
I get this error in the Manager (Client) Side : 
(Continue reading)

Réda BENKIRANE | 30 Oct 15:44 2015

SET MOTable value : Error "Not Writeable" generated at:

Hello. I am trying to set a value in an MOTable. The MOTable elements MAX_ACCESS is defined as ACCESS_READ_WRITE.
MOTableBuilder customBuilder = new MOTableBuilder(customTable)						.addColumnType(1,
SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_WRITE)						.addColumnType(2,
SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_WRITE)						.addColumnType(3,
SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_WRITE)						.addRowValue(new
OctetString(""))						.addRowValue(new Integer32(0))						.addRowValue(new
Integer32(100))				        .addRowValue(new OctetString(""))						.addRowValue(new
Integer32(0))				        .addRowValue(new Integer32(200));								agent.registerManagedObject(customBuilder.build());
And however, when I send a SET to the agent, I get the error "Not Writeable" and I don't get it.
  final static OID[] customTableExistingOIDs = new OID[]{new OID(""),		 
												 new OID("")}; customTablePDU.addAll(new VariableBinding[]{new
VariableBinding(customTableExistingOIDs[0],new Integer32(8989)),            new
VariableBinding(customTableExistingOIDs[1],new Integer32(8989))});       
customTablePDU.setType(PDU.SET);    Snmp customSnmp = new Snmp(transport);       
System.out.println("Request:\nSending CustomTable Snmp Set Request to Agent...");    ResponseEvent
customTableResponse = customSnmp.set(customTablePDU, comtarget);
Agent side ERROR :
java.lang.Exception: Error 'Not writable' generated at: = 8989	at
org.snmp4j.agent.request.SnmpRequest$SnmpSubRequest.requestStatusChanged(SnmpRequest.java:621)	at
org.snmp4j.agent.request.RequestStatus.fireRequestStatusChanged(RequestStatus.java:89)	at
org.snmp4j.agent.request.RequestStatus.setErrorStatus(RequestStatus.java:52)	at
org.snmp4j.agent.mo.DefaultMOTable.prepare(DefaultMOTable.java:661)	at
org.snmp4j.agent.CommandProcessor$SetHandler.prepare(CommandProcessor.java:830)	at
org.snmp4j.agent.CommandProcessor$SetHandler.processPdu(CommandProcessor.java:863)	at
org.snmp4j.agent.CommandProcessor$SetHandler.processPdu(CommandProcessor.java:780)	at
org.snmp4j.agent.CommandProcessor.processRequest(CommandProcessor.java:422)	at
org.snmp4j.agent.CommandProcessor.processRequest(CommandProcessor.java:384)	at
org.snmp4j.agent.CommandProcessor.dispatchCommand(CommandProcessor.java:340)	at
org.snmp4j.agent.CommandProcessor$Command.run(CommandProcessor.java:560)	at
org.snmp4j.agent.CommandProcessor.processPdu(CommandProcessor.java:163)	at
(Continue reading)

Réda BENKIRANE | 22 Oct 17:27 2015

Is it possible to create an OID in the agent (server) MIB from the manager (client)?

I am using SNMP4J Framework and it implements and makes possible the standard SET, GET, GET-NEXT, etc.
messages.For example, with a SET, I can update the value of the MIB OID "". This works
perfectly for me. I can do that using org.snmp4j.Snmp.set(PDU pdu, Target target)What I want to do now is
to CREATE a custom MIB OID (as "") FROM the client and assign a value to it and not simply
update an existing MIB OID value.Is there any standard SNMP way to do that easily ?
Réda BENKIRANE 		 	   		  
SNMP4J mailing list
SNMP4J <at> agentpp.org
Frank Fock | 14 Oct 22:55 2015

Re: How to Combine SNMP4J Agent and Dell OpenManage

Hi Hong,

If you want to follow the second option (which I do not recommend - 
because it is not what the standard
suggests), you will have to implement one or more MOSubtreeProxy instances.
Alternatively, you can also use the SNMP4J-PROXY-MIB and configure it 

For the first option, simply add (register) the SnmpProxyMib 
implementation to your agent and
configure it as described in the RFC for the SNMP-PROXY-MIB.

Best regards,

Am 14.10.2015 um 22:34 schrieb Daisy Chen:
> Hi Frank,
> Your reply is really appreciated.
> I feel like the two ways are same, both has two SNMP Agent running, 
> and need a Proxy in my SNMP4J Agent to access the Dell OpenManage 
> server. Can you please tell me how to configure it?
> If these two solutions are very different,  I am thinking  the second 
> way you pointed out in your reply is better for me. I tried to find 
> some example code, but can't find anywhere. I guess I need to add a 
> proxy MIB, and create a proxy forwarder to handle the Dell OpenManage 
> things.
> In the SNMP4J-Agent, there is a Proxy MIB and Proxy Forwader been 
(Continue reading)

Daisy Chen | 14 Oct 17:29 2015

How to Combine SNMP4J Agent and Dell OpenManage

I am wondering if there is a way to combine the SNMP4J-Agent and Dell
OpenManage? I create a SNMP Agent based on SNMP4J-Agent to support my
private MIB, and also want to access the Dell hardware/Memory resources
through OpenManage. So that the IT SNMP manager only see one SNMP Agent (my
SNMP4J Agent), but can operate all of MIBs (Private MIB and Dell resource

SNMP4J mailing list
SNMP4J <at> agentpp.org
Roger Andersson J | 7 Oct 12:43 2015

SNMPv3 and virtual IP


We have a system which spans over several nodes. We want to see the system as one entity, it is just
distributed over several physical nodes.
We are using a virtual IP between these nodes. Either as a load balancer or one active and the other standby if
active goes down.
The SNMP manager don't know if there are just one or several nodes in the system, it uses the virtual IP to
contact the system.
On all these nodes there is a SNMP agent using the virtual IP, i.e. listening for get/set requests on virtual
IP and sending traps from virtual IP. Our MIB tables etc  in subagents are synchronized between all the
SNMP agents.

Using SNMPv2c and the virtual IP it works fine. The manager sends the SNMP get request is sent to virtual IP
and it is routed to the agent on the active node. The agent on the active node sends SNMP traps to manager. If
active node changes the SNMP get is just routed to the new agent on the active node.

But using SNMPv3 and virtual IP is not as easy.
To be able to use SNMPv3 and virtual IP all agents must have the same engineID. I guess they also needs to have
the same boot counter and sysUpTime.
The engineID is simple to solve if we generate it using the virtual IP. But it is ok to have the same engineID on
several agents? We have a system that is distributed over several physical nodes, but it is ok to have a SNMP
agent that is distributed over several physical nodes?
Boot counter can also be distributed in a quite simple way.
But how to handle the sysUptime?

Anyone who has solved a similar situation?

Roger Andersson

(Continue reading)

Denis Ioan | 17 Sep 11:14 2015

SNMP4J Agent cannot be discovered (Netwrok Discovery)

Hi to everybody, 
   I'm new to the SNMP protocol but I had to implement an Agent in v3.
Using SNMP4J I've implemented and all works fine except the agent cannot
be discovered automatically from the Network Discovery functions.
I guess I forgot to insert something in the configuration. I post here
the Agent class and the way I use it in the software:

public class SNMPAgent extends BaseAgent {

    private final String GROUP_NAME = "v3group";

    private String address;
    private String baseOID;
    private String securityName; // User
    private String SHAPassword;
    private String AES128Passphrase;  
    private String trapIPAddress;
    private String trapPort;

     *  <at> param address
     *  <at> throws IOException
    public SNMPAgent(String address, String baseOID, 
            String securityName, String SHAPassword, String
AES128Passphrase, String trapIPAddress, String trapPort) throws
IOException {

(Continue reading)

Frank Fock | 16 Sep 00:01 2015

SNMP4J 2.4.0-SNAPSHOT provides SHA-2 support as defined by RFC 7630


The latest SNMP4J 2.4.0 SNAPSHOT implements the SHA-2 authentication
protocols defined by the upcoming RFC 7630
(see https://www.rfc-editor.org/auth48/rfc7630 ).

Until now I could not find any other open source implementation for 
tests. If you are aware of such an implementation, please contact me by 

You can download this snapshot from

Best regards,

SNMP4J mailing list
SNMP4J <at> agentpp.org
Frank Fock | 11 Sep 09:03 2015

Re: Help for setting up OIDs that change values

Hi Andrew,

Updating tables with the lookup event listener could be tricky.
The reason for that is, that you cannot predict how the
command sender (SNMP manager in old words) asks for
the OIDs. The first OID in the request might point to the
second row in the table and the second OID in the request
to the 7th row and so on.

The lookup event facilitates that by firing the event for each
VB in the request separately.

Back to your question: Yes, you can use the lower bound to
optimize your lookup, but the lower bound is only the lower
bound. To find the affected cells you will have to use the
methods/algorithms provided by DefaultMOTable.
Generally it is also recommended to update the whole row
at once because the requested typically tries to retrieve
more than one column of a table.

Maybe the BufferedMOTableModel (SNMP4J-AgentX) is easier
to handle than using the lookup evednt listener. There you
only override two methods "fetchRow..." which update the
one or more rows and you are done.

Best regards,

Am 10.09.2015 um 00:43 schrieb Andrew Samuels:
> Hi,
(Continue reading)

Andrew Samuels | 9 Sep 15:04 2015

Help for setting up OIDs that change values


I have been looking at using SNMP4J for a while and finally started to get
to grips with it, however setting up OIDs that can return changing values
is proving more challenging than I anticipated and I am looking for
pointers. I have read the instrumentation guide and pulled various pieces
of code together from searching.

So far I have the basics working, various examples show these

// Set up a new agent
this.myAgent = new SNMPAgent("udp:");

// Start the agent
// Remove all the default MIBs so I can see any additions/changes I am
making more easily.

//Add a simple OID with string

(Continue reading)

N, Ravikiran | 6 Sep 18:50 2015

Unable to send V3 Trap with authoritative engine ID

HI All,

I am using the below snippet code for sending the SNMPv3 trap with Authoritative Engine ID. I am getting the
exception  as " Message processing model 3 returned error: Unknown security name".
While debugging snmp4j jar I have identified mismatch between Engine ID inserted into the UsmUserTable
and EngineId used for retrieval of UsmUser from the UsmUserTable. Please help me through this problem.

My Code for sending V3 trap is as below:

byte[] localEngineIdInBytes = MPv3.createLocalEngineID();
USM usm = new USM(SecurityProtocols.getInstance(),
                    new OctetString(localEngineIdInBytes), 0);  //Local Engine Id

ScopedPDU pdu = new ScopedPDU();
                                                                pdu.setContextName(new OctetString("ContextName"));
                                                                pdu.setContextEngineID(new OctetString(localEngineIdInBytes)); // Context Engine ID

                                                      long sysUpTime = (System.currentTimeMillis() - start) / 10;

                                                      pdu.add(new VariableBinding(new OID(trapOid + ".7"), new TimeTicks(sysUpTime)));
                                                      pdu.add(new VariableBinding(new OID(trapOid + ".8"), new OID(trapOid)));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".1"), new OctetString("ssid")));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".2"), new OctetString("1234")));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".3"), new OctetString("CRI")));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".4"), new OctetString("PROCESS")));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".5"), new OctetString(new Date().toString())));
                                                                pdu.add(new VariableBinding(new OID(trapOid + ".6"), new OctetString("message")));

TransportMapping transport = new DefaultUdpTransportMapping();
(Continue reading)