Free Essay

Snmp Tool Usage

In:

Submitted By arunkannang
Words 5569
Pages 23
I R E A S O N I N G

S N M P

L I B R A R Y

iReasoning SNMP API User Guide

Copyright © 2002-2014 iDeskCentric Inc., All Rights Reserved. The information contained herein is the property of iDeskCentric Inc. This document may not be copied, reproduced, reduced to any electronic medium or machine readable form, or otherwise duplicated, and the information herein may not be used, disseminated or otherwise disclosed, except with the prior written consent of iDeskCentric Inc.

I R E A S O N I N G

S N M P

L I B R A R Y

Table of Contents
INTRODUCTION....................................................................................................................................................................................................................1 About this document ................................................................................................................................................................................................................1 Target Audience .......................................................................................................................................................................................................................1 INSTALLATION .....................................................................................................................................................................................................................2 Requirements............................................................................................................................................................................................................................2 Installation Procedures ............................................................................................................................................................................................................2 USING iREASONING SNMP LIBRARY ...............................................................................................................................................................................4 Overview and Architecture.......................................................................................................................................................................................................4 UML diagram ........................................................................................................................................................................................................................7 Configuration...........................................................................................................................................................................................................................8 Logger configuration ..........................................................................................................................................................................................................8 Usage examples........................................................................................................................................................................................................................8 SnmpSession class ...............................................................................................................................................................................................................8 Synchronous SNMP Operations ........................................................................................................................................................................................9 Asynchronous SNMP Operations ....................................................................................................................................................................................10 SNMP Table Retrieval......................................................................................................................................................................................................11 SnmpTrapdSession class...................................................................................................................................................................................................12 SnmpTrapSender class .....................................................................................................................................................................................................13 SnmpPoller class .................................................................................................................................................................................................................13 Java Applet Example ........................................................................................................................................................................................................14 FAQ........................................................................................................................................................................................................................................15 RESOURCES AND REFERENCE.......................................................................................................................................................................................19 GLOSSARY OF TERMS .......................................................................................................................................................................................................20

I R E A S O N I N G

S N M P

L I B R A R Y

INTRODUCTION
About this document he purpose of this document is to provide the reader with enough knowledge to start developing software using the iReasoning's SNMP toolkit. Some examples are provided to better illustrate the usage of APIs. This document is not intended to provide detailed information about the SNMP APIs. To effectively use the APIs, readers need to refer to javadoc help that has detailed instructions and examples. The iReasoning SNMP API is a Java toolset that greatly simplifies the development of applications for managing SNMP agents. It provides full support for SNMPv1, SNMPv2c and SNMPv3. The design and implementation of this library were based on object-oriented methodology and followed recognized design patterns. These advantages, combined with a highly optimized code base, make iReasoning SNMP library stand out from the competition.

T

Target Audience
This document is intended for users and engineers who are responsible for developing SNMP based management applications. A user of this software does not have to be an expert in network management field. He or she should, however, be familiar with basic SNMP concepts, such as SNMP GET and GET_NEXT operations. Some basic knowledge about Java language is required to understand examples. This software is designed to minimize the learning curve for users and achieve a given programming job with less code. A new user should therefore find it quite easy to learn and master this product.

I R E A S O N I N G

S N M P

L I B R A R Y

Chapter

2
INSTALLATION
Requirements
JDK1.2 or a later version must be installed. You can download JDK from the SUN's web site (http://java.sun.com/j2se/ ) At least 32MB memory is required

Installation Procedures
Download and unzip Download iReasoning SNMP library and unzip it to the desired directory, for example, C:\lib\iReasoning\snmp The directory structure will look like this: Directory Name lib javadoc examples config

Description contains binary jar files contains javadoc HTML files contains examples source code configuration files

I R E A S O N I N G

S N M P

L I B R A R Y

Set up CLASSPATH ireasoningsnmp.jar needs to be added to CLASSPATH environment variable. On Windows: If the iReasoning SNMP library is installed at C:\lib\iReasoning\snmp, use the command set CLASSPATH=C:\lib\iReasoning\snmp\lib\ireasoningsnmp.jar;%CLASSPATH%

On Unix/Linux: If iReasoning SNMP is installed at /usr/local/ireasoning/snmp, use the command
CLASSPATH=/usr/local/ireasoning/snmp/lib/ireasoningsnmp.jar ; export CLASSPATH

Run example program (Optional) Example code is located at examples/snmp directory. They were precompiled and jarred into lib/examples.jar. To verify that everything is working, you can follow the following steps to run the example programs. 1) Add examples.jar to CLASSPATH. Take similar step, for instance, On Windows: set CLASSPATH=C:\lib\iReasoning\snmp\lib\examples.jar;%CLASSPATH% (assuming examples.jar is located at C:\lib\iReasoning\snmp\lib\)

On Unix/Linux
CLASSPATH /usr/local/ireasoning/snmp/lib/examples.jar ; export CLASSPATH (assuming examples.jar is located at /usr/local/ireasoning/snmp/lib/ )

2) Run java snmpgetnext hostname .1.3 (Retrieve the first SNMP variable) where hostname is the host name or IP address of an snmp agent. If you do not have an snmp agent, you can run snmpd.exe (on Windows) to start an agent listening on port 161. Or you can use runexample.bat script to run examples on Windows.

I R E A S O N I N G

S N M P

L I B R A R Y

Chapter

