No Response SNMP (sysContact OID noSuchName (2))

I'm trying to monitor a temperature sensor via the Network Device monitoring capability of Operations Manager. The device supports MIB-II, except that is does not support OID: 1.3.6.1.2.1.1.5 (sysContact). Which according to this link: http://www.systemcentercentral.com/snmp-discovery-fails-scom-2012/,
will cause Operations Manager to fail to discover the device as an SNMP device. I've confirmed the failure via Microsoft Network Monitor, where I can see the response from the device back to the Management Server with the ErrorStatus: noSuchName (2), ErrorIndex:
3.
Is there a way to make Operations Manager ignore just the OID: 1.3.6.1.2.1.1.5 (sysContact) ? I'll be authoring a custom MP but I need the device to be added as a network device into Operations Manager first...
Thanks,

Vincent that technet link does not detail the above considerations around the actual OID's required.
I ended up logging a case with Microsoft and essentially they ended up confirming the information in the link:
http://www.systemcentercentral.com/snmp-discovery-fails-scom-2012/. They did not supply any extra technical details as to why this is the case and said that there is no way to adjust
this behaviour.
Therefore, the only way to monitor devices that do no implement all 5 MIB-II OID's is to monitor them as ICMPONLY devices. You will then have to ensure that the Community String RunAs Account is associated with the SNMP RunAs Profile. You will also need
to ensure that SNMP Version property in the Node object is adjusted to version 1 if the device happens to use version 1 - otherwise it will default to version 2 and any SNMP queiries making use of the SNMP Version property will fail.
Apparently, Microsoft will at some point publish an article but I have no timeframe about when that will be.

