Elise Atkins | 2 Nov 2009 20:14

Re: Counting Invalid Traps

Frank,

First off, I am not that familiar with all the snmp rfs so I did a bit 
of googling and using rfcs 1907 & 2572 I
came up with definitions for two of the counters and what they should count:

snmpASNParseErrors counter is defined in rfc 1907
On page 8 of rfc 1907 the counter is defined
snmpInASNParseErrs OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The total number of ASN.1 or BER errors encountered by the
SNMP entity when decoding received SNMP messages."
::= { snmp 6 }

 From this I think that when the MessageDispatcherImpl.processMessage 
catches the IOException, the counter that is incremented should be 
snmpASNParseErrors not snmpInvalidMsgs since the only time I found 
IOException was thrown when processing a PDU was when the BER decoding 
encounters an error. If you concur with this hypothesis then the check 
for the packet starting with an ASN.1 sequence (0x30) at the beginning 
of processMessage should just return after incrementing the counter or 
throw an IOException and let the catch IOException block further down 
handle the counter incrementing.

snmpInvalidMsgs counter looks like it was added for snmp v3 pdus. The 
relevant sections are:
On page 18 of rfc 2572 the counter is defined
(Continue reading)

Brice Fines | 4 Nov 2009 11:14
Picon

random problem sending command over TCP

Hi Frank,

I have a random problem using SNMP4J version 1.10 SNAPSHOT 12/10/2009.
I know that SNMP4J 1.10.2 was released since then, but I cannot try it in 
this environment right now. I hope to try it soon, to check if it solves 
this problem.

My application hangs forever while sending a command by TCP (the client is 
not listening to commands in that case). 
My feeling is that problem occurs when the application has been idle (i.e. 
receiving TRAP but not sending commands) during a long time (e.g. 8 
hours). The first try to send a command hangs. The next ones to the same 
client work ok (i.e. the client does not answer, but the send command 
finishes gracefully).

Please find enclosed the logs
I am not sure it is a SNMP4J problem, it could be another IBM problem like 
when we manually tried to close the TCP connection.

I will let you know if I can reproduce it with 1.10.2 final.

Thanks
Regards