3
USING iREASONING SNMP LIBRARY
Overview and Architecture
The iReasoning SNMP library is designed and implemented using object oriented methodology and recognized design patterns. One of its design goals was to minimize the learning curve of SNMP library for developers. Users only need to know a few classes, most of complex works are hidden from them. All versions of SNMP (SNMPv1, SNMPv2c and SNMPv3) are supported in one library, and users do not have to learn the detailed underlying differences between three SNMP versions. Users can always use a unified interface to access SNMP agents speaking different SNMP protocols. The example code shipped with this product clearly demonstrates the simplicity of this library. In those code, at first glance, users will realize how simple it is to write code to communicate with SNMP agents. The central class is the SnmpSession. It provides all the necessary mechanism to use SNMP operations. A session represents a communication channel between an SNMP manager and an agent. To communicate with multiple agents, multiple sessions have to be created. Each session is corresponding to each communication channel. A session needs to be created and then a connection needs to be established with the agent. After session is initialized, you are ready to issue SNMP commands against the agent. There are four basic SNMP operations: GET, GET_NEXT, SET, GET_BULK (SNMPv2c and SNMPv3). They are represented in SnmpSession class as snmpGetRequest, snmpGetNextRequest, snmpSetRequest, snmpGetBulkRequest methods. High-level SNMP operations, such as GET_TABLE and WALK, are represented as snmpGetTable and snmpWalk methods. When a session is no longer needed, it needs to be closed to avoid resource leak.

I R E A S O N I N G

S N M P

L I B R A R Y

SnmpTrapdSession class is provided for creating trap receiver programs. A trapd session can be created and then waits for traps sent by agents. This session is able to understand all the SNMPv1, SNMPv2c and SNMPv3 traps. Both synchronous and asynchronous requests are supported in SnmpSession. When sending synchronous requests, the session can only send one request at a time. It must block and wait for the reply to the request before issuing next one. This mode is easier to understand and implement. When using asynchronous requests, the session does not need to wait for each reply. In this case, a session has a thread handling the replies and notifying callers when replies arrive. SNMP data types are represented as child classes of SnmpDataType class. The remote agent is represented as the SnmpTarget class. Each agent is represented by a single SnmpTarget object. An SnmpTarget can be instantiated with the IP address (or host name) and port number of the remote agent. Other properties of agent, such as community name, can also be specified. The class diagram is shown in figure 1. For detailed information about classes, you can refer to the javadoc files shipped with this library. The SNMP protocol uses UDP as the default transport layer protocol. UDP is connectionless and the delivery of packets is not guaranteed, but it is an efficient way to transport small amount of data. The iReasoning SNMP API architecture also supports TCP besides UDP. SNMP over TCP is a good fit for transferring large amount of data. The built-in features of TCP, such as flow control and efficient segmentation, make TCP perform better than UDP in this case. The agent has to be able to support SNMP over TCP so that the SNMP manager can choose TCP as an underlying transport layer protocol.

I R E A S O N I N G

S N M P

L I B R A R Y

A MIB parser utility is also included in the library. MibUtil class can be used to parse MIBs and resolve OID and variable binding’s value. It can look up MIB node name from OID value as well. MibUtil’s parseMib method can parse MIB and return a tree data structure. Here is an output from mibparser.java sample code, which illustrates how to use MIB parser.

I R E A S O N I N G

S N M P

L I B R A R Y

UML diagram
Session -target : Trarget +getState() : int #open(in target : Trarget) +close() 1 1 Trarget -host : String -port : int

SnmpSession -snmpTarget : SnmpTarget +send(in pdu : SnmpPdu) : SnmpPdu +snmpGet(in oid : SnmpOID) : SnmpPdu +snmpGetNext(in oid : SnmpOID) : SnmpPdu +snmpGetBulk(in pdus : SnmpOID[], in nonRepeaters : int, in maxRepetitions : int) : SnmpPdu +snmpSet() * SnmpPdu SnmpDataType +getType() : int +getTypeString() : String +copy() : SnmpDataType *

SnmpTrapdSession +waitForTrap() : SnmpDataType SnmpTarget -community : String 1 1

1 1

*

1

SnmpVarBind 11

SnmpOID

SnmpUInt

SnmpCounter64

SnmpInt

SnmpOctetString

SnmpNull

SnmpGauge32

SnmpCounter32

SnmpTimeTicks

SnmpIpAddress

SnmpOpaque

Figure 1. iReasoning SNMP library class diagram

I R E A S O N I N G

S N M P

L I B R A R Y

Configuration
Config files are located at ./config directory by default. You can add a java environment variable to set a new config directory. For example: java -Dcom.ireasoning.configDir=d:\config … In this example “d:\config” is the new config directory.

Logger configuration
The iReasoning SNMP library has a built-in logger. The logger is configurable through the Logger.prop file located at ./config directory. You can change the logging level or just disable the logger. The output of logging message is also configurable. It can be system’s standard out or file. Check out Logger.prop for detailed information. The popular open source log4j package is also supported. To switch to log4j logger, you just need to add one line of code in the beginning of your program: com.ireasoning.util.Logger.setUseLog4j(true); If using log4j, the Logger.prop will no longer be used. You need to configure the log4j logger or provide a config file for it. You can still use the log methods in the Logger class to log messages, then they will be delegated to corresponding methods in log4j logger.

Usage examples
In your source file, you need to import the following iReasoning SNMP packages: import com.ireasoning.protocol.*; import com.ireasoning.protocol.snmp.*;

SnmpSession class
The core class of iReasoning SNMP library is SnmpSession class. It represents a communication channel between an SNMP manager and an agent. Similar to other communication classes, it needs remote host name and port number so it can connect to the remote agent, and the channel needs to be closed after it is finished. This class provides necessary methods to do SNMP queries, such as SNMP GetRequest, GetNextRequest, SetRequest, InformRequest, GetTable, and Walk. The lowest level method is "public SnmpPdu send(SnmpPdu pdu)",

I R E A S O N I N G

S N M P

L I B R A R Y

which encodes and sends out SnmpPdu object to the agent. The request methods, such as snmpGetRequest, snmpGetNextRequest etc., use “send(SnmpPdu pdu)” method internally to do the job. So if in some cases you find the higher-level methods cannot meet your needs, you can use send method directly. The snmpget.java and snmpgetnext.java demonstrate how to use that method. But in most cases, it is recommended to use higher-level methods to reduce the chance of programming mistakes.

