Monika | 10 May 2013 23:27
Picon
Favicon

Is SHA-2 supported?

Hello,

www.snmp4j.org lists "SHA" as one of the supported 
authentication algorithms. Is this SHA-1, SHA-2 or both?
 Is it possible to restrict the usable algorithms to only the SAH-2 family and not 
allow SHA-1 and MD5 to be used? If so, how?

Thanks.
Frank Fock | 4 May 2013 12:33
Favicon

Re: SNMP Buffer OverFlow Exception

Hi,

That question has to be solved by yourself.

Best regards,
Frank

Am 03.05.2013 14:23, schrieb Ballarpure, Akshay (NSN - IN/Hyderabad):
> Hi Frank,
> How to make sure PDU object is not being modified while sending?
>
> --
> With Thanks & Regards,
> Akshay Ballarpure
> AOffice:  +91-40-4472-4112
>
>
> -----Original Message-----
> From: ext Frank Fock [mailto:fock@...]
> Sent: Thursday, May 02, 2013 8:41 PM
> To: Ballarpure, Akshay (NSN - IN/Hyderabad)
> Cc: snmp4j@...
> Subject: Re: [SNMP4J] SNMP Buffer OverFlow Exception
>
> Hi,
>
> You probably misunderstood me. You do not need to synchronize anything,
> just make sure that a PDU object is not modified after Snmp.send*
> has been called. SNMP4J does not make an internal copy of the PDU
> object for performance reasons. Thus, if you modify the object while
(Continue reading)

Aiman Farhat | 3 May 2013 11:57
Picon

Fwd: Fwd: Table Model

Hi Frank,

 Thanks for your response. According to instrumentation guide I am updating
the table model before the request is processed based on external event.
Our table will be small tables doesn't exceed 20 row max. The problem we
are having is not with the order, it is actually with the content. I have
a test data as follow:

Set1:
Component_set1_1
Component_set1_2
Component_set1_3

Set2:
Component_set2_1
Component_set2_2
Component_set2_3

When I send a request from a Mib browser, the table content gets mixed. For
example the data in the table could be something like that:

Component_set1_1
Component_set2_2
Component_set1_3

Which is not what I have expected as my model should have either Set1 or
Set2 but not mix of both.

As you know I am implementing MOServerLookupListener interface and in
queryEvent(MOServerLookupEvent event)  I am building my table model. I know
(Continue reading)

Frank Fock | 2 May 2013 17:10
Favicon

Re: SNMP Buffer OverFlow Exception

Hi,

You probably misunderstood me. You do not need to synchronize anything,
just make sure that a PDU object is not modified after Snmp.send*
has been called. SNMP4J does not make an internal copy of the PDU
object for performance reasons. Thus, if you modify the object while
it is being send out, you get wrong results and BufferOverflowExceptions.

Best regards,
Frank

