|
|
| |
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.
Environment
To set up your environment for the WebLogic SNMP agent's command-line interface:
Note: The snmpv1trap
and snmptrapd
commands do not require the SNMP agent to be enabled.
PATH
environment variable.
CLASSPATH
environment variable as described in Setting the Classpath Option.
Common Arguments
All WebLogic SNMP agent commands take the following form:
java
command-name
arguments
Table C-1 describes arguments that are common to most WebLogic SNMP agent commands.
Commands for Retrieving the Value of WebLogic Server Attributes
Table C-2 is an overview of commands that retrieve the value of WebLogic Server MBean attributes that are exposed in the WebLogic Server MIB.
Command |
Description |
---|---|
|
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. |
snmpwalk
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.
Syntax
java snmpwalk [-d] [-csnmpCommunity
] [-psnmpPort
] [-ttimeout
] [-rretries
]host
OID
For information about the command arguments that are not listed in the above table, refer to Table C-1.
Example
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
snmpgetnext
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.
Syntax
java snmpgetnext [-d] [-csnmpCommunity
] [-psnmpPort
] [-ttimeout
] [-rretries
]host
OID
[OID
]...
For information about the command arguments that are not listed in the above table, refer to Table C-1.
Example
The following example retrieves the name of a JDBC connection pool that has been deployed on the Administration Server. The OID in the example command is for the jdbcConnectionPoolRuntimeName
object type, which represents the Name
attribute of the JDBCConnectionPoolRuntime
MBean.
java snmpgetnext localhost .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/127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.190.1.15.32.49.51.54.56.100.54.98.102.97.101
.101.52.100.101.49.53.50.99.55.98.57.55.57.56.54.53.98.49.55.102.
100.102
STRING: demoXAPool
To determine whether there are additional JDBC connection pools 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.190.1.15.32.49.51.54.56.100.54.98.102.97.101
.101.52.100.101.49.53.50.99.55.98.57.55.57.56.54.53.98.49.55.102
.100.102
The command returns output similar to the following:
Response PDU received from 127.0.0.1/127.0.0.1, community: public
Object ID:
.1.3.6.1.4.1.140.625.190.1.15.32.102.50.55.102.57.102.52.50.54.48
.101.98.97.49.50.100.100.57.52.53.54.52.53.54.53.49.52.50.56.51.
56.102
STRING: demoPool
snmpget
Retrieves the value of one or more object instances. This command does not accept OIDs for object types.
java snmpget [-d] [-csnmpCommunity
] [-psnmpPort
] [-ttimeout
] [-rretries
]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
Commands for Testing Traps
Table C-3 is an overview of commands that generate and receive traps for testing purposes.
Command |
Description |
---|---|
|
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. |
snmpv1trap
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] [-csnmpCommunity
] [-pTrapDestinationPort
]TrapDestinationHost
.1.3.6.1.4.140.625
agent-addr generic-trap specific-trap timestamp
[OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER}value
] ...
Argument |
Definition |
---|---|
|
Specifies a password (community name) that secures the data in the trap. If you do not specify a value, the command assumes |
|
Specifies the port number on which the SNMP manager or trap daemon is listening. If you do not specify a value, the command assumes |
|
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 |
|
Specifies the value of the trap's This field is intended to indicate the computer on which the trap was generated. When using the |
|
Specifies the value of the trap's 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 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 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 |
OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE | IPADDRESS | COUNTER} |
(Optional) Specifies the value of the trap's For each name/value pair, specify an OID, a value type, and a value. For example, a log message trap includes a
|
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:
6
is the generic trap value that specifies "other WebLogic Server traps."
60
is the specific trap value that WebLogic Server uses to identify log message traps.
trapTime
variable binding and .1.3.6.1.4.1.140.625.100.10 is the OID for the trapServerName
variable binding.
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
snmptrapd
Starts a daemon that receives traps and prints information about the trap.
java snmpv1trap [-d] [-csnmpCommunity
] [-pTrapDestinationPort
]
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:
java snmptrapd -p 165
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:
PATH
environment variable.
CLASSPATH
environment variable as described in Setting the Classpath Option.
java snmptrapd
PATH
environment variable.
CLASSPATH
environment variable as described in Setting the Classpath Option.
java snmpv1trap localhost .1.3.6.1.4.140.625 localhost 6 65 1000
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: 65
Time: 1000
VARBINDS:
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|