Synchronous SNMP Operations
SNMP manager application sends out a synchronous SNMP request to an agent and blocks until response comes back. Usually, synchronous operations are easier to program than asynchronous operations. Synchronous operations in SnmpSession class include snmpGetRequest, snmpGetNextRequest, snmpGetBulkRequest, and snmpGetTable, etc. The following is a simple example on how to use SnmpSession class to do synchronous SNMP GetRequest.
1. SnmpTarget target = new SnmpTarget(host, port, readCommunity, 2. writeCommunity, version); 3. SnmpSession session = new SnmpSession(target); 4. if(isSnmpV3) 5. { 6. session.setV3Params(user, authProtocol, 7. authPassword, privPassword); 8. } 9. 10. SnmpPdu retPdu = session.snmpGetRequest(oids); //send out get request 11. 12. System.out.println(retPdu); 13. session.close();

In this example, it creates an SnmpTarget object that represents a remote agent. An SnmpSession object is created next with the SnmpTarget object. If remote agent only supports SNMPv3, additional information has to be provided. Then we call snmpGetRequest method of SnmpSession class to send out the request to the agent. Check out snmpget.java, snmpgetnext.java, snmpgetbulk.java, snmpwalk.java, and snmpgettable.java (in ./examples/snmp/) for complete implementation examples. SnmpSession.snmpGetRequest and other methods also take MIB node name besides numerical OID. However you need to call loadMib method beforehand to load corresponding MIB files first, then SnmpSession can translate name into numerical OID.

I R E A S O N I N G

S N M P

L I B R A R Y

Asynchronous SNMP Operations
SnmpSession class provides several asynchronous SNMP operation methods, such as asyncSnmpGetRequest, and asyncSnmpGetNextRequest, etc. Compared with synchronous SNMP operations, asynchronous SNMP operations can send out more SNMP requests in the same amount of time because SnmpSession is not blocked waiting for responses. To receive responses, we need a class implementing Listener interface, therefore “handleMsg(Object session, Msg msg)” method will be called when a response is received. The following is a simple example on how to use SnmpSession class to do asynchronous SNMP GetRequest.
1. SnmpTarget target = new SnmpTarget(host, port, readCommunity, 2. writeCommunity, version); 3. SnmpSession session = new SnmpSession(target); 4. if(isSnmpV3) 5. { 6. session.setV3Params(user, authProtocol, 7. authPassword, privPassword); 8. } 9. session.addListener(this); 10. session.asyncSnmpGetRequest(oids); 11. ... 12. //In a class implementing Listener interface 13. public void handleMsg(Object session, Msg msg) 14. { // received a pdu 15. SnmpPdu pdu = (SnmpPdu) msg; 16. print(pdu); 17. }

In this example, it creates an SnmpTarget object that represents a remote agent. An SnmpSession object is created next with the SnmpTarget object. If remote agent only supports SNMPv3, additional information has to be provided. A listener needs to be registered with this session, so when this session receives a response, listener’s handleMsg method will be invoked. Then we call asyncSnmpGetRequest method of SnmpSession class to send out the request to the agent. It returns immediately after PDU is sent, unlike synchronous methods that block until response comes back. Check out snmpasyncget.java (in ./examples/snmp/) for complete implementation examples.

I R E A S O N I N G

S N M P

L I B R A R Y

SNMP Table Retrieval
SnmpSession class provides a useful method to retrieve a whole MIB table.
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. SnmpSession session = new SnmpSession(host, port, community, community, version); if(isSnmpV3) { session.setV3Params(user, authProtocol, authPassword, privPassword); } SnmpSession.loadMib2();//load MIB-II SnmpTableModel table = session.snmpGetTable(“ifTable”); for (int i = 0; i < table.getRowCount() ; i++) { print(table.getRow(i)); }

In this example, MIB-II is loaded by calling loadMib2 method. Then we can use snmpGetTable method with MIB node name “ifTable” to retrieve whole table. Table information is stored in SnmpTableModel object. SnmpTableModel implements Swing’s TreeModel interface, so it can be easily used to create a JTable component. The following is a screenshot of tcpConnTable retrieval (result of running snmpgettable.java example that is bundled with this product).

SnmpSession also provides snmpGetTableColumn method to retrieve a specific column of a table.

I R E A S O N I N G

S N M P

L I B R A R Y

SnmpTrapdSession class
SNMP traps are initiated by agent or manager signaling changes or alarms occurred. This class is a daemon session that can be easily used to create SNMP trap receiver. Trap version contained in the UDP packet can be automatically figured out, so it can understand all types of trap. The following is a simple example on how to use SnmpTrapdSession class to create a trap receiver.
1. SnmpTrapdSession session = new SnmpTrapdSession(port); 2. if(isSnmpV3) 3. { 4. session.addV3Params(user, authProtocol, authPassword, 5. privPassword, trapSenderEngineID); 6. 7. } 8. //register with session, so handleMsg will be called when trap comes 9. session.addListener(this); 10. //blocks and wait for trap 11. session.waitForTrap(); 12. ... 13. public void handleMsg(Object msgSender, Msg msg) 14. { 15. System.out.println((SnmpDataType)msg); 16. }

The first line of code creates an SnmpTrapdSession listening on a certain port number. Additional information is needed if it expects SNMPv3 traps. Line 9 registers for trap event, so handleMsg will be called when a trap arrives. Line 11 blocks and waits for traps. Line 13-16 is a callback method that prints out received traps. Check out snmptrapd.java for a complete implementation.

I R E A S O N I N G

S N M P

L I B R A R Y

SnmpTrapSender class
This class can be used to send out all three versions of SNMP traps. Although SnmpSession class also can be used to send out trap if properly configured, it is much easier to do it using this class instead. Here is a simple example demonstrating sending out SNMPv1 traps.
1. 2. 3. 4. 5. SnmpTrapSender trapSender = new SnmpTrapSender(); SnmpV1Trap trap = new SnmpV1Trap(enterprise); trap.setTimeStamp(sysUpTime); trap.setGeneric(code); trapSender.sendTrap(host, port, trap, community);

