|
Hello All, I already implemented OID for accessing my variable .The datatype for this OID is OCTETSTRING. I run the snmpcommands (snmpget ,snmpwalk) for getting the string values corresponding for this OID variable. After running this commands i got the output as a HEXSTRING value whose size is more than 400characters. Also i implemented one Java program as an application programming interface consist of snmpfunctions(getMIBEntry etc.........) import java.util.*;String itemID = "1.3.6.1.2.1.1.3.0" System.out.println("Itemid"+itemID); SNMPVarBindList tableVars = comInterface.getMIBEntry(itemID); System.out.println("Number of table entries"+tableVars.size()); for(int i=0;i<tableVars.size();i++) { SNMPSequence pair = (SNMPSequence)(tableVars.getSNMPObjectAt(i)); SNMPObjectIdentifier snmpOID = (SNMPObjectIdentifier)pair.getSNMPObjectAt(0); SNMPObject snmpValue = pair.getSNMPObjectAt(1); System.out.println("Ret OID:"+snmpOID+",Type:"+snmpValue.getClass().getName()+",Value:"+snmpValue.toString()); } } I alredy run the above code.Then the output of this progam is: Ret OID:1.3.6.1.2.1.1.3.0,Type:snmp.SNMPTimeTicks,Value:75941 But if we run the snmpcommand as "snmpget -c public -v 2c localhost .1.3.6.1.2.1.1.3.0", i got the systemuptime value correctly.(Timeticks: (75941) 0:18:58.21). But if i run the above javacode i couldn't get the correct string value.Here this code is not taking the space character. Please suggest any solution for this problem. Thanks in advance Krishnaprasad I am not aware of any limitation within the agent regarding length. You need to make sure that the OID you are setting can handle a string of that size(refer to MIB documentation). Your handler for that OID needs to be able to handle 400 characters (I assume you are developing the agent code). The default tools(snmpset,snmpget, etc.) from the project can handle long strings. We have strings 1024 characters in length. What types of problems are you having?Bob --- Krishnaprasad <[EMAIL PROTECTED]> wrote: -- Rgds KRISHNAPRASAD.K R&D Engineer HCL INFOSYSTEMS LTD PONDICHERRY Mob:09894530948 |
- Re: Sending a string using snmp Krishnaprasad
- Re: Sending a string using snmp Dave Shield
- Re: Sending a string using snmp Dave Shield