Similar Messages

  • No Response SNMP when discovering UPS - SCOM 2012 R2

    Hello,
    When i tried finding routers/switches to monitor everything went good, but now when trying with UPS i'm getting " No response SNMP" even tho SNMP on the UPS is enabled, v2c and firewalls off... What could be the cause?
    Thank you

    Hi,
    I created my one rules and monitors based on OID.
    For example I monitor the Remaining run time on Battery with OID .1.3.6.1.4.1.318.1.1.1.2.2.3.0
    If you are using APC there is a APC Power MIB you can download from http://www.schneider-electric.us/sites/us/en/support/faq/faq_main.page?page=content&country=US&lang=en&id=FA156048&locale=en_US&redirect=true
    Greetings Roel Knippen
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Snmp Syscontact

    SNMP System Contact only can use english characters, numbers, and "-_".
    This is the error message if you select an email as the SNMP syscontact, pretty sure you're allowed to have email addresses there.
    Edit: Had to set an override in libreNMS because that for one expect the syscontact to be an email address (It uses it for device down alerts if they're enabled)

    I will advise Linksys engineering of this issue.
    Please remember to Kudo those that help you.
    Linksys
    Communities Technical Support

  • SCOM 2012 SP1 - Setup SNMP monitoring = ping OK, no response SNMP.

    Hello, 
    I've tried the snmp monitoring in lab domain, everthing work. Now I work in the production environment, but I can't  make work the snmp. I've tried only snmp, but the same error occure. The Ping is ok, all my firewalls rules allows snmp and ping over
    the domain. 
    But when I launche the discovery, I've got an error after "No Response SNMP". I've analized the network with wireshark, I see the snmp get send to scom to the network device, but the netowrk device, reply " Destionation unreachable (Port unreachable)".
    I've check with "netstat -ano -p udp" but I don't see the port 162, the 161 is open and snmp.exe service use it. But 162 is not open and Healthservice.exe doesn't use it.
    I tried to reboot the server, but nothing change. And I check all my configuration, and it's the same in my lab domain and te production.
    Anybody have the same issue? Or a workaround? 
    Thank you in advance.
    KimBaxZ

    Hello Roger, 
    1. Windows Firewall 
    a. SNMP service authorized 
    b. SNMP trap not authorized 
    c. PING.exe authorized 
    d. HealthService.exe authorized 
    2. SNMP service configuration 
    a. Security => Community name + Right OK
    b. Security => Accept SNMP packets from any host
    3. SNMP trap service disabled 
    4. The network device (cisco switch is already configured and the snmp work well)
    a. It's possible to execute a snmp walk on the switch, and we get all the data (we use a différents
    computer to do this, like a linux server on the same network) 
    5. We use snmp v2 on the switch, and during the discovery scom, send v2c snmp get to the switch with the good community name.
    6. I tried to forge a snmp v2 packet and send them to the scom server, wireshark see the packet
    During the discovery the switch get the snmp request, but he can't reply, the snmp trap port (162) on the scom server is not open. And I don't know why. 

  • Snmp for oids with multiple values

    Hi,
    So if we have array of OIDs defined in the mib file (eg, 1.3.6.1.4.1.22.1.1, 1.3.6.1.4.1.22.1.2, 1.3.6.1.4.1.22.1.3 and so on each having different values). does anyone know how can we capture this using SNMP fetchlet?
    or
    do we need to specify each oid separately?
    Thanks

    Maybe I misunderstood lushhay here. I thought lushhay wanted to associate a key with multiple values. So one way is to have the value of the Hashtable key to be an ArrayList.
    Hashtable table = new HashTable();
    String key1 = "myKey";
    String key2 = "myKey2";
    Date value1 = (some date value);
    Date value2 = (another date value);
    Date value3 = (another date value);
    ArrayList valueList = new ArrayList();
    valueList.add(value1);
    valueList.add(value2);
    valueList.add(value3);
    table.put(key1,valueList);
    This would associate "myKey1" with 3 date values stored in an ArrayList.
    There is a downside to using the string concatenation method. You assume that the content of each values will never contain a delimiter. You also assume that the values are strings. But if the values are byte[], the string concatenation will not work. If the values are Dates, it can still work, but you would have to convert it from Date to String then concatenate, then get the String value through StringTokenizer and then convert back to Date.
    But anyways, if the values are Strings (and won't contain the delimiter character), then the concatenation method would suffice.

  • SNMP VRF OID

    I want to recover the name of the SNMP VRF on my router CISCO 7206VXR-NPE-G2.
    IOS : (C7200P-ADVENTERPRISEK9-M) Version 12.4(24)T
    We have no access to get information about the OID 1.3.6.1.3.118.1.2.2.1.1 (nzme of VRF)
    Do you have a solution to get it?
    Regards,
    Christophe Voisin

    This object cannot be polled.  Its access status is for notification (i.e. traps) only.  If you need to find out what VRFs are configured, perform an SNMP Walk of mplsVpnVrfRouteDistinguisher (for example).  The VRF names will be on the left-hand side.  For example:
    MPLS-VPN-MIB::mplsVpnVrfRouteDistinguisher."x" = ""
    MPLS-VPN-MIB::mplsVpnVrfRouteDistinguisher."TeSt" = ""
    MPLS-VPN-MIB::mplsVpnVrfRouteDistinguisher."marcus" = STRING: "100:1"

  • Flexconnect Group Name - SNMP OID/MIB

    Hi,
    Does anyone happen to know if an SNMP MIB/OID exists for the Flexconnect configuration on a WLC?  Specifically I'm looking to return the name of the Flexconnect Group that a particular AP is a member of.  I've accomplished this for the AP group, but I can't find a way to return the Flexconnect Group name.
    Appreciate any pointers,
    Thanks
    Peter Moorey.

    Hi,
    Thank you for taking the time to reply.  I found that OID during my research, for some reason it's 'Not Accessible' according to the Cisco documentation.  I don't know why that is the case, but when I issue an SNMP walk it doesn't work, backing up the statement Cisco published online.
    http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.4.1.9.9.517.1.3.1.1.1#oidContent 
    Pete.

  • SNMP Traps Other Than Switches

    Hello,
    I am running SCOM 2012 R2 and I have had SNMP traps enabled for a long time now.  I have only been monitoring my switches, but now I want to monitor other devices such as UPS's and printers.  I followed the article "How the heck do I
    get it working?" and I have no issues receiving traps from my switches.  But my printer, a Lexmark E260DN sends traps to my P.C. and I am using a free SNMP trap receiver.  It sends the traps to my SCOM server too, using the same app.  But
    SCOM does not display them.  My UPS, an APC Smart-UPS 5000, is only discovered using ICMP.  I tried discovering it using SNMPV1 and SNMPv3.  Both versions result in the same way.  I get "No Response SNMP".  It is definately
    not a firewall issue.  I have 35 other devices that are sending me traps.  34 of them are switches and the other one is the printer I just discovered.  Any help would be appreciated.

    Hi,
    You may check Network Discovery Progress Events found in the Monitoring space
    under “Operations Manager\Network Discovery\Network Discovery Progress Events”.  Network Tracing may help also.
    In addition, please refer to the article below to troubleshoot network device discovery issues:
    http://www.code4ward.net/main/Blog/tabid/70/EntryId/105/Troubleshooting-Network-Discovery-in-SCOM-2012.aspx
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • SNMP on Directory Server 4.15

    Hi all
    we are using directory server version 4.1x , on solaris 7 running on sparc. now i want to enable the
    SNMP for directory server to get the stat data.
    i have already installed the UCD-SNMP now known as Net-SNMP on the same server and it's working fine and i am monitoring the CPU/Mem etc resources of the server using it.
    so kindly some one pls tell me or show me some points which explains how to enable and use SNMP's OIDs to get details from the directory server.
    i have gone through couple of docs but not getting the picture clear enough to implement this
    warm regards
    Prashant

    Scott Lawson <[email protected]> wrote in news:3BCAA419.E322F958
    @sghms.ac.uk:
    >
    I had an idea that it might have been running out of available
    connections so I set it to close idle
    connections after 300 seconds. Is there any docs on tuning the resources
    for the server or for
    identifying if you have a resource problem?4.15 hotfix solves a problem with FDs running out (apparently .... we are
    still testing0.
    /* Christopher Burke - Spam Mail to [email protected]
    |*
    \* Real mail to cburke(at)craznar(dot)com

  • Embedded Event Manager - SNMP - run TCL script

    I would like to run a tcl script on a router using snmp. I understand Embedded Event Manager can do this but haven't found what I need to run that.  Can someone point me in the right direction?

    Yeah, you could do this, but it depends on your version of IOS.  You will need EEM 3.1 or higher (15.0) to be able to intercept SNMP GET requests.  Then, you could do something like:
    event manager applet snmp-trigger event snmp-object oid 1.9.9.9.9 type gauge sync yes istable no action 1.0 policy my_tcl_policy.tcl action 2.0 snmp-object-value event-id _event_id gauge 0 next-oid 1.9.9.9.9.0 action 3.0 exit 1!snmp-server manager
    Then, when you query 1.9.9.9.9.0 on the device, the Tcl policy "my_tcl_policy.tcl" should execute, and the snmp-trigger applet policy will return a value of 0.
    Please support CSC Helps Haiti
    https://supportforums.cisco.com/docs/DOC-8895
    https://supportforums.cisco.com

  • OID for AGM/ADM modules

    I have 4 modules 2 AGM and 2 ADM install in 7609, I need to integrate this information to a system of monitoring as FMS, one requires the detail of the OID, and the value of the variable that is required to manipulate (to show in alert status).
    Unfortunately in Cisco I have not found this level of details.

    I don't know if this works on a 7609 (worth a try) but on my ASA5510 there is a hidden command:
    show snmp-server oid
    It lists every OID available to use.
    Hope this helps.

  • TCL SNMP send data

                       Hello I need some help with my problem.
    My Cisco device comunicate over SNMP, I need sens spetial data over SMS, and see way but try do it more good.
    Switch_1 (Send $data over TCL and SNMP)
    if [catch {action_snmp_trap intdata1 "424242" strdata "$data"} result] {
    error $result $errorInfo
    } else {
    action_syslog msg "SNMP sent"}
    Switch_2 (recieve SNMP message and must send it to Cellular int.)
    event manager applet SNMP
    event snmp-notification oid 1.3.6.1.4.1.9.10.91.1.2.3.1.9. oid-val "424242" op eq src-ip-address xxx.xxx.xxx.xxx
    action 10 cellular 0/0/1 gsm sms send 8xxxxxxxxxx "$data"
    I try know can EEM get strdada from SNMP, and put it to next action command? Than you.

    Hello Joseph, can posable overwrite one OID in one script?
    If I try do it, sw get error:
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: Duplicate oid: 1.3.6.1.4.1.33333.2.0
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     while executing
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: "sys_reqinfo_snmp_trapvar var vbinds oid 1.3.6.1.4.1.33333.2.0 string $line "
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     invoked from within
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: "$slave eval $Contents"
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     (procedure "eval_script" line 7)
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     invoked from within
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: "eval_script slave $scriptname"
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     invoked from within
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: "if {$security_level == 1} {       #untrusted script
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:      interp create -safe slave
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:      interp share {} stdin slave
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:      interp share {} stdout slave
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: ..."
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl:     (file "tmpsys:/lib/tcl/base.tcl" line 50)
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: Tcl policy execute failed:
    Aug  4 14:08:01: %HA_EM-6-LOG: sw.tcl: Duplicate oid: 1.3.6.1.4.1.33333.2.0

  • SNMP ipNetToPhysicalPhysAddress only shows ipv6 addresses

    Hi,
    we currently have a problem with a software which is listing up devices with the mac and ip address.
    The developer of the software is using snmp ipNetToPhysicalPhysAddress (OID 1.3.6.1.2.1.4.35.1.4).
    Unfortunately a snmpwalk only provides some ipv6 addresses but non ipv4 addresses.
    We are using two 3850-24T in a stack, IOS version is 03.03.04SE
    Is there a know issue with the ipNetToPhysicalPhysAddress entries?
    Thanks in advance
    Johannes

    Hi,
    can nobody help me?
    Johannes

  • How do I control my program?

    Hi,
    The program below works fine, except the control is all out of whack. I would like to control the program flow from the main method. Hence call the getSNMP() and store the result of fixResponseString() to a global variable.
    But I keep on receiving error when I try to accomplish this. The error is snmp4j.java:67: non-static method fixResponseString(java.lang.String) cannot be referenced from a static context. This is probably very common on here, but I need help to separate my program so it is all controlled from the main method.
    Cheers,
    import org.snmp4j.*;
    import org.snmp4j.PDU;
    import org.snmp4j.asn1.*;
    import org.snmp4j.event.*;
    import org.snmp4j.log.*;
    import org.snmp4j.mp.*;
    import org.snmp4j.security.*;
    import org.snmp4j.smi.*;
    import org.snmp4j.smi.UdpAddress;
    import org.snmp4j.tools.console .*;
    import org.snmp4j.transport.*;
    import org.snmp4j.util.*;
    public class snmp4j{
         public static void main( String [] args ) throws Exception  {
              getSNMP();
         //Retrieves the SNMP variables based on the string OID and stringAddress
         static void getSNMP() throws Exception {
              String stringOID = "1.3.6.1.2.1.1.5.0";
              String stringAddress = "10.31.9.41/161";
              // Target address
              Address targetAddress = new UdpAddress (stringAddress);
              OID targetOID         = new OID(stringOID);
              *  1. PDU and Communityaddress
            *     PDU instance
              PDU requestPDU  = new PDU();
              requestPDU.add(new VariableBinding(targetOID)); // sysName
              requestPDU.setType(PDU.GET);
              // Comunity Target
              CommunityTarget target = new CommunityTarget();
              target.setCommunity(new OctetString("liepsi73"));
              target.setAddress(targetAddress);
              target.setTimeout(500);           // set timeout to 500 milliseconds -> 2*500ms = 1s total timeout
              target.setVersion(SnmpConstants.version1);
              *  2. Classes for SNMP message sending (command generation)
              *  3. Classes for SNMP message dispatching (command responding)
              TransportMapping transport = new DefaultUdpTransportMapping();
              Snmp snmp = new Snmp(transport);
              transport.listen();
              ResponseEvent response = snmp.send(requestPDU, target);
              if (response.getResponse() == null) {
                   System.out.println("Request timed out");
              } else {
                   // dump response PDU
                   // print the response and call the fixResponseMethod
                   //SNMPresult = (response.getResponse().toString());
                   System.out.println(response.getResponse().toString());
                   fixResponseString(response.getResponse().toString());
         // Manipulated the output of the retrieved snmp message.
         static void fixResponseString(String s) {
              s = s.substring(72); // remove everything before "VBS["
              int i = s.indexOf("="); // remove everything before "="
              s = s.substring(i+2); // remove "= "
              int length = s.length(); // get the length
              s = s.substring(0, length-2); // remove last two characters
              System.out.println(s);
    }

    See these existing forum posts.
    http://onesearch.sun.com/search/onesearch/index.jsp?charset=utf-8&col=developer-forums&qt=cannot+be+referenced+from+a+static+context&rt=true&cs=false&y=8&x=6
    Had you searched, you would have had an answer an hour ago.

  • Problem in implementing code using snmp4j.jar

    Hi,
    I am using snmp4j.jar to create a class that will execute SNMP commands such as GET, GETNEXT and GETTABLE.
    The issue I am facing is extremely peculiar. When running the program for the first time, the output is seen correctly. However, in the subsequent executions, the program hangs (at the point where the object of my snmp class is to be created).
    I am unable to understand if some socket/port has been left open in the first run because of which successive executions are not happening. Also, the SNMP session may not be getting closed properly.
    Could someone please help me out with this issue? I am pasting the code snippets here for reference.
    Please do respond with your comments on the same. Thank you.
    import java.io.IOException;
    import java.util.List;
    import java.util.Vector;
    import org.snmp4j.CommunityTarget;
    import org.snmp4j.PDU;
    import org.snmp4j.Snmp;
    import org.snmp4j.event.ResponseEvent;
    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.VariableBinding;
    import org.snmp4j.transport.DefaultUdpTransportMapping;
    import org.snmp4j.util.DefaultPDUFactory;
    import org.snmp4j.util.TableEvent;
    import org.snmp4j.util.TableUtils;
    public class MySNMP
          *  Class variable declarations
         PDU requestPDU = null;
         Snmp snmp = null;
         CommunityTarget target = null;
         String responseString = null;
          *  Main method; point of execution start.
         public static void main(String[] args) throws IOException
                   snmpUtils obj = new snmpUtils("XX.XX.XX.XX", "public", 1, 1500);
                   String arrGet = obj.snmpGet(".1.3.6.1.2.1.1.1.0");
                   System.out.println("\nGET RESPONSE");
                   System.out.println(arrGet);
                   String arrGetNext = obj.snmpGetNext(".1.3.6.1.2.1.1.1.0");
                   System.out.println("\nGETNEXT RESPONSE");
                   System.out.println(arrGetNext);
                   String[] arr = { ".1.3.6.1.2.1.2.2.1.1.", ".1.3.6.1.2.1.2.2.1.5" };
                   String arrGetTable = obj.snmpGetTable(arr);
                   System.out.println("\nGETTABLE RESPONSE");
                   System.out.println(arrGetTable);
          *  Parameterized constructor
         public MySNMP(String IP, String commString, int version, long timeout)
              // Create an instance of the Snmp class, CommunityTarget class
              try
                   snmp = new Snmp(new DefaultUdpTransportMapping());
              catch (IOException e)
                   e.printStackTrace();
              target = new CommunityTarget();
              Address targetAddress = GenericAddress.parse("udp:" + IP + "/161");
              // Set the address of the target device; This is a mandatory value to be passed by the calling script
              target.setAddress(targetAddress);
               *  Set the version of the target device;
               *  In cases where the version provided is not 1,2 or 3, the default value set is 1 
              if (version == 1)
                   target.setVersion(SnmpConstants.version1);
              else if (version == 2)
                   target.setVersion(SnmpConstants.version2c);
              else if (version == 3)
                   target.setVersion(SnmpConstants.version3);
              // Set the timeout of the target device
              target.setTimeout(timeout);
               *  Set the community string of the target device;
               *  In cases where the community string provided is not null, the default value is set as "public" 
              if (commString == null)
                   target.setCommunity(new OctetString("public"));
              else
                   target.setCommunity(new OctetString(commString));          
          *  SNMP get/getNext operation logic
         public void get(String oid, int pduType) 
              // Create a PDU with the OID and type
              requestPDU = new PDU();
              requestPDU.add(new VariableBinding(new OID(oid)));
              requestPDU.setType(pduType);
              ResponseEvent response = null;
              try
                   // Invoke the listen() method on the Snmp object
                   snmp.listen();
                   // Send the PDU constructed, to the target
                   response = snmp.send(requestPDU, target);
              catch (IOException e)
                   e.printStackTrace();
              // Retrieve the response details and put into an array called "responseArray"
              responseString = new String();
              if (!(response.getResponse() == null))
                   //Extract the response
          *  SNMP GET method API
         public String snmpGet(String oid)
              get(oid, PDU.GET);
              return(responseString);          
          *  SNMP GETNEXT method API
         public String snmpGetNext(String oid) throws IOException
              get(oid, PDU.GETNEXT);
              return(responseString);     
          *  SNMP getTable operation
         public String snmpGetTable(String[] oid)
              // Invoke the listen() method on the Snmp object
              try
                   snmp.listen();
              catch (IOException e)
                   e.printStackTrace();
              // Create a TableUtils
              TableUtils utils = new TableUtils(snmp, new DefaultPDUFactory());
              // Set the lower/upper bounds for the table operation
              OID lowerIndex = null;
              OID upperIndex = null;
              // Create an array of the OID's that need to be checked
              OID[] arr = new OID[oid.length];
              for (int i=0; i<oid.length; i++)
                   arr[i] = new OID(oid);
              // Transfer output to a data structure
              List list = utils.getTable(target, arr, lowerIndex, upperIndex);
              // Dump the response into an array called "responseArray"
              return responseString;

    Hi
    I did some changes in the code and i invoked this for many times it still gives some response to me.
    This program is not hanging.
    import java.io.IOException;
    import java.util.List;
    import org.snmp4j.CommunityTarget;
    import org.snmp4j.PDU;
    import org.snmp4j.Snmp;
    import org.snmp4j.event.ResponseEvent;
    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.VariableBinding;
    import org.snmp4j.transport.DefaultUdpTransportMapping;
    import org.snmp4j.util.DefaultPDUFactory;
    import org.snmp4j.util.TableUtils;
    public class MySNMP
          *  Class variable declarations
         PDU requestPDU = null;
         Snmp snmp = null;
         CommunityTarget target = null;
         String responseString = null;
         public MySNMP()
          *  Main method; point of execution start.
         public static void main(String[] args) throws IOException
                   //SnmpUtils obj = new SnmpUtils("XX.XX.XX.XX", "public", 1, 1500);
                for(int i = 0; i < 10; i++)
                  MySNMP obj = new MySNMP("MY_IP","public",1,1000);
                   String arrGet = obj.snmpGet(".1.3.6.1.2.1.1.1.0");
                   System.out.println("\nGET RESPONSE");
                   System.out.println(arrGet);
                   String arrGetNext = obj.snmpGetNext(".1.3.6.1.2.1.1.1.0");
                   System.out.println("\nGETNEXT RESPONSE");
                   System.out.println(arrGetNext);
                   String[] arr = { ".1.3.6.1.2.1.2.2.1.1.", ".1.3.6.1.2.1.2.2.1.5" };
                   String arrGetTable = obj.snmpGetTable(arr);
                   System.out.println("\nGETTABLE RESPONSE");
                   System.out.println(arrGetTable);
          *  Parameterized constructor
         public MySNMP(String IP, String commString, int version, long timeout)
              // Create an instance of the Snmp class, CommunityTarget class
              try
                   snmp = new Snmp(new DefaultUdpTransportMapping());
              catch (IOException e)
                   e.printStackTrace();
              target = new CommunityTarget();
              Address targetAddress = GenericAddress.parse("udp:" + IP + "/161");
              // Set the address of the target device; This is a mandatory value to be passed by the calling script
              target.setAddress(targetAddress);
               *  Set the version of the target device;
               *  In cases where the version provided is not 1,2 or 3, the default value set is 1 
              if (version == 1)
                   target.setVersion(SnmpConstants.version1);
              else if (version == 2)
                   target.setVersion(SnmpConstants.version2c);
              else if (version == 3)
                   target.setVersion(SnmpConstants.version3);
              // Set the timeout of the target device
              target.setTimeout(timeout);
               *  Set the community string of the target device;
               *  In cases where the community string provided is not null, the default value is set as "public" 
              if (commString == null)
                   target.setCommunity(new OctetString("public"));
              else
                   target.setCommunity(new OctetString(commString));          
          *  SNMP get/getNext operation logic
         public void get(String oid, int pduType) 
              // Create a PDU with the OID and type
              requestPDU = new PDU();
              requestPDU.add(new VariableBinding(new OID(oid)));
              requestPDU.setType(pduType);
              ResponseEvent response = null;
              try
                   // Invoke the listen() method on the Snmp object
                   snmp.listen();
                   // Send the PDU constructed, to the target
                   response = snmp.send(requestPDU, target);
              catch (IOException e)
                   e.printStackTrace();
              // Retrieve the response details and put into an array called "responseArray"
              PDU responsePdu = response.getResponse();
              if(responsePdu.getErrorStatus() == 0)
                   responseString = responsePdu.toString();
              else
                   System.out.println("ERROR");
              if (!(response.getResponse() == null))
                   //Extract the response
          *  SNMP GET method API
         public String snmpGet(String oid)
              get(oid, PDU.GET);
              return(responseString);          
          *  SNMP GETNEXT method API
         public String snmpGetNext(String oid) throws IOException
              get(oid, PDU.GETNEXT);
              return(responseString);     
          *  SNMP getTable operation
         public String snmpGetTable(String[] oid)
              // Invoke the listen() method on the Snmp object
              try
                   snmp.listen();
              catch (IOException e)
                   e.printStackTrace();
              // Create a TableUtils
              TableUtils utils = new TableUtils(snmp, new DefaultPDUFactory());
              // Set the lower/upper bounds for the table operation
              OID lowerIndex = null;
              OID upperIndex = null;
              // Create an array of the OID's that need to be checked
              OID[] arr = new OID[oid.length];
              for (int i=0; i<oid.length; i++)
                   arr[i] = new OID(oid);
              // Transfer output to a data structure
              List list = utils.getTable(target, arr, lowerIndex, upperIndex);
              // Dump the response into an array called "responseArray"
              return responseString;

Maybe you are looking for

  • Computer idiot at the end of his rope

    Hi. I know that this question has probably been posted a million different ways already, but I'm desperate. I anticipate getting an ipod here soon and I cannot get itunes to work on my computer! I tried to upgrade my itunes b/c it said an update was

  • ISE 1.1.3 Guest portal (Web redirection) what worked for me !!!

    Hello, this document lead to multiple failure !!!! http://www.cisco.com/en/US/products/ps11640/products_configuration_example09186a0080ba6514.shtml This guy really helps !!! https://www.youtube.com/watch?v=TW2ZJVIZ8bs See attached screen captures. IS

  • H264 Export Problems

    I'm trying to export a slideshow from ProShow Producer to my Apple TV. When I export from Producer using the standard "Export for Device - Apple TV" then the audio (music & sounds) don't synch correctly with the slides. Depending on the length of the

  • How can I turn the metronome off during playback on version 2.0.6 (iphone 5)?

    The triangle-like icon allows me turn metronome on and off for recording, but I cannot get it to turn off during playback if I use it during recording.  The Dial in the upper right allows me to turn off the "Count-In," and change the sound, but no op

  • NFC & Sony RC-S380 - No Tag Detected Events

    Building a retail kiosk using a modern app that needs NFC tag support. I have the external Sony RC-S380 NFC reader/writer and it shows up on my laptop as a Proximity device.  Calling ProximityDevice.GetDefault(); returns the device, but the DeviceArr