ModifyTable.java.txt
Upload User: aonuowh
Upload Date: 2021-05-23
Package Size: 35390k
Code Size: 1k
Category:

SNMP

Development Platform:

C/C++

  1. /* $Id: ModifyTable.java,v 1.1 2002/06/15 14:41:18 ram Exp $ */
  2.  * 
  3. /* ModifyTable.java * Copyright (c) 1996-2003 AdventNet, Inc. All Rights Reserved.
  4.  * Please read the associated COPYRIGHTS file for more details.
  5.  */
  6.  *
  7.  *
  8.  */
  9. import com.adventnet.snmp.beans.*;
  10. public class ModifyTable {
  11. public static void main(String args[]) {
  12. if (args.length < 1)
  13. {
  14. System.out.println ("Usage : java SnmpGetTable tableoid");
  15. System.exit (0);
  16. }
  17. String tableoid = args[0];
  18. SnmpTable table = new SnmpTable();
  19. table.setTargetHost("localhost);
  20. try 
  21. {
  22. table.loadMibs("RFC1213-MIB");
  23. table.setTableOID(tableoid);
  24. }
  25. catch (Exception ex) 
  26. {
  27. System.err.println("Error: "+ex);
  28. }
  29. //change the value of 4th row 2nd column to "newvalue"
  30. table.setValueAt("newvalue", 3,1); 
  31. System.exit(0);
  32. }
  33. }