************ Start Display Current Environment ************
WebSphere Platform 6.1 [ND 6.1.0.17 cf170821.07] [EJB3 6.1.0.17 
cf170821.02]  running with process name 
mmmaix11aCell\mmmaix11a\xxxxx_cluster_srv1 and process id 274738
Host Operating System is AIX, version 5.3
Java version = J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20080315 (JIT 
(Continue reading)

Frank Fock | 5 Nov 2009 09:29
Favicon

Re: random problem sending command over TCP

Hi Brice,

It seems that SNMP4J does not return from a
TransportStateListener.connectionStateChanged(..)
call. As SNMP4J itself does not listen to such
events, the dead lock might occur in your code
implementing the above method. Is that the case?

Regards,
Frank

Brice Fines wrote:
> Hi Frank,
> 
> I have a random problem using SNMP4J version 1.10 SNAPSHOT 12/10/2009.
> I know that SNMP4J 1.10.2 was released since then, but I cannot try it in 
> this environment right now. I hope to try it soon, to check if it solves 
> this problem.
> 
> My application hangs forever while sending a command by TCP (the client is 
> not listening to commands in that case). 
> My feeling is that problem occurs when the application has been idle (i.e. 
> receiving TRAP but not sending commands) during a long time (e.g. 8 
> hours). The first try to send a command hangs. The next ones to the same 
> client work ok (i.e. the client does not answer, but the send command 
> finishes gracefully).
> 
> Please find enclosed the logs
> I am not sure it is a SNMP4J problem, it could be another IBM problem like 
> when we manually tried to close the TCP connection.
(Continue reading)

Brice Fines | 5 Nov 2009 11:32
Picon

Re: random problem sending command over TCP

Hi Frank,

No, it seems we are not using 
TransportStateListener.connectionStateChanged (I could not find any 
reference to TransportStateListener in the whole code).

We use SNMP4J in a straight forward way: configure and init an SNMP object 
for the whole application life, use it to send commands.

Please find enclosed the source for the class we use (to send a command we 
call the "sendCommand" method, that's where the application hangs (but 
only a few times, it works ok 99% of the time)
(I still have to check with version 1.10.2, hope to be able to do it soon)

Thanks

import java.io.IOException;

import org.snmp4j.CommunityTarget;
import org.snmp4j.PDU;
import org.snmp4j.ScopedPDU;
import org.snmp4j.Snmp;
import org.snmp4j.Target;
import org.snmp4j.TransportMapping;
import org.snmp4j.UserTarget;
import org.snmp4j.event.CounterListener;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.mp.CounterSupport;
import org.snmp4j.mp.DefaultCounterListener;
import org.snmp4j.mp.MPv3;
(Continue reading)

Fokusas | 9 Nov 2009 15:53
Picon

TestMasterAgent runing problem

Hello,

I am traying to run TestMasterAgent with parameters in command line: -c
SampleAgent.cfg -bc SampleAgent.bc udp:127.0.0.1/161 tcp:127.0.0.1/161, but
I am having troubles.
What I should exactly have to put in SampleAgent.cfg -and SampleAgent.bc
files?

Regards,
Fokusas
Frank Fock | 10 Nov 2009 23:44
Favicon

AgenPro 3 Release Announcement

Dear SNMP4J-Agent and AGENT++ users,

AgenPro 3 will be released December 16th with new
cool features:

Maven plugin, built-in simulation agent, and scalar
instance as well as row initialization code generation!

AgenPro 3 will be available as Java WebStart application
and classic JAR.

By purchasing AgenPro 2.x until 3.x will be released,
you receive a free upgrade to 3.x which saves you $80!
In addition, all customers who have purchased an
AgenPro license since July 1st 2009 will get a
free upgrade too.

Frank Fock

--

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com
Smith, Gary | 12 Nov 2009 15:40

Handling REPORT PDU in ResponseListener.onResponse()

Hi Frank

With regard to the "first line" in an onResponse(-) implementation,
which cancels the originating async request:

((Snmp)event.getSource()).cancel(event.getRequest(), this);

When I receive a REPORT PDU, getSource() yields an Snmp$ReportProcessor
from which it is not possible to get back to the enclosing Snmp object.
What are your thoughts on this?

Of course, as I have single Snmp instance, I can quite easily assume
that is the source and call cancel via that singleton.

Regards

Gary

Please be advised that this email may contain confidential information.
 If you are not the intended recipient, please do not read, copy or
re-transmit this email.  If you have received this email in error,
please notify us by email by replying to the sender and by telephone
(call us collect at +1 202-828-0850) and delete this message and any
attachments.  Thank you in advance for your cooperation and assistance.

In addition, Danaher and its subsidiaries disclaim that the content of
this email constitutes an offer to enter into, or the acceptance of, 
any
contract or agreement or any amendment thereto; provided that the
foregoing disclaimer does not invalidate the binding effect of any
(Continue reading)

Frank Fock | 13 Nov 2009 01:32
Favicon

Re: Handling REPORT PDU in ResponseListener.onResponse()

Hi Gary,

I would recommend using the user object to provide
the Snmp instance for the async request callback.
That's better than to depend on the source object.
But you are right, the source object in case of a
report should be the Snmp instance, and not the
inner class. I will change that for the next
version (if that change is possible without
disrupting existing code).

Regards,
Frank

Smith, Gary wrote:
> Hi Frank
> 
>  
> 
> With regard to the "first line" in an onResponse(-) implementation,
> which cancels the originating async request:
> 
>  
> 
> ((Snmp)event.getSource()).cancel(event.getRequest(), this);
> 
>  
> 
> When I receive a REPORT PDU, getSource() yields an Snmp$ReportProcessor
> from which it is not possible to get back to the enclosing Snmp object.
(Continue reading)

Baranidharan Ramakoti | 16 Nov 2009 08:02
Picon

Trouble in execution of CreateRow functionality in SNMP4j

Hi,
I am facing a problem in executing the createRow function, using the
TableUtils class.  I have been trying this for the past one week, and I am
unable to create a row.

What is the indexOID and what it would be like?  Is it the OID of Index
column in the table, or anything else?

Also some tables have neither the row status nor the row index columns?  How
do we create a row in those tables?

Kindly help me in this issue.

Thanks and Regards,

--

-- 
BARANIDHARAN
Frank Fock | 16 Nov 2009 19:33
Favicon

Re: Trouble in execution of CreateRow functionality in SNMP4j

Hi,

Baranidharan Ramakoti wrote:
> 
> What is the indexOID and what it would be like?  Is it the OID of Index
> column in the table, or anything else?

No, the indexOID is the (common) instance sub-identifier
of the instances in a table's row. For example within
"ifDescr.1" the indexOID is "1".

> 
> Also some tables have neither the row status nor the row index columns?  How
> do we create a row in those tables?

That is implementation specific. Please consult the
documentation (MIB spec.) of your agent. In any case,
you will not be able to use TableUtils.createRow for
that.

Regards,
Frank

--

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com
(Continue reading)


Gmane