Line 1 creates an SnmpTrapSender class. Line 2 to 4 form an SnmpTrap object. Line 5 sends out the trap to the destination. Check out snmptrap.java for a complete implementation.

SnmpPoller class
This class can send out SNMP GetRequest and GetNextRequest to agents periodically. The interval is configurable. Here is a simple example demonstrating using SnmpPoller class.
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. ... ... 12. public void handleMsg(Object sender, Msg msg) 13. { 14. SnmpPdu pdu = (SnmpPdu) msg; 15. print(pdu); 16. } SnmpTarget target = new SnmpTarget(host, port, community, community, version); SnmpSession session = new SnmpSession(target); if(isSnmpV3) { session.setV3Params(user, authProtocol, authPassword, privPassword); } SnmpPoller poller = new SnmpPoller(session); poller.addListener(this); poller.snmpGetNextPoll(oids, interval);

I R E A S O N I N G

S N M P

L I B R A R Y

Line 1 to 8 create an SnmpSession and open a connection to the remote agent. Line 9 creates an SnmpPoller class using the just created SnmpSession object. Line 10 registers itself with the SnmpPoller object, so its handleMsg method will get called if SnmpPoller finishes a request. Line 11 starts the poller and tells poller to send GetNextRequest to the agent at specified intervals. Check out snmppoll.java example for a complete implementation.

Java Applet Example
Java code and HTML files are located at examples/snmp/applet. This example shows how to retrieve agent information within a java applet. Because of security restrictions of Java applet, the snmp agent and the web server have to be running on the same machine.

I R E A S O N I N G

S N M P

L I B R A R Y

FAQ
Q. What is iReasoning SNMP API? A. iReasoning SNMP API is the industry leading SNMP library, which provides a high performance, cross platform Java API for building network management applications. All SNMP versions (SNMPv1, SNMPv2c and SNMPv3) are fully supported. It is written in Java, and designed from the ground up to support all SNMP versions. There is no legacy code which only for a certain version of SNMP protocol. All code base are highly optimized to maximize performance and minimize overhead. Q. What're the advantages of iReasoning SNMP API over its competitors? A. Here are just some of the advantages over our competitors.


• • • • • •

Ease of use. You can take a look at the example code, such as snmpgetnext.java or snmpwalk.java , to see how easy to implement SNMPv1/v2c/v3 operations High performance. All code bases are highly optimized to maximize performance and minimize overhead The first Java SNMP product to support both DES and strong 128-bit AES encryption algorithms Support all SNMP versions (SNMPv1, SNMPv2c, SNMPv3) Conform to the EJB specification Robust and powerful SMIv1/SMIv2 MIB parser Support both UDP and TCP transport layers

Q. Do SNMP security vulnerabilities reported by CERT affect iReasoning SNMP API? A. The Finland Oulu University Secure Programming Group ( OUSPG) discovered numerous vulnerabilities in SNMP implementation from many different vendors. Vulnerabilities in the decoding and subsequent processing of SNMP messages by both managers and agents may result in unauthorized privileged access, denial-of-service attacks, or cause unstable behavior. iReasoning has investigated how these vulnerabilities may impact our SNMP library and has found the following results:




VU#107186 - Multiple vulnerabilities in SNMPv1 trap handling SNMP trap messages are sent from agents to managers. A trap message may indicate a warning or error condition or otherwise notify the manager about the agent's state. SNMP managers must properly decode trap messages and process the resulting data. In testing, OUSPG found multiple vulnerabilities in the way many SNMP managers decode and process SNMP trap messages. iReasoning SNMP library successfully passed all the 24100 tests in OUSPG test suite! We conclude this advisory does not affect iReasoning SNMP library. VU#854306 - Multiple vulnerabilities in SNMPv1 request handling SNMP request messages are sent from managers to agents. Request

I R E A S O N I N G

S N M P

L I B R A R Y

messages might be issued to obtain information from an agent or to instruct the agent to configure the host device. SNMP agents must properly decode request messages and process the resulting data. In testing, OUSPG found multiple vulnerabilities in the way many SNMP agents decode and process SNMP request messages. This advisory is not applicable to iReasoning SNMP library because it does not have SNMP agent functionality and does not accept SNMP request messages. Q. Does iReasoning SNMP API conform to the EJB specification? A. If asynchronous mode is not used, no thread is created. And EJB specification allows client side socket. So SNMP library conform to the EJB specification. However, if asyncSend method in SnmpSession is used, it creates a new thread and violates EJB specification. Asynchronous mode is not recommended to be used in enterprise java beans. SNMP libraries from other vendors create thread no matter which mode to use, they generally do not conform to EJB specification. Q. How do I get started with this library? A. First of all, a basic understanding of SNMP and Java is required. This user guide provides nice introduction and usage examples about this library. Then you can start with example code shipped with this product. Those example code clearly illustrates how to write simple programs to do SNMP GetRequest, GetNextRequest, Walk, etc. Example code is also integrated into javadoc help. So you can read them from browsers. You also need an SNMP agent to test with most of example code. If you do not have a agent for testing purpose, you can run the snmpd.exe on windows to start an SNMP agent listening on port 161. Q. Can I build an SNMP agent with iReasoning SNMP API? A. No. You can use iReasoning Agent Builder to build SNMP agent. iReasoning Agent Builder is a superset of SNMP API, it also provides tools for building agent. Q. Which versions of SNMP are supported by iReasoning SNMP library? A. iReasoning SNMP library support SNMPv1, SNMPv2c and SNMPv3. However if you only purchase license for iReasoning SNMPv2 library, SNMPv3 support is not included. Q. How's the SNMPv3 support? A. iReasoning SNMP library fully supports SNMPv3, including the complete VACM and USM security model (HMAC-MD5, HMAC-SHA, CBC-DES, CFB128-AES-128, CFB128-AES-192, CFB128-AES-256). It has successfully passed a number of interoperability tests with other SNMPv3 vendors and their SNMPv3 implementations. Now it is used as a de-facto reference SNMPv3 implementation for other implementers. Q. What is AES standard? And how does 128-bit AES encryption compare to DES? A. Excerpt from NIST (National Institute of Standards and Technology) website:

