[unisog] getting the Arp Table from a router whit Java API or C application
fuat at columbia.edu
Tue Apr 11 17:51:33 GMT 2006
You can't do a GetRequest on a table OID. To get objects from a
table you'll need to "walk" the table by doing a series of
GetNextRequests on one or more columns of the table that you're
Do a google of "GetNextRequest" and read some of the hits you'll
get. They describe the concept.
On Apr 11, 2006, at 5:30 AM, stefano wrote:
> Hi, sorry for my bad english, i know this and i'm working for make
> it better.. but here come the question: I've known this mailing
> list reading the previous thread talking about this argument
> (Getting ARP tables from Cisco switches via snmp -- slightly OT )
> after a search on google..
> I've to develop an identical application (that insert in a DB the
> MAC, the IP and if is possible the Switch port number..) but i've a
> condiction, i've to develop this using a java server, not one linux
> commands or application (not , but max portability, because some
> servers are Windows and some are Unix, therefore i can't use
> smnpwalk or arptrace!! ) i must to realize this operation whit
> JavaAPIs or whit portable a source code as a C code.
> I've downloaded the Adventnet java SNMP API package, and i can get
> a variable from the MIB for example the OID 18.104.22.168.22.214.171.124.0
> return to me the string value "Cisco Internetwork Operating System
> Software \r\nIOS (tm) RSP Software (RSP-JSV-M), Version 12.0(9),
> RELEASE SOFTWARE (fc1)\r\nCopyright (c) 1986-2000 by cisco Systems,
> Inc.\r\nCompiled Mon 24-Jan-00 23:15 by bettyl" then i can deduce
> that the APIs work fine. But if i try to get a table, i recive a
> null pointer, and i don't know how i can do this operation correctly.
> anyone can help me?
> here there is the bad test code working only with a single MIB
> public static void openSNMPSession() throws Exception
> SnmpAPI api = new SnmpAPI();
> SnmpSession session = new SnmpSession(api);
> SnmpPDU pdu = new SnmpPDU();
> pdu.addNull(new SnmpOID(".126.96.36.199.188.8.131.52")); //doesn't work
> //pdu.addNull(newSnmpOID(".184.108.40.206.220.127.116.11.0 ")); work
> SnmpPDU response_pdu = session.syncSend(pdu);
> if(response_pdu == null)
> System.out.println("The Request has timed out.");
> System.out.println("Errors: "+response_pdu.getError());
> System.out.println("Account: "+response_pdu.getCommunity
> ()+"\n Ver "+response_pdu.getVariable(10));
> unisog mailing list
> unisog at lists.sans.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the unisog