nitin sharma | 25 Jan 22:19 2015
Picon

how to change the MIB and its values

Hi team,

I trying to build a SNMP agent and so far been able to built one with the
help of java code available on net (i.e. by extending BaseAgent class).

I would like to know

1. if it is possible to change the default MIB and insert my own
2. Change the OID values before responding back to manger's request.

Regards,
Nitin Kumar Sharma.
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
Boussour, Imene (6076618 | 22 Jan 22:28 2015
Picon

Sending SNMP V3 Traps with or without Agent?

Hi SNMP4J Team,
Thank you for all your efforts developing  the snmp4j stack. And for taking the time to answering our questions.
I am using SNMP4J to send V3 Traps to a third party Trap manager application hosted in a remote Windows Server.
I already implemented a Java Class to send V3 Traps. I would like to know if I need to implement an SNMP Agent in
order to send my Traps to a Trap receiver software. Knowing that, This software must discover SNMP devices
in order to receive Traps from those devices that appears on its list. But What happen in a case of an Application?
Does my SNMP Trap sending Class work alone without an Agent if the Trap receiving server discovered the
machine hosting my application? Or, I need that Trap receiving app to discover an SNMP Agent that I would
implement in order to accept Traps from my application?
The fact is that I am not able to test the solution yet!
I hope my question is clear, otherwise, please let me know to clarify some parts.
Thanks in advance,
Imene.
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
nitin sharma | 16 Jan 03:05 2015
Picon

Snmp4j agent -- can print and store the incoming requests

HI team,

I am building a Snmp4j agent code that will print the incoming Snmp request
. is it possible scenario to be coded? if yes, then please do provide some
guidance.

Regards,
Nitin Kumar Sharma.
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
Boussour, Imene (6076618 | 6 Jan 21:26 2015
Picon

SNMP4J V3 Traps with specified Engine ID

Hello List,

I am trying to send SNMP V3 Traps to a remote server (using a Trap monitor software on windows) from my Java
application, I use SNMP4j stack API.
My questions is around the engine ID, on the Trap receiver application we need to create an SNMP V3 account
with, username, auth protocol... but also a Context Name.
On the SNMP4j side, there is multiple areas where we can define of set the engineID:
1 - USM usm = new USM(SecurityProtocols.getInstance().addDefaultProtocols(), new
OctetString(MPv3.createLocalEngineID()), 0);
2- snmp.getUSM().addUser(mSecurityName,
OctetString.fromHexString("80:00:13:70:c0:a8:01:0d"), new UsmUser(mSecurityName,
mAuthProtocol, , mPrivProtocol, mPrivPassphrase));
3- UsmUser(mSecurityName, mAuthProtocol, , mPrivProtocol, mPrivPassphrase), OctetString.fromHexString("80:00:13:70:c0:a8:01:0d"));
4- pdu.setContextEngineID(OctetString.fromHexString("80:00:13:70:c0:a8:01:0d"));

For context Name , I only found this:
pdu.setContextName(new OctetString("contextName"));

The SNMP4J createlocalEngineId method creates a random number, Can this work?
My understanding of SNMP trap V3, is that the Engine ID should match on the sender and receiver. So, when we
specify a custom engine ID on SNMP4J, which one should we use?

And here is the Code I am using to send Traps:

                     // ltargetAddress represents the host and port we plan to communicate with
                     // in the format: host/port
                     Address ltargetAddress = GenericAddress.parse (mTransportType + ":" + mRemoteAddress + "/" + mRemotePort);

                     TransportMapping<?> transport;
                     if (ltargetAddress instanceof UdpAddress) {
(Continue reading)

Brijesh Kumar | 19 Dec 12:26 2014
Picon

Re: snmp4j for multiple device

Hi Frank,
Yes i am using same security name but if security name is similar then it will throw below  error right ?

Message processing model 3 returned error: Unknown security name

but i am getting 

MessageException: Message processing model 3 returned error: Unsupported security level

I have done below changes by following one of the FAQ  and it dint work either. please point me the FAQ you
mentioned in previous email.
USM usm = USMFactory.getInstance();
Regards
Brijesh 
Date: Fri, 19 Dec 2014 10:01:37 +0100
From: frank.fock <at> t-online.de
To: brijeshvk <at> hotmail.com; snmp4j <at> agentpp.org
Subject: Re: [SNMP4J] snmp4j for multiple device

  

  

    OK, then you hit an FAQ. As you are
      using the same security name

      for all the devices, it is essential (in other cases too, but you
      will not

      see the negative results that early) that you have a unique engine
(Continue reading)

Brijesh Kumar | 18 Dec 18:10 2014
Picon

snmp4j for multiple device

Hi,
I am running snmp4j request for 10 device parallel  . I am using snmpv3 . If all devices is having same set of
cred set it works fine.
If any of this having different auth protocol (MD5 or SHA) or privacy protocol it fails . 
I am getting below error
Message processing model 3 returned error: Unsupported security level

Is there any way i can accomplish sending multiple snmpv3 request to different device parallely ?

Regards
Brijesh
 		 	   		  
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
Dmitrii Krendelev | 18 Dec 11:49 2014

[BugReport][SNMP4J-2.2.3] Concurrency bug in org.snmp4j.util.ThreadPool.

Hi,

We have found quite a critical bug in org.snmp4j.util.ThreadPool.execute(WorkerTask task) method. It
has an execute method below

    public synchronized void execute(WorkerTask task)
    {
        while (true)
        {
            // here we check if some TaskManager-thread is free to execute the task.
            try
            {
                wait(); // wait until some TaskManager-thread notify that it finished a previous task
            }
            catch (InterruptedException ex)
            {
                Thread.currentThread().interrupt();
            }
        }
     }

If  InterruptedException is thrown, so our thread goes into cycle and keep the lock on the ThreadPool
object, so TaskManager-threads cannot notify that they became free as soon as they blocked on the
ThreadPool. So if the interrupt was called when NO TaskManager-threads were free to execute the task, so
the process just hangs.

There is a simple way to fix it. We need just to break the cycle if the process was interrupted and not to
execute task like below.

    public synchronized void execute(WorkerTask task)
(Continue reading)

uodep | 18 Dec 08:02 2014

SNMP4J Agent

Hi, I'm trying to write an snmp agent program of course in java using the snmp4j library, but don't know why
i'm still have problems to get it started. May someone has good tipps to get started with the library,
except with the SampleAgent and the TestAgent in the library?
Thank you

Kent
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
Frank Fock | 17 Dec 20:11 2014

Re: Troubles with SET request

Hello Krystian,

There are several errors (misunderstandings) in the code you posted.
Please completely rewrite it. I suggest using AgenPro to generate
your stub code from a MIB to get a consistent implementation for
the corresponding MIB specification.

The major issues are:
1. The tables have illegal OIDs (regarding SMI standard).
2. The constructor "MOTable" does not exists and it does not take 
several MOAccess values.
3. A table where rows can be created, needs at least one column wiht 
READ_CREATE max. access right.
4. By default, only the SnmpRowStatus column (implementation of the 
RowStatus TC) has a ready-to-use implementation for creating new rows.
5. Adding a row with the same index (OID) as an existing row (or 
previously added row) will replace that row!

Best regards,
Frank

Am 17.12.2014 10:35, schrieb Krystian Powójski:
> Hello Frank,
>
> I'm using your SNMP4J library to create my own SNMP agent. I read a 
> lot of information and forums how to use it in order to create a snmp 
> table. There is no problem when I'm using a SNMP Client sending GET 
> request to my agent, but during sending a SET request there is a 
> Exception:
> "Error 'Unable to create object' generated at: 
(Continue reading)

smruti sagar panda | 11 Dec 16:16 2014
Picon

Snmp agent Listener can bind with 127.0.0.1 to listen from different machine?

Hi,
I am using SNMP4J for my snmp agent application.If my snmp agent and server
are running in same machine, that time my agent is able to listen binding
with 127.0.0.1. But my agent is not able to listen if server is running in
remote machine.  If I will bind my agent with 0.0.0.0, then it can listen
from remote machine also.

But as per my security requirement I should not bind my process with
0.0.0.0 .

Is there any way ,I can use 127.0.0.1 or I can use machine IP(in this case
multiple NIC case will be there).
Regards
Smruti
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
smruti sagar panda | 5 Dec 17:13 2014
Picon

How to lock snmp agent if server is trying to connect with invalid credential(3 times)

Hello,

My application is a snmp agent which is using SNMP4J . By default, all
validation of user name/password is done by SNMP4J . So if any server is
trying to connect with wrong credential to my application , it will fail by
SNMP4J .

But I need locking mechanism to support by my application .Means if any
server tried  3 times with wrong credential , then user should lock for 30
min.

As validation is done by SNMP4J itself , My application is not able to find
when some user trying with wrong credential because processpdu(call back
method) never calls if validation is failed by SNMP4J itself.

Is there any api provided by SNMP4J which supports locking mechanism in
case of wrong credentials.

Or is there any other way , My application can know when validation failed
by SNMP4J , so My application can implement locking mechanism.

Regards
Smruti
_______________________________________________
SNMP4J mailing list
SNMP4J <at> agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j

Gmane