I R E A S O N I N G

S N M P

L I B R A R Y

"The Advanced Encryption Standard (AES) is a new Federal Information Processing Standard (FIPS) Publication that will specify a cryptographic algorithm for use by U.S. Government organizations to protect sensitive (unclassified) information. NIST also anticipates that the AES will be widely used on a voluntary basis by organizations, institutions, and individuals outside of the U.S. Government - and outside of the United States - in some cases. The AES is being developed to replace DES, but NIST anticipates that Triple DES will remain an approved algorithm (for U.S. Government use) for the foreseeable future. Single DES is being phased out of use, and is currently permitted in legacy systems, only. Assuming that one could build a machine that could recover a DES key in a second (i.e., try 255 keys per second), then it would take that machine approximately 149 thousand-billion (149 trillion) years to crack a 128-bit AES key. To put that into perspective, the universe is believed to be less than 20 billion years old." See "The AES Cipher Algorithm in the SNMP User-based Security Model" for more details on AES in SNMP. Q. How's the performance of your trap receiver program? A. In our test environment, the snmptrapd.java sample program can handle trap at about 2700 traps/second (which can be higher if trap sender can reach higher sending rate) on a Pentium III 700 machine with 512MB memory, it consistently receives all the traps, while some popular trap receivers cannot catch all of the traps. Q. How do I run example code? A.
1. Set up java classpath. For example: set classpath=lib\examples.jar;lib\ireasoningsnmp.jar (on windows, and assuming on a directory a level higher than lib) 2. Start an SNMP agent. You can run snmpd.exe on windows. 3. Run java snmpget -? to see the usage help. Run java snmpget localhost sysUpTime to get the sysUpTime value from the agent Then you can play with other example code.

Q. Is MIB parser included in your API? A. Yes. MibUtil.parseMib(String fileName) method can parse MIB file and return a data structure representing MIB tree. A sample code, mibparser.java, is included to illustrate the use of MIB parser. Q. Does your SNMP API support IPv6? A. Yes, if it's used with J2SDK/JRE 1.4. See "Networking IPv6 User Guide for J2SDK/JRE 1.4" for more information. As of JVM 1.4.2, supported operating systems are Solaris (ver 8 and up) and Linux (kernel 2.1.2 and up).

I R E A S O N I N G

S N M P

L I B R A R Y

Q. What operating systems does iReasoning SNMP library run on? A. iReasoning SNMP library is written in Java, so it can run on any OS which has JVM support. Q. How can I make SNMP requests with object names instead of numeric OIDs? A. iReasoning SNMP library includes a MIB parser. You need to load MIB files first by using MibUtil.loadMib method. To load MIB-II (RFC1213), you can call MibUtil.loadMib2() method. After necessary MIB files are loaded, you then can use MibUtil class' other method to do translation between object name and numeric OID. Check out example code for more information. Q. Can I use your SNMP API to develop SNMP agent? A. No. Our SNMP agent builder is the right tool for agent development. Q. I don't want to see log message, can I disable Logger? A. Yes. Add one line of code like the following: Logger.setLevel(Logger.NONE); Q. Can I put config files in a directory other than "./config"? A. Yes. For instance, you want config files in "d:\config", just add one more java environment variable: java -Dcom.ireasoning.configDir=d:\config ... Q. Can I use SNMP API to access agent within a Java applet? A. Yes. Because of security restrictions of Java applet, agent and web server have to be running on the same machine. Check out this applet example. Q. How can I change the community name after an SnmpSession is created? A. You can do this way:
SnmpSession session = new SnmpSession(...); SnmpTarget target = (SnmpTarget) session.getTarget(); target.setReadCommunity(...);

I R E A S O N I N G

S N M P

L I B R A R Y

RESOURCES AND REFERENCE
_____________________________________________
iReasoning Home Page

http://www.iReasoning.com/
SNMP FAQ http://www.faqs.org/faqs/snmp-faq/part1/ SNMP RFCs http://directory.google.com/Top/Computers/Internet/Protocols/SNMP /RFCs/ SNMP General Information http://www.simpleweb.org/ JAVA web site http://java.sun.com/

I R E A S O N I N G

S N M P

L I B R A R Y

