/*$Id: SnmpGetBulk.java,v 1.1 2002/06/15 14:41:18 ram Exp $*/ /* * @(#)SnmpGetBulk.java * Copyright (c) 2012 ZOHO Corp. All Rights Reserved. * Please read the associated COPYRIGHTS file for more details. */ /** * This is an example program to explain how to write an application * to retrieve information about the atTable entries * in the localhost's RFC1213-MIB using * com.adventnet.snmp.beans package of WebNMS SNMP API. * */ import com.adventnet.snmp.beans.*; public class SnmpGetBulk { public static void main(String args[]) { // instantiate SNMP target bean SnmpTarget target = new SnmpTarget(); // set the host in which the SNMP agent is running target.setTargetHost("localhost"); // set the OID target.setObjectID(".1.3.6.1.2.1.3.1") // perform a GETBULK request String result = target.snmpGetBulkList(); if (result == null) { System.err.println("Request failed or timed out. \n"+ target.getErrorString()); } else { // print the values System.out.println("Response received. Value:" + result); } System.exit(0); } }