Re: [SNMP4J] (no subject)about SampleAgentConfig.properties

2008-06-30 Thread Frank Fock
The SHADES user (as the name suggests) requires the SHA authentication
protocol, not MD5.


linyuan wrote:
 
 Thanks for the tip .Can you describe  it in detail to me? I try it 
 again with the command: SNMP4J -a MD5 -A SHADESAuthPassword -x DES  -X 
 SHADESPrivPassword -u SHADES -p GETBULK -Ow 127.0.0.1/161

But I failed. I ought to modify the file of 
 SampleAgentConfig.properties,ought not I? If so ,What do I have to do ?
 
 
 
 
   Date: Thu, 26 Jun 2008 20:40:43 +0200
   From: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   CC: snmp4j@agentpp.org
   Subject: Re: [SNMP4J] (no subject)
  
   Hi,
  
   You have to specify privacy protocol and
   passphrase too, when using an authPriv user.
  
   Regards,
   Frank
  
   林原 wrote:
Hello,
I run the sample agent successfully,and i can do a snmpv2 getnext 
 ,but i am failed to do a snmpv3 getnext with the following command : 
 SNMP4J -a MD5 -A SHADESAuthPassword -u SHADES -p GETBULK -Ow 127.0.0.1/161
   
   
the error message is as follows:
   
2008-6-25 16:58:01 org.snmp4j.log.JavaLogAdapter log信息: UDP 
 receive buffer size for socket 192.168.10.56/0 is set to: 8192
Total requests sent: 0Total objects received: 0Total walk time: 
 2079 millisecondsThe following error occurred during walk:Request timed out.
   
   
By the way , I didn't modified the SampleAgentConfig.properties.
   
Can anybody help me to resolve the problem? Thanks in advance.
   
   
   
   
_
新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
http://im.live.cn/emoticons/?ID=18
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j
  
   --
   AGENT++
   http://www.agentpp.com
   http://www.mibexplorer.com
   http://www.mibdesigner.com
 
 
 
 用 Windows Live Spaces 展示个性自我,与好友分享生活! 了解更多信息! 
 http://spaces.live.com/?page=HP

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


Re: [SNMP4J] problem in using TableUtils class...

2008-06-30 Thread AMRUTH KUMAR JUTURU
Hi Frank,

thanks for the reply, the status is -1 , which means time out I
guess.I increased the time out as well, but still I get the same out
puthere is the new code I am using

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package snmp;

import java.io.IOException;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.snmp4j.CommunityTarget;
import org.snmp4j.PDU;
import org.snmp4j.Snmp;
import org.snmp4j.mp.SnmpConstants;
import org.snmp4j.smi.Address;
import org.snmp4j.smi.GenericAddress;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.UdpAddress;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.transport.DefaultUdpTransportMapping;
import org.snmp4j.util.DefaultPDUFactory;
import org.snmp4j.util.TableEvent;
import org.snmp4j.util.TableUtils;

/**
 *
 * @author crysm
 */
public class TableMain {

public static void main(String args[])
{
try {
TableReader tr = new TableReader();
Snmp session = new Snmp(new DefaultUdpTransportMapping());
CommunityTarget target = new CommunityTarget();
Address targetAddress = GenericAddress.parse(udp:
192.41.135.203/161);

   target.setCommunity(new OctetString(public));
   target.setAddress(targetAddress);
   target.setRetries(2);
   target.setTimeout(15000);
   target.setVersion(SnmpConstants.version1);
TableUtils tu = new TableUtils(session,new
DefaultPDUFactory(PDU.GETBULK));
OID[] oidArray = new OID[13];
oidArray[0] =  new OID(1.3.6.1.2.1.15.6.1.1);
oidArray[1] =  new OID(1.3.6.1.2.1.15.6.1.2);
oidArray[2] =  new OID(1.3.6.1.2.1.15.6.1.3);
oidArray[3] =  new OID(1.3.6.1.2.1.15.6.1.4);
oidArray[4] =  new OID(1.3.6.1.2.1.15.6.1.5);
oidArray[5] =  new OID(1.3.6.1.2.1.15.6.1.6);
oidArray[6] =  new OID(1.3.6.1.2.1.15.6.1.7);
oidArray[7] =  new OID(1.3.6.1.2.1.15.6.1.8);
oidArray[8] =  new OID(1.3.6.1.2.1.15.6.1.9);
oidArray[9] =  new OID(1.3.6.1.2.1.15.6.1.10);
oidArray[10] =  new OID(1.3.6.1.2.1.15.6.1.11);
oidArray[11] =  new OID(1.3.6.1.2.1.15.6.1.12);
oidArray[12] =  new OID(1.3.6.1.2.1.15.6.1.13);
   // oidArray[13] =  new OID(1.3.6.1.2.1.15.6.1.14);
List list = tu.getTable(target, oidArray,null,null);
System.out.println(The size of the list is  :  + list.size());
System.out.println(list.get(0).getClass());
   for(int i=0;ilist.size();i++)
   {
   TableEvent tableevent = (TableEvent)list.get(i);
   System.out.println(this is the status  +
tableevent.getStatus());
   VariableBinding[] vb = tableevent.getColumns();
   if(vb==null)
System.out.println(this is null);
//   System.out.println(size of the vb is : +vb.length);
  /* for(int j=0;jvb.length;j++)
   {
   System.out.println(vb[j]);
   }*/
   }


} catch (IOException ex) {
Logger.getLogger(TableMain.class.getName()).log(Level.SEVERE,
null, ex);
}
}

}


On Mon, Jun 30, 2008 at 5:47 PM, Frank Fock [EMAIL PROTECTED] wrote:

 Hi,

 What is the status of the TableEvent object you get?
 I guess it is an error state...

 Best regards,
 Frank

 AMRUTH KUMAR JUTURU wrote:

 Hi all,

  I am trying to use TableUtils class to read the bgp routing
 table entries. But I have a problemThis is the code

 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */

 package snmp;

 import java.io.IOException;
 import java.util.List;
 import java.util.Vector;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.snmp4j.CommunityTarget;
 import org.snmp4j.Snmp;
 import org.snmp4j.smi.OID;
 import org.snmp4j.smi.OctetString;
 import org.snmp4j.smi.VariableBinding;
 import org.snmp4j.transport.DefaultUdpTransportMapping;
 import org.snmp4j.util.TableEvent;
 import org.snmp4j.util.TableUtils;

 /**
  *
  * @author crysm
  */
 public class TableMain {

public static void main(String args[])
{
try {
TableReader tr = new TableReader();
Snmp session = new Snmp(new DefaultUdpTransportMapping());
CommunityTarget target = new CommunityTarget();
target.setCommunity(new OctetString(public));
TableUtils tu = new TableUtils(session,tr);
OID[] oidArray = new OID[14];
oidArray[0] =  new OID(1.3.6.1.2.1.15.6.1.1);
oidArray[1] =  new OID(1.3.6.1.2.1.15.6.1.2);
oidArray[2] =  new OID(1.3.6.1.2.1.15.6.1.3);
oidArray[3] =  new OID(1.3.6.1.2.1.15.6.1.4);