![]() |
![]() |
e-docs > WebLogic Server > Administration Guide > WebLogic SNMP Agent Command-Line Reference |
Administration Guide
|
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 enables you to:
The following sections describe working with the WebLogic SNMP agent through its command-line interface:
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's command-line interface, set up your environment and note command syntax information as described in the following sections.
To set up your environment for the WebLogic SNMP agent's command-line interface:
All WebLogic SNMP agent commands take the following form:
Table D-1 describes arguments that are common to most WebLogic SNMP agent commands.
Includes debugging information and packet dumps in the command output. |
|
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: where snmpCommunity is the SNMP community name that you set in the Community Prefix field when you configured the SNMP agent (as described in "Setting Up the WebLogic SNMP Agent" in the Administration Console Online Help). To request the value of an object on a Managed Server, specify: where server_name is the name of the Managed Server. To request the value of an object for all server instances in a domain, send a community string with the following form: 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. |
|
Specifies the port number on which the WebLogic SNMP agent listens for requests. |
|
Specifies the number of milliseconds the command waits to successfully connect to the SNMP agent. |
|
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. |
|
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 D-2 is an overview of commands that retrieve the value of WebLogic Server MBean attributes that are exposed in the WebLogic Server MIB.
Returns a recursive list of all managed objects that are below a specified node in the MIB tree. See snmpwalk. |
|
Returns a description of the managed object that immediately follows an OID that you specify. See snmpgetnext. |
|
Returns a description of managed objects that correspond to one or more object-instance OIDs. See snmpget. |
Returns a recursive list of all managed objects that are below a specified node in the MIB tree.
If you specify the OID for an object type, the command returns a list of all instances of that type along with all instances of any child object types.
For example, if you specify the OID for an object type that corresponds to an MBean, this command returns a description of all instances of the MBean and all instances of the attributes within the MBeans.
To see the WebLogic Server MIB tree, refer to the WebLogic Server SNMP MIB Reference. For more information about the structure of the MIB and its object identifiers (OIDs), refer to "SNMP MIB for WebLogic" in WebLogic SNMP Management Guide.
java snmpwalk [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host OID
For information about the command arguments that are not listed in the above table, refer to Table D-1.
The following example returns all attributes of the ServerRuntimeMBean instance that is hosted on the Administration Server. Note that the OID .1.3.6.1.4.1.140.625.360 refers to the serverRuntimeTable object type in the WebLogic MIB.
java snmpwalk localhost .1.3.6.1.4.1.140.625.360
If you invoke this command from a computer that is running the Examples Server, the command returns output similar to the following truncated output. Note that the output includes the full OID for each attribute instance below the serverRuntimeTable object.
Object ID:
.1.3.6.1.4.1.140.625.360.1.1.32.101.98.52.50.55.97.53.101.55.101.
56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51.
55
STRING: eb427a5e7e8a3ba4ca95d33bf3b90b37
Object ID:
.1.3.6.1.4.1.140.625.360.1.5.32.101.98.52.50.55.97.53.101.55.101.
56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51.
55
STRING: ServerRuntime:examplesServer
Object ID:
.1.3.6.1.4.1.140.625.360.1.10.32.101.98.52.50.55.97.53.101.55.101
.56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51
.55
STRING: ServerRuntime
Object ID:
.1.3.6.1.4.1.140.625.360.1.15.32.101.98.52.50.55.97.53.101.55.101
.56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51
.55
STRING: examplesServer
...
The following example retrieves the name of all servers in the examples domain. The OID specified in the example command is the numerical value that the WebLogic Server MIB assigns to the serverRuntimeName object type.
java snmpwalk -c public@examples localhost
.1.3.6.1.4.1.140.625.360.1.15
The following example returns all attributes of the ServerRuntimeMBean instance that is hosted on a Managed Server named MS1. Note that the OID .1.3.6.1.4.1.140.625.360 refers to the serverRuntimeTable object in the WebLogic MIB.
java snmpwalk -c public@MS1 localhost .1.3.6.1.4.1.140.625.360
Returns a description of the managed object that immediately follows one or more OIDs that you specify.
Instead of the recursive listing that the snmpwalk command provides, this command returns the description of only the one managed object whose OID is the next in sequence. You could string together a series of snmpgetnext commands to achieve the same result as the snmpwalk command.
If you specify an object type, this command returns the first instance of the object type, regardless of how many instances of the type exist.
To see the WebLogic Server MIB tree, refer to the WebLogic Server SNMP MIB Reference. For information about the structure of the MIB and its object identifiers (OIDs), refer to "SNMP MIB for WebLogic" in WebLogic SNMP Management Guide.
java snmpgetnext [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host OID [OID]...
For information about the command arguments that are not listed in the above table, refer to Table D-1.
The following example retrieves the name of an application that has been deployed on the Administration Server. The OID in the example command is for the applicationRuntimeName object type, which represents the Name attribute of the applicationRuntime MBean.
java snmpgetnext localhost .1.3.6.1.4.1.140.625.105.1.15
The command returns output similar to the following:
Response PDU received from /127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.105.1.15.32.49.102.98.97.100.97.102.99.57.48
.50.102.48.98.53.54.100.100.49.54.50.54.99.54.99.49.97.97.98.53.
100.97
STRING: MyServer_uddiexplorer
To determine whether there are additional applications deployed on the Administration Server, you can use the output of the initial snmpgetnext command as input for an additional snmpgetnext command:
java snmpgetnext localhost .1.3.6.1.4.1.140.625.105.1.15.32.49.102.98.97.100.97.102.99.57.48
.50.102.48.98.53.54.100.100.49.54.50.54.99.54.99.49.97.97.98.53.
100.97
The command returns output similar to the following:
Response PDU received from /127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.105.1.15.32.54.98.49.101.57.56.54.98.98.50.
57.100.54.55.48.100.56.98.101.101.97.55.48.53.57.99.49.51.56.98.
97.99
STRING: MyServer_StartupEAR
The following example specifies two OIDs to retrieve the name of an application that has been deployed on the Administration Server and the name of a JDBC connection pool. The OIDs in the example command are for the applicationRuntimeName object type, which represents the Name attribute of the ApplicationRuntime MBean, and jdbcConnectionPoolRuntimeName, which represents the Name attribute of the JDBCConnectionPoolRuntimeMBean.
java snmpgetnext localhost .1.3.6.1.4.1.140.625.105.1.15
.1.3.6.1.4.1.140.625.190.1.15
The command returns output similar to the following:
Response PDU received from /127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.105.1.15.32.49.102.98.97.100.97.102.99.57.48
.50.102.48.98.53.54.100.100.49.54.50.54.99.54.99.49.97.97.98.53.
100.97
STRING: MyServer_uddiexplorer
Object ID:
.1.3.6.1.4.1.140.625.190.1.15.32.53.53.49.48.50.55.52.57.57.49.99
.102.55.48.98.53.50.54.100.48.100.53.53.52.56.49.57.49.49.99.99.
99
STRING: MyPool
Retrieves the value of one or more object instances. This command does not accept OIDs for object types.
java snmpget [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host object-instance-OID
[object-instance-OID]...
The following example retrieves the value of the serverRuntimeState and serverRuntimeListenPort attribute instances for the Administration Server.
java snmpget localhost
.1.3.6.1.4.1.140.625.360.1.60.32.102.100.48.98.101.102.100.99.102
.52.98.97.48.48.49.102.57.53.51.50.100.102.53.55.97.101.52.56.99
.99.97.99
.1.3.6.1.4.1.140.625.360.1.35.32.102.100.48.98.101.102.100.99.102
.52.98.97.48.48.49.102.57.53.51.50.100.102.53.55.97.101.52.56.99.
99.97.99
The command returns output similar to the following:
Response PDU received from /127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.360.1.60.32.102.100.48.98.101.102.100.99.102
.52.98.97.48.48.49.102.57.53.51.50.100.102.53.55.97.101.52.56.99.
99.97.99
STRING: RUNNING
Object ID:
.1.3.6.1.4.1.140.625.360.1.35.32.102.100.48.98.101.102.100.99.102
.52.98.97.48.48.49.102.57.53.51.50.100.102.53.55.97.101.52.56.99.
99.97.99
INTEGER: 7001
Table D-3 is an overview of commands that generate and receive traps for testing purposes.
Constructs an SNMPv1 trap and distributes it to the SNMP manager or trap daemon that is running on the specified host and listening on the specified port number. See snmpv1trap. |
|
Starts a daemon that receives traps and prints information about the trap. See snmptrapd. |
Constructs an SNMPv1 trap and distributes it to the SNMP manager or trap daemon that is running on the specified host and listening on the specified port number. For more information about the trap daemon, refer to snmptrapd.
As part of invoking this command, you specify the value for fields within the trap packet that you want to send. The values that you specify must resolve to traps that are defined in the WebLogic Server MIB. For information about WebLogic Server traps and the fields that trap packets require, refer to "Format of WebLogic Trap Notifications" in the WebLogic SNMP Management Guide.
java snmpv1trap [-d] [-c snmpCommunity] [-p TrapDestinationPort]
TrapDestinationHost .1.3.6.1.4.140.625
agent-addr generic-trap specific-trap timestamp
[OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE |
IPADDRESS | COUNTER} value] ...
Specifies a password (community name) that secures the data in the trap. If you do not specify a value, the command assumes -c public. |
|
Specifies the port number on which the SNMP manager or trap daemon is listening. |
|
Specifies the DNS name or IP address of the computer that hosts the SNMP manager or trap daemon. |
|
Specifies the value of the trap's enterprise field, which contains the beginning portion of the OID for all WebLogic Server traps. |
|
Specifies the value of the trap's agent address field. This field is intended to indicate the computer on which the trap was generated. When using the snmpv1trap command to generate a trap, you can specify any valid DNS name or IP address. |
|
Specifies the value of the trap's generic trap type field. For a list of valid values, refer to "Format of WebLogic Trap Notifications" in the WebLogic SNMP Management Guide. |
|
Specifies the value of the trap's specific trap type field. For a list of valid values, refer to "Format of WebLogic Trap Notifications" in the WebLogic SNMP Management Guide. |
|
Specifies the value of the trap's timestamp field. This field is intended to indicate the length of time between the last re-initialization of the SNMP agent and the time at which the trap was issued. When using the snmpv1trap command to generate a trap, any number of seconds is sufficient. |
|
OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER} value |
(Optional) Specifies the value of the trap's variable bindings field, which consists of name/value pairs that further describe the trap notification. For each name/value pair, specify an OID, a value type, and a value. For example, a log message trap includes a trapTime binding to indicate the time at which the trap is generated. To include this variable binding in the test trap that you generate, specify the OID for the trapTime variable binding, the STRING keyword, and a string that represents the time: |
The following example generates a log message trap that contains the trapTime and trapServerName variable bindings. It broadcasts the trap through port 165. In the example:
java snmpv1trap -p 165 localhost .1.3.6.1.4.140.625 localhost 6 60
1000 .1.3.6.1.4.1.140.625.100.5 STRING "2:00 pm"
.1.3.6.1.4.1.140.625.100.10
STRING localhost
The SNMP manager (or trap daemon) that is listening at port number 165 receives the trap. If the trap daemon is listening on 165, it returns the following:
Trap received from: /127.0.0.1, community: public
Enterprise: .1.3.6.1.4.140.625
Agent: /127.0.0.1
TRAP_TYPE: 6
SPECIFIC NUMBER: 60
Time: 1000
VARBINDS:
Object ID: .1.3.6.1.4.1.140.625.100.5
STRING: 2:00 pm
Object ID: .1.3.6.1.4.1.140.625.100.10
STRING: localhost
Starts a daemon that receives traps and prints information about the trap.
java snmpv1trap [-d] [-c snmpCommunity] [-p TrapDestinationPort]
The following command starts a trap daemon and instructs it to listen for requests on port 165. The daemon runs in the shell until you kill the process or exit the shell:
If the command succeeds, the trap daemon returns a blank line with a cursor. The trap daemon waits in this state until it receives a trap, at which point it prints the trap.
Example: Sending Traps to the Trap Daemon
To generate WebLogic Server traps and receive them through the trap daemon:
The snmpv1trap command generates a serverStart Trap and broadcasts it through port 162.
In the shell in which the trap daemon is running, the daemon prints the following:
Trap received from: /127.0.0.1, community: public
Enterprise: .1.3.6.1.4.140.625
Agent: /127.0.0.1
TRAP_TYPE: 6
SPECIFIC NUMBER: 60
Time: 1000
VARBINDS:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |