Frank Fock | 1 Aug 2009 21:32
Favicon

Re: get big table for SNMPv2 (GetBulk) snmp4j problem.

Hi Michael,

Are you sure that the agent returns the values
in proper lexicograhic order? Many agents
do not, and a standard conform manager
cannot display the returned values like it
might have been intended by the agent
implementor.

Best regards,
Frank

Michael Yavorovsky schrieb:
> Hi,
>
>  
>
>  
>
> Using SNMP4J 1.9.1f I faced problem for getting some big tables (18
> columns) using "TableUtils.getTable".
>
> I get only the part of response like:
>
>  
>
>  
>
> Row 1: value11  value12 value13 .. value1x
>
(Continue reading)

wafae alami | 4 Aug 2009 18:07
Picon

Use différent target for each recieved notification

Hi everyone,

My snmp4j agent listens for many product notifications , I want to use a
different address target for each product traps .How can I do that please .

for exemple : target for  Trap generated when receiving notification with
OID "1.3.6.1.4.1.67.1.6.6.1"  is : 127.0.0.1/162
                                                            and target  for
  notification with OID "1.3.6.1.4.1.67.1.6.6.1"  is : 127.0.0.1/163

Thanks
Ouafae
Kai Wiemer | 5 Aug 2009 09:31
Picon

Configure agent address (SNMPv3-informs)

Hi,

we are using SNMP4J in a project and due to security reasons we
currently switched from v1 to v3. In more detail SNMP4J is used in the
context of automated tests. By sending traps respectively informs we
force our application (under test) to communicate (snmpgets) with a
SNMP (v3) capable agent and to update or create certain data records
in the underlying database.

The key point is that the inform-sender is a different "agent"
(automated tests) than the one our application communicates with.

So A sends informs to B and B communicates with C.

To do so it is necessary our application knows which agents sent the
trap/inform and reverse to manipulate the sender's IP address. Using
org.snmp4j.PDUv1 objects it was easy to configure the agent's address
by calling void org.snmp4j.PDUv1.setAgentAddress(IpAddress arg0). Now
that we switched to SNMPv3 and using org.snmp4j.ScopedPDU I don't see
any obvious chance to configure the agent's address.

To cut a long story short: how can i configure the agent's IP address
using SNMPv3-informs?

Thanks in advance and best regards

Kai
Frank Fock | 5 Aug 2009 22:11
Favicon

Re: Configure agent address (SNMPv3-informs)

Kai,

There is an object defined to describe what was
specified by the agentAddress field in SNMPv1.
Please read the RFC 3584 for more details.

Best regards,
Frank

Kai Wiemer schrieb:
> Hi,
>
> we are using SNMP4J in a project and due to security reasons we
> currently switched from v1 to v3. In more detail SNMP4J is used in the
> context of automated tests. By sending traps respectively informs we
> force our application (under test) to communicate (snmpgets) with a
> SNMP (v3) capable agent and to update or create certain data records
> in the underlying database.
>
> The key point is that the inform-sender is a different "agent"
> (automated tests) than the one our application communicates with.
>
> So A sends informs to B and B communicates with C.
>
> To do so it is necessary our application knows which agents sent the
> trap/inform and reverse to manipulate the sender's IP address. Using
> org.snmp4j.PDUv1 objects it was easy to configure the agent's address
> by calling void org.snmp4j.PDUv1.setAgentAddress(IpAddress arg0). Now
> that we switched to SNMPv3 and using org.snmp4j.ScopedPDU I don't see
> any obvious chance to configure the agent's address.
(Continue reading)

Iker Almandoz | 7 Aug 2009 06:53
Picon

Syntax-type 3 (BITS) not supported by default. Needs to call setExtensibilityEnabled(true)

Hi Frank, 

Today I have run into an interesting problem with one of the equipments our
system manages.

We have encountered an equipment that returns certain OIDs as type BITS (or
syntax type 3).

When we collect using snmp4j, I am getting "Unsupported variable syntax: 3".
I have looked at the code and realized I can get this syntax type supported
by calling: 

        SNMP4JSettings.setExtensibilityEnabled(true);

Because the snmisyntaxes.properties does contain the definition for that
type:

# The BIT STRING type is obsolete since RFC 1902 but provided here for

# backward compatibility:

3=org.snmp4j.smi.BitString

However, the AbstractVariable.createVariable() does not seem to support the
bits type. Is this intentional ?  Do you envision putting a default handling
for this data type even though it's an obsolete type ?

If I enable 'setExtensibilityEnabled(true)', is there any other differences
I should expect ?. 

(Continue reading)

Michael Yap | 11 Aug 2009 06:58

BER and ASN.1

Hey guys, started with SNMP4j not too long ago. Was writing a web app to
capture and analyze snmp traps from the devices in my infrastructure.
Everything's set up very nicely and we're able to capture the traps but
we're getting to a point where we now need to understand the values of the
OIDs in order to analyze the logs and make sense of them. Hence we need to
deal with ASN.1 and BER. Didn't really find anything in SNMP4j to help out
with that and was wondering if we've missed something. Conceptually we're
looking for something that can parse BER strings into java objects so the
application and process them accordingly.

