-1

I wrote an application to know the status of the router. Using the program I can able to check one status using by one request. But i want to know multiple status using one request. Is it possible? Could please help? Please see the code

This code will give only one status per request.

        InetAddress hostAddress = InetAddress.getByName("**.**.**.**");
        String community = "public";
        int version = 1 / 0; // SNMPv1

        SNMPv1CommunicationInterface comInterface =
                new SNMPv1CommunicationInterface(version, hostAddress,
                        community);
        String itemID = "1.3.6.1.2.1.43.11.1.1.9";
        SNMPVarBindList newVars = comInterface.getMIBEntry(itemID);
Lex Li
  • 60,503
  • 9
  • 116
  • 147
stacktome
  • 790
  • 2
  • 9
  • 32
  • Many Thanks @pp .But each and every request i need to call SNMPVarBindList newVars = comInterface.getMIBEntry(itemID); i dont want to call each and every time. i want to send as bundle. – stacktome Jun 27 '13 at 11:06
  • As there are many Java SNMP APIs, you should make it clear which one you are using, snmp4j or any other. – Lex Li Jun 28 '13 at 10:38
  • @Lex Li I'm using snmp4j-2.2.1.jar and SNMPInquisitor.jar – stacktome Jun 28 '13 at 11:38

1 Answers1

0

If you use http://gicl.cs.drexel.edu/people/sevy/snmp/snmp_inquisitor.html, then you should make sure you have read its documentation carefully,

http://gicl.cs.drexel.edu/people/sevy/snmp/docs/snmp/SNMPv1CommunicationInterface.html

SNMPVarBindList getMIBEntry(java.lang.String[] itemID) obviously can help you grab a bunch of variables at the same time, as it is capable of

Retrieve the MIB variable values corresponding to the object identifiers given in the array itemID (in dotted-integer notation).|

Lex Li
  • 60,503
  • 9
  • 116
  • 147