GLOSSARY OF TERMS
______________________________________________
JAVA Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model. MIB A management information base (MIB) is a formal description of a set of network objects that can be managed using the Simple Network Management Protocol (SNMP). The format of the MIB is defined as part of the SNMP. (All other MIBs are extensions of this basic management information base.) MIB-I refers to the initial MIB definition; MIB-II refers to the current definition. SNMPv2 includes MIB-II and adds some new objects. OID An Object Identifier (OID) is a text string that can be represented in either decimal or English notation. Every OID represents a branch on a tree. The tree begins with the root which is represented by a `.'. The root contains several branches below it. Each of these branches in turn has subbranches beneath it. Branches at every level are labeled with a text name and an unsigned decimal identifier. PDU Protocol Data Unit (PDU), basically a fancy word for packet. PDUs are the building blocks of SNMP messages. SNMP Simple Network Management Protocol (SNMP) is the protocol governing network management and the monitoring of network devices and their functions. SNMP is described formally in the Internet Engineering Task Force (IETF) Request for Comment (RFC) 1157 and in a number of other related RFCs.

I R E A S O N I N G

S N M P

L I B R A R Y

TCP TCP (Transmission Control Protocol) is a set of rules (protocol) used along with the Internet Protocol (IP) to send data in the form of message units between computers over the Internet. While IP takes care of handling the actual delivery of the data, TCP takes care of keeping track of the individual units of data (called packets) that a message is divided into for efficient routing through the Internet. TCP is known as a connectionoriented protocol, which means that a connection is established and maintained until such time as the message or messages to be exchanged by the application programs at each end have been exchanged. Transport Layer In the Open Systems Interconnection (OSI) communications model, the Transport layer ensures the reliable arrival of messages and provides error checking mechanisms and data flow controls. The Transport layer provides services for both "connection-mode" transmissions and for "connectionless-mode" transmissions. For connection-mode transmissions, a transmission may be sent or arrive in the form of packets that need to be reconstructed into a complete message at the other end. TRAP A trap is basically an asynchronous notification sent from an SNMP agent to a network-management station to report a problem or a significant event. Like everything else in SNMP, traps are sent using UDP (port 162) and are therefore unreliable. This means that the sender cannot assume that the trap actually arrives, nor can the destination assume that it's getting all the traps being sent its way. UDP UDP (User Datagram Protocol) is a communications protocol that offers a limited amount of service when messages are exchanged between computers in a network that uses the Internet Protocol (IP). UDP is an alternative to the Transmission Control Protocol (TCP) and, together with IP, is sometimes referred to as UDP/IP. Like the Transmission Control Protocol, UDP uses the Internet Protocol to actually get a data unit (called a datagram) from one computer to another. Unlike TCP, however, UDP does not provide the service of dividing a message into packets (datagrams) and reassembling it at the other end. UML UML (Unified Modeling Language) is a standard notation for the modeling of real-world objects as a first step in developing an object-oriented design methodology.

Similar Documents

Free Essay

Netw 420 Week 1 Paper

...and software to analysis and find out the performance bottlenecks and provide reports, are able to find out any fault in the network devices and able to provide proper graphical reports. NMS is able to deal with bandwidth allocation by load balancing. Network Management systems adopt various cryptographic algorithms for key distribution authorization. NMS also handles security management and configuration management. NMS devices monitor and collect data from all the network components and analyze the data for all the mentioned functioalities described as above. Major Functionalities of an NMS 1. Performance monitoring (Network and Server). Network Performance ● Monitor availability and performance, analyze traffic usage and manage configurations for routers, switches, firewalls, WAN accelerators, wireless access points. Server Performance ● Monitor server performance across multiple OSes; Supports monitoring Windows, Linux, Solaris, HP...

Words: 752 - Pages: 4

Free Essay

Is 3120 Unit 10 Assignment 10

... the configuration level (C), the accounting level (A), the performance level (P) and the security level (S) (Rouse, 2007). The Marketing Company is a mid-size business that needs network management software. I recommend the Marketing Company should utilize network management toolset of the OpUtils software. It monitors network performance, calculates the bandwidth utilization, and scans the traffic for errors through SNMP. The tool also provides asset details such as the OS, installed software, and hardware and informs you about the general availability and performance of the network elements ("Network management tools," 2014). The goal of fault management is to recognize, isolate, correct and log faults that occur in the network. Furthermore, it uses trend analysis to predict errors so that the network is always available. This can be established by monitoring different things for abnormal behavior. When a fault or event occurs, a network component will often send a notification to the network operator using either a proprietary or open protocol such as SNMP (such as HP OpenView or Sun Solstice–formerly Net Manager), to collect information about network devices or at least write a message to its console for a console server to catch and log/page. In turn, the management station can be configured to make a network administrator aware of problems (by email, paging, or on-screen messages), allowing appropriate action to be taken. This notification is supposed to trigger manual...

Words: 681 - Pages: 3

Free Essay

Jim Afda

.... . Net-SNMP CLI 11 Probing a device: SNMP WALKs . . . . . . . . . . . . . . . . . . 11 Polling Individual OIDs: SNMP GETs . . . . . . . . . . . . . . . 13 Net-SNMP CLI Tool Options . . . . . . . . . . . . . . . . . . . . 13 4 Polling Applications 15 4.1 Simple Polling with PERL . . . . . . . . . . . . . . . . . . . . . . 15 4.2 The Net-SNMP PERL Module . . . . . . . . . . . . . . . . . . . 16 5 Trap Handlers 19 5.1 The Trap Daemon Configuration . . . . . . . . . . . . . . . . . . 19 5.2 A Simple Trap Handler . . . . . . . . . . . . . . . . . . . . . . . 20 5.3 Starting the Trap Daemon . . . . . . . . . . . . . . . . . . . . . . 21 6 The 6.1 6.2 6.3 6.4 Net-SNMP C API SNMP Internals . . . . . . . . Watching SNMP on the wire A simple example . . . . . . . Closing Thoughts . . . . . . . 23 23 24 27 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 1 Introduction to SNMP 1.1 General Overview Simple Network Management Protocol is a simple method of interacting with networked devices. The standard was defined by IETF RFC 1157 in May of 1990. SNMP can often seem quite confusing and overly complicated, its available APIs tend to put alot of wrapping around what should be very simple. The available books on the topic tend to only complicate the subject, not demystify it. SNMP is extremely...

Words: 5936 - Pages: 24

Premium Essay

Chapter 14

...Server Manager features should you install to use with it?Answer: a. SNMP service 2. Your company uses an inventory program that seems to be stuck in a programming loop and will not let you shut it down. What tool can you use to immediately shut down this program which is consuming CPU resources?Answer: c. Task Manager 3. Your advertising firm is expecting a new client to visit in about 15 minutes. In preparation, you have been printing out reports and graphics for the meeting, but the print process has been slow because the server is so busy. What can you do to best help ensure the printouts are finished on time?Answer: b. Increase the priority of the print spooler process to Above Normal or High. 4. Briefly explain the concept of a thread and mention where you can monitor thread activity in Windows Server 2008.Answer: A thread is a block of code within a program and can be monitored through Task Manager, such as on the Performance tab. (Although not directly mentioned in the text, students can also mention that threads can be monitored via Performance Monitor. 5. One of your company’s users has logged out, but your monitoring shows that the user is still logged on. What tool can you use to log off the user’s server sessionAnswer: c. Task Manager 6. The System Stability Index provides a measurement between _____ and _____.Answer: 0, 10 7. Which of the following can be an SNMP agent? (Choose all that apply.)Answer: a. Windows Server 2008, b...

Words: 897 - Pages: 4

Premium Essay

Looko

...User Guide Version 9 Document version 9501-1.0-18/08/2007 Cyberoam User Guide IMPORTANT NOTICE Elitecore has supplied this Information believing it to be accurate and reliable at the time of printing, but is presented without warranty of any kind, expressed or implied. Users must take full responsibility for their application of any products. Elitecore assumes no responsibility for any errors that may appear in this document. Elitecore reserves the right, without notice to make changes in product design or specifications. Information is subject to change without notice. USER’S LICENSE The Appliance described in this document is furnished under the terms of Elitecore’s End User license agreement. Please read these terms and conditions carefully before using the Appliance. By using this Appliance, you agree to be bound by the terms and conditions of this license. If you do not agree with the terms of this license, promptly return the unused Appliance and manual (with proof of payment) to the place of purchase for a full refund. LIMITED WARRANTY Software: Elitecore warrants for a period of ninety (90) days from the date of shipment from Elitecore: (1) the media on which the Software is furnished will be free of defects in materials and workmanship under normal use; and (2) the Software substantially conforms to its published specifications except for the foregoing, the software is provided AS IS. This limited warranty extends only to the customer as the original...

Words: 48399 - Pages: 194

Free Essay

Bsr 64k Command Reference Guide

...BSR 64000 Command Reference Guide Compass ID: 271820115 Version 3 Release 5.0.0 Notice Copyright © 2008 Motorola, Inc. All rights reserved No part of this publication my be reproduced in any form or by any means or used to make any derivative work (such as translation, transformation or adaptation) without written permission from Motorola, Inc. Motorola reserves the right to revise this publication and to make changes in content from time to time without obligation on the part of Motorola to provide notification of such revision or change. Motorola provides this guide without warranty of any kind, either implied or expressed, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Motorola may make improvements or changes in the product(s) described in this manual at any time. Motorola and the stylized M logo are registered trademarks of Motorola, Inc. Broadband Services Router, BSR, BSR 64000, RiverDelta, and SmartFlow are trademarks of Motorola, Inc. All other trademarks and registered trademarks are the property of their respective owners. Caring for the Environment by Recycling When you see this symbol on a Motorola product, do not dispose of the product with residential or commercial waste. Recycling your Motorola Equipment Please do not dispose of this product with your residential or commercial waste. Some countries or regions, such as the European Union, have set up systems to collect and recycle electrical...

Words: 97484 - Pages: 390

Premium Essay

Compsec

...stream of time sequential TCP/IP packets to determine a sequence of patterns. Patterns are also known as signatures. Most network signatures are based on the contents of the packets (Packet Content Signature = Payload of a packet). Patterns are also detectable in the header and flow of the traffic, relieving the need for looking into packets. Operational Concept Two primary operational modes 1. Tip off - Look for something new, something not previously classified. 2. Surveillance - Look for patterns from "targets" Forensic work bench * Same tool as in surveillance * Monitor online transactions * track network growth - PCs; mobile devices * System services usage * Identify unexpected changes in the network Benefits of a Network IDS 1. Outsider Deterrence - Make life hard for the hackers 2. Detection - Deterministic; Stochastic 3. Automated Response and Notification - Notifications(email, SNMP, pager, onscreen, audible) Response: Reconfigure router/firewalls; Doing a counter attack is not smart; Lose the connection. Challenges for network based technologies 1. Packet reassembly - Broken packets might not be enough detection. Pattern broken into different packets. 2. High Speed Networks - Flooding and dropping of packets 3. Anti Sniff (Sniffer Detection) - Designed by hackers to detect IDS. Find where exactly a sensor is situated. You do not have to worry if you are you using a Host based system yet. 4. Encryption - Done...

Words: 360 - Pages: 2

Free Essay

Mister

...packet sniffing by hackers. A packet sniffer is "a computer program or a piece of computer hardware that can intercept and log traffic passing over a digital network or part of a network" (Connolly, 2003). Packet sniffers are known by alternate names including network analyzer, protocol analyzer or sniffer, or for particular types of networks, an Ethernet sniffer or wireless sniffer (Connolly, 2003). As binary data travels through a network, the packet sniffer captures the data and provides the user an idea of what is happening in the network by allowing a view of the packet-by-packet data (Shimonski, 2002). Additionally, sniffers can also be used to steal information from a network (Whitman and Mattord, 2008). Legitimate and illegitimate usage will be explained in later sections. Packet sniffing programs can be used to perform man-in-the-middle attacks (MITM). This type of attack occurs when "an attacker...

Words: 2443 - Pages: 10

Premium Essay

Nt1330 Unit 3 Case Study

...Define and describe SNMPv3. How it is different from SNMPv1 and SNMPv2. According to Stalling and Case, Simple Network Management Protocol (SNMP) is a widely used network monitoring and control protocol. Data are passed from SNMP agents, which are hardware and/or software processes reporting activity in each network device (hub, router, bridge, etc) to the workstation console used to oversee the network. In other words, this protocol allows for the identification of issues in the network hardware/software before they become major problems. SNMP allows multiple devices to communicate each other in order to prevent major maintenance issues. SNMP uses OID (Object Identifiers) to defined what can be monitor in different devices. It also uses MIB (Management Information Base) a system in place to monitor the different devices. According to Techopedia, SNMP has evolved into three different versions: SNMPv1: This was the first user friendly implementation, operating within the structure management information specification, and described in RFC 1157. It had very weak security features. SNMPv2: This version has improved support for efficiency and error handling and is described in RFC 1901. It was easy to monitor, but once again its security...

Words: 3267 - Pages: 14

Premium Essay

It240

... |College of Information Systems & Technology | | |IT/240 Version 4 | | |Intro to LAN Technologies | Copyright © 2012, 2009, 2007 by University of Phoenix. All rights reserved. Course Description This foundational course covers local area network topics including rationale for networking, the open systems interconnection (OSI) model, common network topologies and architecture, client/server concepts, basic hardware devices and usage, and basic networking security concepts. Policies Faculty and students will be held responsible for understanding and adhering to all policies contained within the following two documents: • University policies: You must be logged into the student website to view this document. • Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Stallings, W. (2009). Business data communications (6th ed.)...

Words: 2355 - Pages: 10

Free Essay

Hp Analysis

...Industry Analysts, Inc. Comparitive Analysis A Comparative Analysis of Hewlett Packard Web Jetadmin 10.0 compared to Web Jetadmin 8.1 Prepared by: Industry Analysts, Inc. July 10, 2007 © 2007 Industry Analysts, Inc. • www.industryanalysts.com Page 2 IATSD Competitive Test Report This Page Intentionally Left Blank © 2007 Industry Analysts, Inc. • www.industryanalysts.com Page 3 IATSD Competitive Test Report A Comparative Analysis of HP Web Jetadmin 10.0 versus Web Jetadmin 8.1 As part of the rollout of the new Web Jetadmin 10.0 Printer/Fleet Management Utility, Hewlett Packard engaged Industry Analysts, Inc., an Independent Testing and Research company, to conduct a detailed comparative analysis. The object of this analysis was to document the benefits of the improvements made in the new Web Jetadmin 10.0 (WJA 10.0) release as compared to the previous Web Jetadmin 8.1 (WJA 8.1) release. The analysis was conducted at Industry Analysts, Inc.’s Technical Services Division in Fairfield New Jersey, and was performed using the latest downloadable version of Web Jetadmin 8.1, which was downloaded from Hewlett Packard’s web site, and the Beta 1 and Beta 2 versions of Web Jetadmin 10.0 supplied to IATSD by Hewlett Packard under nondisclosure prior to it’s official announcement, release, and availability. The protocol consisted of examining both Web Jetadmin releases in specified areas, detailing the differences found between the versions and describing...

Words: 4810 - Pages: 20

Free Essay

Administration

...digital technology that allows for two-way communication between the utility and its customers, and the sensing along the transmission lines is what makes the grid smart. Like the Internet, the Smart Grid will consist of controls, computers, automation, and new technologies and equipment working together, but in this case, these technologies will work with the electrical grid to respond digitally to our quickly changing electric demand * Two way interaction : Smart Grid introduces a Two way interaction (dialogue) where electricity and information can be exchanged between the utility and its consumers. * Developing networking: It’s a developing networking of communication, controls, computers, automation and new technologies and tools working together to make the grid more efficient, more reliable, more secure and greener. * New Technologies: The smart grid enables newer technologies to be integrated such as wind and solar energy production and plug in electric vehicle charging. * Digital Technology: A...

Words: 1414 - Pages: 6

Free Essay

Test

...HP 3PAR StoreServ Storage Concepts Guide HP 3PAR OS 3.1.2 MU2 Abstract This guide is for all levels of system and storage administrators who plan storage policies, configure storage resources, or monitor the storage usage of HP 3PAR storage systems. HP Part Number: QR482-96384 Published: June 2013 © Copyright 2007, 2013 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.21 and 12.212, Commercial 1 Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Acknowledgements Microsoft® and Windows® are U.S. registered trademarks of Microsoft Corporation. Oracle is a registered trademarks of Oracle and/or its affiliates. UNIX® is a registered trademark of The Open Group. Warranty To obtain a copy of the warranty for this product, see the warranty information website: http://www.hp.com/go/storagewarranty Contents 1 Overview..............................................................

Words: 36581 - Pages: 147

Free Essay

A Fully Functional Network Design for Shelly Fashion

...NETWORKS AND TELECOMMUNICATONS A FULLY FUNCTIONAL NETWORK DESIGN FOR SHELLY FASHION PRESENTED BY: Osazuwa Olufemi George Business requirement Shelly fashion is a clothing boutique that sells clothes to both male and female customers. Their goal is to be the biggest retail clothing store in the country which aims to provide customers from the ages of 5 to 45 years of age a wide variety of quality clothing. The clothing retail store is open six days a week to customers who come in and buy their clothes directly at the store. The transaction is recorded and stored on the store’s computer with a Store Management Software which keeps track of inventory, sales, and computes the profits of the retail store biannually. Shelly fashion is looking to expand its reach using internet technology so it would be able to meet with the growing number of customers and also to connect all its other and future branches together to form a centralized network. With the network the retail store would be able to launch its home delivery option where customers would be able to buy clothes online and have their goods brought to them at their homes without having to be physically present at store. The business owners want to embark on a project to set up a telecommunications network which should be able to reach their business requirements. Shelly fashion’s business requirements for the proposed network are as follows: * Reduce operating cost by cutting cost too make telephone calls...

Words: 2953 - Pages: 12

Premium Essay

Is3220 Project Part 1

...recent years show most corporate networks share common vulnerabilities. Many of these problems could be mitigated by appropriate education in “hacker thinking” for technical staff. We will take a look at our security on routers and switches to make sure there are no leakages of data traffic. OBJECTIVE We have identified that we have loss some major accounts to competitors whose bids have been accurately just under our bid offers by exact amounts. We also believe due to shared reporting and public Web site functions that our Web servers have been compromised and our RFP documents have been leaked to competitors which enabled them to under bid us. We want to mitigate Web threats in the future; we realize the web is a mission critical business tool. We want to purchase new products and services, that will give us an edge and better protect our networks and data, and that we address new and complex strategies against future attacks. SCOPE OF SERVICES 1. Procedures * Assist in planning and implementation of current configuration of host and services. * Network equipment evaluation ,and use of existing architecture * Look at growing threats to network Web Server, check Web malware, all uncontrolled use of...

Words: 3355 - Pages: 14