README

AdventNet SNMP API 4

<AdventNet/SNMPAPI/examples/low_level_api_examples/snmpapps>

Release 4.0.5

This directory contains examples of using the low-level APIs. Refer 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 parameters 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] [-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 10.3.2.120 1.2.0 
java snmpget -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] [-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 10.3.2.120 1.2.0 
java snmpgetnext -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] [-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 {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER | OID } value] ... 
Example
java snmpset 10.3.2.120 1.5.0 STRING whatever 
java snmpset -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 1.5.0 STRING whatever 

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

Usage
snmpbulk [-d] [-v version(v2,v3)] [-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 [OID] ... nonRepeaters maxRepetions 
Example
java snmpbulk 10.3.2.120 1.1.0 0 20 
java snmpbulk -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)] [-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 10.3.2.120 .1.3 
java snmpwalk -v v3 -u initial2 -w initial2Pass -a MD5 10.3.2.120 .1.3 

6. snmpv1trap.java - Send an SNMPv1 trap PDU.

Usage
snmpv1trap [-d] [-c community] [-p port] host enterprise agent-addr generic-trap specific-trap timeticks [OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER} value] ... 
Example
java snmpv1trap 10.3.2.120 .1.3.6.1.4.1.2162.1000.2 10.3.2.118 6 12 16352 .1.3.6.1.4.1.2162.1001.21.0 STRING TrapTest 

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

Usage
snmpv2ctrap [-d] [-c community] [-p port] host TimeTicksvalue OIDvalue [OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER | COUNTER64 | UNSIGNED32} value] ... 
Example
java snmpv2ctrap 10.3.2.120 16352 .1.3.6.1.4.1.2162.1000.2 .1.3.6.1.4.1.2162.1001.21.0 STRING TrapTest 

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] host TimeTicksvalue OIDvalue [OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER | COUNTER64 | UNSIGNED32} value] ... 
Example
java snmpv3trap -e 0x000012141516171819202121 -u intial2 -a MD5 -w initial2Pass -i initial 10.3.2.120 16352 .1.3.6.1.4.1.2162.1000.2 .1.3.6.1.4.1.2162.1001.21.0 STRING TrapTest 

9. snmptrapd.java - Start the trap daemon 

Usage
snmptrapd [-d] [-p port][-c community] 
Example
java snmptrapd 

10. snmpv3trapd.java - Start the trap daemon for v3. 

Usage:
snmpv3trapd [-d][-p port][-c community] [-u user] [-e engineID] [-a authProtocol] [-w auth_password]
[-pp privProtocol(DES/AES-128/AES-192/AES-256/3DES)] [-s priv_password] 
Example
java snmpv3trapd -u initial2 -e 0x000012141516171819202121 -a MD5 -w initial2Pass 

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