Am 02.05.2013 11:41, schrieb Ballarpure, Akshay (NSN - IN/Hyderabad):
> Thanks a lot Frank for information.
>
> BTW, What is the fix here ?
> Do I need to synchronize transport mapping only ?
>
> Here is how I can create transport mapping.
>
> private Snmp createSnmpSession (InetAddress address, int port)
>        throws IOException
>      {
>          s_logger.info ("Creating Snmp Session: " +
>            "addr = " + address + ", port = " + port);
>
>          TransportMapping transport = null;
>          if(address != null && port != -1)
>          {
>              transport = new DefaultUdpTransportMapping (
>                      new UdpAddress (address, port));
(Continue reading)

vasanth | 2 May 2013 15:55
Picon
Gravatar

Fwd: Issue in SNMP set operation. Getting Error status 14 - commitFailed

Hi,

I am using SNMP4J API for SNMP set operation.

I tried to set the syslocation for the *ASR 9k device (SNMP V2)*. but set
operation is failed and getting error response.

Error Status: 14
Error Text: commitFailed<http://www.snmp4j.org/doc/org/snmp4j/PDU.html#commitFailed>

If i give the wrong credential, then i am getting the error response as"No
Access". But here i am trying with correct credentials only.

could you please help me here why i am getting
commitFailed<http://www.snmp4j.org/doc/org/snmp4j/PDU.html#commitFailed>
 error. In what scenario we will get this response.

Note: I am not facing this issue for other Cisco IOS devices.

Thanks,
Vasantharajan
Aiman Farhat | 2 May 2013 14:30
Picon

Fwd: Table Model

Hi All,

The problem I am facing with snmp4j is as follow, I am building a
*dynamic*table model, where every time a request comes I clear the old
data and then
recreate it. The Issue I am facing is when I am sending subsequent requests
the data model is not returning the correct rows. Just to give you an
example:

As a test the data I am sending back to the request either:

Set A:

Component1

Component2

Component3

Component4

Component5

Component6

OR

Set B:

Component11
(Continue reading)

Frank Fock | 1 May 2013 00:25
Favicon

Re: SNMP Buffer OverFlow Exception

Hello Akshay,

I think the root cause is the buffer overflow exception.
First, you should fix that issue.

Possible causes are:
1. The PDU or any contained VariableBinding is modified by another
thread (for example the PDU sender) after calling asynchronous
Snmp.send*.
2. A variable binding is being sent, that is not supported by the
protocol version (as you send a scoped pdu, I think this cases is not
matching your case).

Then you can optimize the threading behavior by reducing the
bootle neck in Snmp.NotificationDispatcher.processPdu by
replacing it with:

     public void processPdu(CommandResponderEvent event) {
       CommandResponder listener;
       synchronized (this) {
         listener = notificationTransports.get(event.getTransportMapping());
       }
       if ((event.getPDU() != null) &&
           (event.getPDU().getType() == PDU.INFORM)) {
         // try to send INFORM response
         try {
           sendInformResponse(event);
         }
         catch (MessageException mex) {
           if (logger.isWarnEnabled()) {
(Continue reading)

Kelly Dyer | 30 Apr 2013 23:05
Picon
Favicon

Why 'stop' on SocketException in DefaultUdpTransportMapping.ListenThread?

I am a little confused by this change.  

We have run into this issue, with a sporadic socket closed exception, the cause of which we have not been able
to identify.  What we are seeing is that the new behavior results in a busy-loop, since we go right back to a
receive that is guaranteed to fail.  

This strikes me as a case where we need to either remediate the socket directly, or cancel the listener.  What
am I missing?

Regards,
Kelly.

On 12.07.2011 14:02, Fock, Frank wrote:
> Hi Gary,
>
> Your right, the current behavior is too strict.
> I have changed it as follows for the 2.0 release
> (will also change it for the 1.x branch too):
>
>          catch (SocketException soex) {
>            if (!stop) {
>              logger.error("Socket for transport mapping " + toString() +
>                           " error: " + soex.getMessage(), soex);
>            }
>            if (SNMP4JSettings.isFowardRuntimeExceptions()) {
>              stop = true;
>              throw new RuntimeException(soex);
>            }
>          }
>
(Continue reading)

Vilagut Abad, Roger | 17 Apr 2013 13:58
Picon

Cannot change the snmp password remotely

Hello,

In order to remotely change the authentication password of a user I do the following steps:

1.       Get the usmUsrSpinLock.0 and save in sValue

2.       I obtain the old key of the user whose password I want to change as follows:
byte[] oldKey = snmp.getUSM().getUser(engineId, new OctetString(user)).getUsmUser().getAuthenticationPassphrase();

3.       Then I generate the new key as follows:

byte[] newKey = SecurityProtocols.getInstance().passwordToKey(AuthMD5.ID, new
OctetString(newPassword), engineId.toByteArray());

4.       Then I generate the key change value as follows:

byte[] keyChange = new AuthMD5().changeDelta(oldKey, newKey, random.getBytes());

5.       And finally I do a SET to the usmUserTable:

SET(usmUserSpinLock.0=sValue, usmUserAuthKeyChange=keyChange, usmUserPublic=random)

When I read the usmUserTable MIB table after the SET I can see the random value in the usmUserPublic column,
however when I do a request using the new password the agent responds that the password is not correct.

Am I missing something in the password change procedure? I have tried to follow the procedure described in
RFC 3414 (KeyChange).

Best regards,
Roger Vilagut Abad
(Continue reading)

m k | 16 Apr 2013 16:40
Picon
Favicon

Sending v1/2c Traps With Authentication

Let's say I have a community user with a name like "public", which is associated with a v3 user security name
for compatibility purposes. Does SNMP4j somehow support explicitly sending a trap on behalf of
"public", so that trap-receivers with v1/2c authentication can recognize it?

Thanks
 		 	   		  
Charan, Brad | 4 Apr 2013 18:32
Favicon

Intercepting gets and sets from the Network Manager to individual cells in an MOTable

We have been tasked to create an SNMP agent for our application.   Our application can have multiple
instances within the same JVM, and we have been able to create an agent using MOTables that shows each
instance as a row in a table to the Network Manager.    However we are struggling with how to go about
intercepting the 'getValue' or 'setValue' to each cell in this table as we have been able to do quite easily
for MOScalar - by simply subclassing it and over-riding the getValue and setValue methods.

We don't see the analogue for the MOScalar getValue/setValue in DefaultMOTable.    So, we tried using
VariantVariable for each cell in the table.  However, we have found that the VariantVariable is
overwritten when a set is received by the SNMP4J from the NetworkManager.  So, the
VariantVariableCallback 'updateVariable' works well, until a 'set' is received from the Network
Manager -- after which the VariantVariableCallback stops working because the VariableVariable object
appears to have been de-referenced.

What is the best way to implement this scenario such that we can intercept the sets and gets to each cell in the table?

Brad Charan
FPX LLC
Bloomington, MN, USA

This message may contain confidential information, if you are not the intended addressee, please inform
us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.

Gmane