README

AdventNet SNMP API 4

<AdventNet/SNMPAPI/examples/low_level_api_examples/mibapps>

Release 4.0.5

This directory contains examples of using the low-level APIs. Use the setenv.bat or setenv.sh file for help on setting up your environment to run the examples. Command line examples are given below. 

For using v3 features, the values for the command-line params are as follows.

-u : The principal or user name on whose behalf the request is to be sent. 
-a : This is the authentication method to be used. The values are MD5 for the HMAC-MD5 authentication SHA for the HMAC-SHA authentication 
-pp : privProtocol(DES/AES-128/AES-192/AES-256/3DES)
-w
: The password used for authentication. This is the non-localized password. 
-s : The password used for encryption or privacy. This is the again the non-localized password. 
-i : The context Name to be used for the pdu.

Please note that the requests could fail, if sent with any other security parameters apart from the ones configured on the agent. Moreover, the authentication scheme (-a) must be prvided when the auth password(-w) is specified. All the v3 examples below use the case of a user initial2, using MD5 authentication, and an authentication passphrase of initial2Pass. 

Bundled Examples
1. snmpget.java - Get one or more SNMP variables.

Usage
snmpget [-d] [-v version(v1,v2,v3)] [-c community] [-m MIB_files] [-p port] [-r retries] [-t timeout] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] host OID [OID] ... 
Example
java snmpget -m ../../../mibs/RFC1213-MIB 10.3.2.120 1.2.0 
java snmpget -m ../../../mibs/RFC1213-MIB -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 1.2.0 

2. snmpgetnext.java - Perform a getnext on one or more SNMP variables.

Usage
snmpgetnext [-d] [-v version(v1,v2,v3)] [-c community] [-m MIB_files] [-p port] [-r retries] [-t timeout] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] host OID [OID] ... 
Example
java snmpgetnext -m ../../../mibs/RFC1213-MIB 10.3.2.120 1.2.0 
java snmpgetnext -m ../../../mibs/RFC1213-MIB -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 1.2.0 

3. snmpset.java - Perform an SNMP set on one or more SNMP variables.

Usage
snmpset [-d] [-v version(v1,v2,v3)] [-c community] [-m MIB_files] [-p port] [-r retries] [-t timeout] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] host [OID value] ... 
Example
java snmpset -m ../../../mibs/RFC1213-MIB 10.3.2.120 1.5.0 whatever 
java snmpset -m ../../../mibs/RFC1213-MIB -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 1.5.0 whatever 

4. snmpbulk.java - Perform a getbulk operation. The agent must at least support v2c.

Usage
snmpbulk [-d] [-v version(v1,v2,v3)] [-c community] [-m MIB_files] [-p port] [-r retries] [-t timeout] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] host OID [OID] ... nonRepeaters maxRepetions 
Example
java snmpbulk -m ../../../mibs/RFC1213-MIB 10.3.2.120 1.1.0 0 20 
java snmpbulk -m ../../../mibs/RFC1213-MIB -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 1.1.0 0 20

5. snmpwalk.java - Perform an SNMP walk with one or more OIDs.

Usage
snmpwalk [-d] [-v version(v1,v2,v3)] [-m mibs] [-c community] [-p port] [-r retries] [-t timeout] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] host OID 
Example
java snmpwalk -m ../../../mibs/RFC1213-MIB 10.3.2.120 .1.3 
java snmpwalk -m ../../../mibs/RFC1213-MIB -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 .1.3 

6. snmpv1trap.java - Send an SNMP v1 trap PDU.

Usage
snmpv1trap [-d] [-c community] [-p port] -m MIB_files host enterprise agent-addr generic-trap specific-trap timeticks [OID value] ... 
Example
java snmpv1trap -m ../../../mibs/RFC1213-MIB 10.3.2.120 snmp 10.3.2.118 3 0 16352 ifIndex.2 2 

7. snmpv2ctrap.java - Send an SNMPV2c trap notification PDU.

Usage
snmpv2ctrap [-d] [-c community] [-p port] -m MIB_files host TimeTicksvalue OIDvalue [OID value] ... 
Example
java snmpv2ctrap -m ../../../mibs/RFC1213-MIB 10.3.2.120 16352 coldStartTrap ifIndex.2 2 

8. snmpv3trap.java - Send an SNMPV2c trap notification PDU using the SNMPV3 protocol.

Usage
snmpv3trap [-d] [-p port][-e engineID(0x....)] [-u user] [-a auth_protocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] [-i context_id] -m MIB_files host TimeTicksvalue OIDvalue [OID value] ... 
Example
java snmpv3trap -m "../../../mibs/RFC1213-MIB ../../../mibs/SNMPv2-MIB" -e 0x000012141516171819202121 -u intial2 -a MD5 -w initial2Pass -i initial 10.3.2.120 16352 coldStartTrap ifIndex.2 2 

Support

Feedback

For those with support contracts, AdventNet provides priority support through email with a reply usually provided within 24 hours.

While sending your support questions or bug report, please specify the SNMP package release version, the JDK version , the platform, and the browser you use .

Send your support queries to: snmp-support@adventnet.com

We welcome your feedback that will help us improve the APIs and provide future enhancements.

Send in your feedback to: snmp-support@adventnet.com

 

Copyright and License

Please refer COPYRIGHT and LICENSE before using the package.

AdventNet, Inc.
Web : http://www.adventnet.com
Email: info@adventnet.com