ru_44 | 6 Jul 22:58 2016

SNMP4j dropping response causing timeout in manager

 Hi Frank,
I have an snmpManager application running (IP that is polling my snmp4j agent (snmp4j
agent v2.5.0/snmp4j 2.5.0 - IP 

In my manager I am using snmp4j 2.5.0 for my snmp requests.
I see, somewhat frequently, timeouts occurring on my manager even though I am getting responses.

The responses are actually returned from my agent to my manager.  I verified it in wireshark and I see the
response received in my log but for some reason the packet is getting dropped I think by snmp4j before it
reaches my application.  
Then 10 seconds later (my timeout value) I see the request timeout in  my log due to the response being dropped.
I have looked into it but getting nowhere so not sure if its a timing thing or something related to my manager application.

I have attached the snmp4j log (snmp4j-timeout_2.log) and the wireshark capture
(nullpreset12-snmp4j-timeout.pcapng) of a request and the response returned from the agent but
getting dropped by my manager.
the snmp message ID  is 62420 and the PDU request ID is 2117843898.

I only have 1 thread running that is polling the agent.

The timestamp in the log for the request being sent is 
2016-07-06 13:34:43,673
The response is received at 
2016-07-06 13:34:43,683
I see the request handle lookup for the response at 
I see a subsequent request handle cancel at 
2016-07-06 13:34:43,688 but its for a different PDU request ID (129664087).

(Continue reading)

Ken Springhetti | 27 Jun 20:26 2016

Supporting an Enterprise MIB using SNMP4J

Hi,My name is Ken, I am new to SNMP4J.  I have a device runnung Linux which uses an SNMP Agent to service an
Enterprise MIB of our own creation. I am working on the next generation of that product which will be Java
based and use SNMP4J Agent, instead of the NET-SNMP Agent which was extended using C language API's to
support ourenterprise MIB, and also supported the standard MIB-II and other popular MIBS.

What I want to do is implement an agent with SNMP4J, setup our Enterprise MIB, compile it, incorporate it
into the agent, and implement the code that goes and gets that data from the database for each point.
This seems to be to be the most common scenario many would want to do, but I cannot find an example of this. 
1. Could someone point me at an example program that does this (with a custom mub compiled and the back end
implemented)2. Could someone , in plain terms, outline the sections of the Agent architecture that I
would need to implement and point me at the API calls I'd use to do it. (a commentary on the above example)3.
Tell me which products I may need to purchase to get this job done, and which products I dont need to
purchase, but would be very useful in getting the job done faster or better.
My boss has ordered a license for the SNMP4J-SMI-PRO, and other than parsing text MIBS at runtime, I am
having a hard time seeing how this product gets me where I need to go.
I understand the parts and pieces of SNMP Agents as a whole, but I am looking to understand the SNMP4J system
better and get this done.
Thank you in advance for any advice, examples, tips or support. 
Ken Springhetti
SNMP4J mailing list
SNMP4J <at>
nino fattore | 17 Jun 22:31 2016

Virtual tables

It is not clear to me how a virtual table is implemented. Any example code to implement a virtual table could
be of help.Thanks,Nino Fattore
SNMP4J mailing list
SNMP4J <at>
ulrich berl | 16 Jun 16:36 2016

snmp4j-agent 2.5.0 - TestAgent: coldStartTrap not sent

Hi !
I use the snmp4j-agent 2.5.0 - TestAgent
I can't see the coldStartTrap anyhow (or some other traps from MyCustomMib)...(tried several vacm
views (as i get a 'Access denied by VACM' - see log), different access groups ecc).
GET requests works fine (on MyCustomMib).
May you can help me ?


INFO  | NotificationOriginatorImpl       | Notification reported with [] for context
DEBUG | DefaultUdpTransportMapping       | UDP receive buffer size for socket is set to: 106496
DEBUG | VacmMIB                          | VACM access requested for context=, securityName=cpublic, securityModel=2,
securityLevel=3, viewType=0, OID=
DEBUG | VacmMIB                          | Found group name 'v1v2group' for secName 'cpublic' and secModel 2
DEBUG | VacmMIB                          | Got views
fullReadView, fullWriteView, fullNotifyView, 3, 1]] for group name 'v1v2group'
DEBUG | VacmMIB                          | Matching against access entry
fullReadView, fullWriteView, fullNotifyView, 3, 1] with exactContextMatch=false,
prefixMatch=false, matchSecModel=true and matchSecLevel=true
WARN  | NotificationOriginatorImpl       | Access denied by VACM for

    protected void addNotificationTargets(SnmpTargetMIB targetMIB,
                                          SnmpNotificationMIB notificationMIB) {
(Continue reading)

Frank Fock | 8 Jun 23:09 2016

AgenPro 4.1.1 Released


AgenPro 4.1.1 has been released to fix a regression in the user code parser which
removed the leading line feed character from parsed user code with the (old but 
widely used) //—AgentGen user code delimiter.


* Fixed: Regression in the user code parser for --AgentGen delimiters
  which removed the leading newline from the user code.

Frank Fock

SNMP4J mailing list
SNMP4J <at>
nino fattore | 28 May 00:43 2016

Please need help with trap filtering

I'd like to know what is wrong with my code!My goal is to learn how to filter notification sent out.With the
following  code i am trying to use the NotifyFilterTable and NotifyFilterProfileTable to send 
all the traps to all the targets. the following step (once the following code is working) is to try to send
different traps to different targets.Thanks,Nino

 protected void addNotificationTargets(SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB) {
    targetMIB.addTargetAddress(new OctetString("notificationV3"),
                               new OctetString(new UdpAddress("").getValue()),
                               500, 1,
                               new OctetString("notify"),
                               new OctetString("v3notify"),

    targetMIB.addTargetParams(new OctetString("v3notify"),
                              //new OctetString("v3notify"),
                             // new OctetString("SHADES"),
                              new OctetString("NINO"),
(Continue reading)

Sudharani S | 26 May 07:28 2016

Network discovery usig snmp4j

Hi  Frank,
Can you please in this.
I am new SNMP protocol ,I have below requirement.Can anyone please help in 
this below requirement.

I need the guidance to start with this,I mean please let me know what all the 
  things I need to include to do this.
   And how to do snmp walk to pim neighbors table?,I have a snmp service enabled 
   in my system apart from this what all the jar files need to be include let me 
   know please.
  The requirement follows like this:
  1)To implement multicast network discovery using snmp in java 2)Create 
   CompletedRouterList (initially NULL) to store the routers for which discovery 
  was complete and a PendingRouterList containing the routers for which 
  discover is pending.
  3)At initialization time, statically populate the PendingRouterList with 
  initial set of routers from some config file.
  4)For each router in the PendingRouterList, if multicast is enabled then 
  query the pimInterfaceTable to obtain the list of interfaces on which PIM is 
  enabled. For example if R1 has PIM enabled and has interfaces 1/1 and 1/2/ on 
   which PIM is enabled then we will have:-
            1/2         1/1
      --------- R1 ----------
 5)For each router that has at least 1 interface that has PIM enabled on it, 
 query it's PIM Neighbor table to obtain the list of it's PIM neighbors. PIM 
 neighbor table also gives the interface index with which the router is 
 connected with it's neighbor. This information can be used to build the link 
 between the router and neighbor(s).
