Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
SnmpSet.java.txt
Package: AdventNetSNMPAPI_4.zip [view]
Upload User: aonuowh
Upload Date: 2021-05-23
Package Size: 35390k
Code Size: 1k
Category:
SNMP
Development Platform:
C/C++
- /*$Id: SnmpSet.java,v 1.1 2002/06/15 14:41:18 ram Exp $*/
- /*
- * @(#)SnmpSet.java
- * Copyright (c) 1996-2001 AdventNet, Inc. 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 change the value of sysName in the localhost's RFC1213-MIB using
- * com.adventnet.snmp.beans package of AdventNetSNMP API.
- *
- */
- import com.adventnet.snmp.beans.*;
- public class SnmpSet {
- 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.1.5")
- //load MIBs
- target.loadMibs("RFC-1213MIB");
- // perform a SET request
- String result = target.snmpSet("testing..");
- if (result == null)
- {
- System.err.println("Request failed or timed out. n"+
- target.getErrorString());
- }
- else
- {
- // print the values
- System.out.println("OBJECT ID: "+target.getObjectID()); System.out.println("Response: "+result);
- }
- System.exit(0);
- }
- }