Skip navigation.
Downloads | Product Documentation | Support

WebLogic Server Command Reference

# WebLogic SNMP Agent Command-Line Reference

WebLogic Server can use Simple Network Management Protocol (SNMP) to communicate with enterprise-wide management systems. The WebLogic Server subsystem that gathers WebLogic management data, converts it to SNMP communication modules (trap notifications), and forwards the trap notifications to third-party SNMP management systems is called the WebLogic SNMP agent. The WebLogic SNMP agent runs on the Administration Server and collects information from all Managed Servers within a domain.

The WebLogic SNMP agent provides a command-line interface that lets you:

- Retrieve the value of WebLogic Server attributes that are exposed as managed objects in the WebLogic Server Management Information Base (MIB).
- Generate and receive WebLogic Server traps.

The following sections describe working with the WebLogic SNMP agent through its command-line interface:

- Required Environment and Syntax for the SNMP Command-Line Interface
- Commands for Retrieving the Value of WebLogic Server Attributes
- Commands for Testing Traps

For more information about using SNMP with WebLogic Server, refer to the WebLogic SNMP Management Guide.

# Required Environment and Syntax for the SNMP Command-Line Interface

Before you use the WebLogic SNMP agent command-line interface, set up your environment and note the command syntax information described in the following sections.

## Environment

To set up your environment for the WebLogic SNMP agent command-line interface:

1. Install and configure the WebLogic Server software, as described in the WebLogic Server Installation Guide.
2. Enable the WebLogic SNMP agent, as described in "Configuring SNMP and WebLogic Server" in the Administration Console Online Help.

Note: The `snmpv1trap` and `snmptrapd` commands do not require the SNMP agent to be enabled.

3. Open a command prompt (shell) and invoke the following script:

`WL_HOME\server\bin\setWLSEnv.sh` (or `setWLSEnv.cmd` on Windows)

where `WL_HOME` is the directory in which you installed WebLogic Server.

The script adds a supported JDK to the shell's `PATH` environment variable and adds WebLogic Server classes to the `CLASSPATH` variable.

## Common Arguments

All WebLogic SNMP agent commands take the following form:

`java` `command-name` `arguments`

Table 6-1 describes arguments that are common to most WebLogic SNMP agent commands.

Table 6-1 Common Command Line Arguments

Argument | Definition
--- | ---
`-d` | Includes debugging information and packet dumps in the command output.
`-v` {`v1` | `v2`}`` | Specifies whether to use SNMPv1 or SNMPv2 to communicate with the SNMP agent. You must specify the same SNMP version that you set in the Trap Version field when you configured the SNMP agent (as described in "Enabling and Configuring the WebLogic SNMP Agent" in the Administration Console Online Help) If you do not specify a value, the command assumes `-v v1`.
`-c` `snmpCommunity` [`@``server_name` | `@``domain_name` ] | Specifies the community name that the WebLogic SNMP agent uses to secure SNMP data and specifies the server instance that hosts the objects with which you want to interact. To request the value of an object on the Administration Server, specify: `snmpCommunity` where `snmpCommunity` is the SNMP community name that you set in the Community Prefix field when you configured the SNMP agent (as described in Enabling and Configuring the WebLogic SNMP Agent in the Administration Console Online Help). To request the value of an object on a Managed Server, specify: `snmpCommunity``@``server_name` where `server_name` is the name of the Managed Server. To request the value of an object for all server instances in a domain, specify a community string with the following form: `snmpCommunity``@``domain_name` If you do not specify a value, the command assumes `-c public`, which attempts to retrieve the value of an object that is on the Administration Server.
`-p` `snmpPort` | Specifies the port number on which the WebLogic SNMP agent listens for requests. If you do not specify a value, the command assumes `-p 161`.
`-t` `timeout` | Specifies the number of milliseconds the command waits to successfully connect to the SNMP agent. If you do not specify a value, the command assumes `-t 5000`.
`-r` `retries` | Specifies the number of times the command retries unsuccessful attempts to connect to the SNMP agent. If you do not specify a value, the command exits on the first unsuccessful attempt.
`host` | Specifies the DNS name or IP address of the computer that hosts the WebLogic Server Administration Server, which is where the WebLogic SNMP agent runs.

# Commands for Retrieving the Value of WebLogic Server Attributes

Table 6-2 is an overview of commands that retrieve the value of WebLogic Server MBean attributes that are exposed in the WebLogic Server MIB.

Table 6-2 Overview of Commands for Retrieving the Value of WebLogic Server Attributes

Command | Description
--- | ---
`snmpwalk` | Returns a recursive list of all managed objects that are below a specified node in the MIB tree. See snmpwalk.
`snmpgetnext` | Returns a description of the managed object that immediately follows an OID that you specify. See snmpgetnext.
`snmpget` | Returns a description of managed objects that correspond to one or more object-instance OIDs. See snmpget.