(Continue reading)

ru_44 | 18 May 15:19 2016

Null Pointer Exception - MOSubTreeProxy snmp4jAgent v2.5.0

Hi Frank,I recently upgraded to snmp4j 2.5.0 and snmp4j agent v2.5.0. There’s a bugfix in SNMP4J v2.5.0
which causes a Null Pointer Exception when we use
the MOSubtreeProxy in SNMP4J-Agent v2.5.0

* Fixed [SFJ-121]:
DefaultPDUFactory.createPDU does not set contextName and contextEngineID on


The MOSubtreeProxy class needs to set (or initialize) the
contextEngineID & contextEngineName in the DefaultPDUFactory inside its
constructor.  Currently when the
DefaultPDUFactory.applyContextInfoToScopedPDU() is called via DefaultPDUFactory.createPDU(),
both fields are NULL.

22767 [DefaultUDPTransportMapping_192.168.1.90/161]
DEBUG  - Access allowed for view
'fullReadView2' by subtree 1.3 for OID

java.lang.NullPointerException: Context engine ID
must not be null


(Continue reading)

nino fattore | 13 May 20:47 2016

nedeed help to use the addNotificationtargets() API

I'd like to use the addNotificationTargets() agent API to add a new target for notifications when the agent
is running.How can get to it and providing the SnmpTargetMIB and SnmpNotiicationMIB?Thanks,Nino
SNMP4J mailing list
SNMP4J <at>
nino fattore | 13 May 20:21 2016

forget password to the list

how can i retrieve the password?ThanksNino Fattore
SNMP4J mailing list
SNMP4J <at>
atike.demirbas | 13 May 12:10 2016

[Fwd: java.lang.IllegalArgumentException error]

---------------------------- Original Message ----------------------------
Subject: java.lang.IllegalArgumentException error
From:    atike.demirbas <at>
Date:    Wed, May 11, 2016 4:02 pm
To:      snmp4j <at>

I have developed an software for my school project. I have tried to
collect information on agent machines. When i do it for snmpv1, it is okay
but when i do it for snmpv3 i have an error. I have searched this problem
however i haven't found it. Please, help me.

There is my code;

Snmp client=null;
            client=new Snmp(new DefaultUdpTransportMapping());
            Address add=new UdpAddress("");

          //  USM usm=new USM(SecurityProtocols.getInstance(),new
         //   SecurityModels.getInstance().addSecurityModel(usm);

             UsmUser user = new UsmUser(new OctetString("nagios"),
                                     new OctetString("User3Password"),
                                     new OctetString("User3Encyrption"));
(Continue reading)