Thanks fellas.

-Michael-
Frank Fock | 11 Aug 2009 18:55
Favicon

Re: BER and ASN.1

Hi Michael,

SNMP4J already does the conversion from BER
to Java objects. Therefore I suspect you are looking
for a SMI (MIB specifications are written in SMI
not ASN.1) compiler/parser. JASMI available
from my site http://www.mibdesigner.com can
do that. There are other parsers too avaible.

In most cases, a compile time parser (i.e. code
generator like AgenPro) is the best choice and should
be preferred  instead of runtime parsing. The latter
is only suitable for generic applications.

Best regards,
Frank

Michael Yap schrieb:
> Hey guys, started with SNMP4j not too long ago. Was writing a web app to
> capture and analyze snmp traps from the devices in my infrastructure.
> Everything's set up very nicely and we're able to capture the traps but
> we're getting to a point where we now need to understand the values of the
> OIDs in order to analyze the logs and make sense of them. Hence we need to
> deal with ASN.1 and BER. Didn't really find anything in SNMP4j to help out
> with that and was wondering if we've missed something. Conceptually we're
> looking for something that can parse BER strings into java objects so the
> application and process them accordingly.
>
>  
>
(Continue reading)

vijay reddy | 11 Aug 2009 23:42
Picon
Favicon

Getting 1405 error on sending V3 traps with AES192/AES256


Hello Friends,

    Am trying to generate traps using AES192/AES256 as PrivType, and received following exception,

org.snmp4j.MessageException: Message processing model 3 returned error: 1405
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:422)
at org.snmp4j.Snmp.sendMessage(Snmp.java:955)
at org.snmp4j.Snmp.send(Snmp.java:794)
at org.snmp4j.Snmp.send(Snmp.java:758)
at Snmpv3Sender.sendV3Trap(Snmpv3Sender.java:141)
at Snmpv3Sender.main(Snmpv3Sender.java:153)

Did anyone encountered the same problem?   Works fine with AES128, only with AES192/AES256 having issues.

Looking at the error code,  1405 refers to  SNMPv3_USM_ENCRYPTION_ERROR

Am currently using JAVA 1.6.  

Thanks for all the help,

regards,

Vijay

_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009
Tharsiny Markandu | 12 Aug 2009 22:48
Picon

USM error handling

Hi Frank,

I'm looking at how USM errors are handled in Snmp4j.  I would like to report
to the users of SNMP code, when SNMP receives an USM error.
That is, I would like to report the following errors:
- unsupported security level
- not in time window
- unknown user name
- unknown engine id
- wrong digest
- decrypt error.

I'm working on the manager code and I do gets on the agents (various types
of NEs). This is the code I'm using to check the response to my synchronous
get requests.

public VarBindList checkRequestStatus(ResponseEvent respEvt,
                                          boolean recovTooBig,
                                          SnmpIpAddress nodeIpAddr,
                                          boolean updateReachability,
                                          SnmpConfig snmpConfig)
            throws SnmpException {
        if (respEvt == null) { // The request got interrupted
            Log.logWarning(SnmpConstants.SNMP_LOG_MODULE, "SNMP request
interrupted");
            throw new SnmpInterruptedException();
        }
        PDU resp = respEvt.getResponse();
        PDU req = respEvt.getRequest();
        if (isDebugLog()) {
(Continue reading)

Yasen Simeonov(NeterraNMT | 14 Aug 2009 10:25
Favicon

DefaultUDPTransportMapping - java.lang.OutOfMemoryError

Hi Frank,

I have a List that contain objects<PortCrc> with info about devices and 
ifDesc,
they are about 100.I am trying to get errors from the ports on every device.
Unfortunately i have next runtime error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at 
org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.<init>(DefaultUdpTransportMapping.java:286)
    at 
org.snmp4j.transport.DefaultUdpTransportMapping.listen(DefaultUdpTransportMapping.java:165)
    at org.snmp4j.Snmp.listen(Snmp.java:390)
    at 
yasen.snmp.tools.SnmpV2cGetNext.getValueFromOID(SnmpV2cGetNext.java:60)
    at Test.main(Test.java:94)

Next is my code that use the  SNMP class.

    for (int i = 0; i < portCrcList.size(); i++) {
            PortCrc portCrc = (PortCrc) portCrcList.get(i);
            Device dev = portCrc.getDevice();
            SnmpV2cGetNext obj = new SnmpV2cGetNext(dev.getIp(), dev
                    .getSnmp_ro());
            String c = null;
            try {
                c = obj.getValueFromOID("1.3.6.1.2.1.2.2.1.14."
                        + portCrc.getIfdesc());
            } catch (IOException e) {
                e.printStackTrace();
(Continue reading)


Gmane