![]() ![]() ![]() ![]() ![]() ![]() |
Note: | The command-line utility that this document describes is deprecated in WebLogic Server 10.0. Instead, use the command-line utility that is described in WebLogic SNMP Command-Line Utility in WebLogic SNMP Management Guide. |
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 (managed objects), 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 managed objects from all Managed Servers within a domain.
The WebLogic SNMP agent provides a command-line interface that lets you:
The following sections describe working with the WebLogic SNMP agent through its command-line interface:
For more information about using SNMP with WebLogic Server, see:
To set up your environment for the WebLogic SNMP agent command-line interface:
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.
All WebLogic SNMP agent commands take the following form:
Table 4-1 describes arguments that are common to most WebLogic SNMP agent commands.
You must specify the same SNMP version that you set in the Trap Version field when you configured the SNMP agent (as described in
Create SNMP agents in the Administration Console Online Help).
|
|
The community name that you set for the WebLogic SNMP agent and optionally specifies the server instance that hosts the objects with which you want to interact.
where
snmpCommunity is the SNMP community name that you set in the Community Prefix field when you configured the SNMP agent (as described in
Create SNMP agents in the Administration Console Online Help).
|
|
Table 4-2 is an overview of commands that retrieve WebLogic Server managed objects and object instances.
See snmpwalk.
|
|
See snmpgetnext.
|
|
See snmpget.
|
Returns all managed objects or instances that are below a specified node in the MIB.
If you specify the OID for a tabular object, the command returns all of its object instances along with all related (child) objects and instances.
java snmpwalk [-d] [-v (v1,v2)] [-csnmpCommunity
] [-psnmpPort
]
[-ttimeout
] [-rretries
]host
OID
The following example retrieves the names of all applications that have been deployed on the Administration Server. The managed object for an application name is applicationRuntimeName
, which is a child of the applicationRuntimeTable
object. (See
WebLogic Server SNMP MIB Reference.)
java snmpwalk localhost .1.3.6.1.4.1.140.625.105.1.15
If you invoke this command from a computer that is running the example MedRecServer, the command returns output similar to the following truncated output. Note that the output includes the full OID for each instance of the applicationRuntimeName
object.
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: MedRecServer_uddiexplorer
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.10
0.54.55.48.100.56.98.101.101.97.55.48.53.57.99.49.51.56.98.97.99
STRING: MedRecServer_StartupEAR
Object ID: .1.3.6.1.4.1.140.625.105.1.15.32.56.48.97.53.50.52.99.101.53.54.57.54
.52.52.99.54.48.55.54.100.102.49.54.97.98.52.48.53.98.100.100.49
STRING: MedRecServer_wl_management_internal2
...
The following example retrieves the name of all applications that have been deployed on all servers in the medrec
domain.
java snmpwalk -c public@medrec localhost .1.3.6.1.4.1.140.625.105.1.15
The following example retrieves the name of all applications that have been deployed on a Managed Server named MS1
.
java snmpwalk -c public@MS1 localhost .1.3.6.1.4.1.140.625.105.1.15
Returns a description of the managed object or object instance that immediately follows one or more OIDs that you specify. If you specify a tabular object, this command returns the first child managed object. If you specify a scalar object, this command returns the first instance of the object.
Instead of the recursive listing that the snmpwalk
command provides, this command returns the description of only one managed object or instance 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.
java snmpgetnext [-d] [-v (v1,v2)] [-csnmpCommunity
] [-psnmpPort
]
[-ttimeout
] [-rretries
]host
OID
[OID
]...
The following example retrieves the name of an application that has been deployed on the Administration Server. The managed object for an application name is applicationRuntimeName
, which is a scalar object and is a child of the applicationRuntimeTable
object. (See
WebLogic Server SNMP MIB Reference.)
java snmpgetnext localhost .1.3.6.1.4.1.140.625.105.1.15
If you invoke this command from a computer that is running the example MedRecServer, 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: MedRecServer_uddiexplorer
To determine whether there are additional applications deployed on the Administration Server, you can use the output of the 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.10
0.54.55.48.100.56.98.101.101.97.55.48.53.57.99.49.51.56.98.97.99
STRING: MedRecServer_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, which is the name of an application, and jdbcConnectionPoolRuntimeName
, which is the name of a JDBC connection pool.
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
If you invoke this command from a computer that is running the example MedRecServer, 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: MedRecServer_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: MedRecPool-PointBase
Retrieves the value of one or more object instances. This command does not accept OIDs for managed objects.
java snmpget [-d] [-v (v1,v2)] [-csnmpCommunity
] [-psnmpPort
]
[-ttimeout
] [-rretries
]host
object-instance-OID
[object-instance-OID
]...
The following example retrieves the serverRuntimeState
and serverRuntimeListenPort
managed object instances for the Administration Server. Both of these objects are children of the serverRuntimeTable
object. (See
WebLogic Server SNMP MIB Reference.)
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
If you invoke this command from a computer that is running the example MedRecServer, 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 4-6 is an overview of commands that generate and receive traps for testing purposes.
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.
See snmpv1trap.
|
Starts a daemon that receives traps and prints information about the trap.
java snmptrapd [-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:
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.
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.
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 OIDs for WebLogic Server 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
] ...
For a list of valid values, refer to
OIDs for WebLogic Server Notifications in the WebLogic SNMP Management Guide.
|
|
For a list of valid values, refer to
OIDs for WebLogic Server Notifications in the WebLogic SNMP Management Guide.
|
|
(Optional) The value of the trap’s
variable bindings field, which consists of name– value pairs that further describe the trap notification.
|
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
To use the snmpv1trap
command to generate WebLogic Server traps and receive them through the trap daemon:
WL_HOME\server\bin\setWLSEnv.sh
(or setWLSEnv.cmd
on Windows)
where WL_HOME
is the directory in which you installed WebLogic Server.
WL_HOME\server\bin\setWLSEnv.sh
(or setWLSEnv.cmd
on Windows)
java snmpv1trap localhost .1.3.6.1.4.140.625 localhost 6 60 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: 60
Time: 1000
VARBINDS:
To use WebLogic SNMP agent to generate WebLogic Server traps and receive them through the trap daemon:
See Create SNMP agents in the Administration Console Online Help.
165
. Keep all other default settings that the Administration Console presents.See Create Trap Destinations in the Administration Console Online Help.
WL_HOME\server\bin\setWLSEnv.sh
(or setWLSEnv.cmd
on Windows)
where WL_HOME
is the directory in which you installed WebLogic Server.
When the Administration Server starts, the SNMP agent generates a serverStart
trap and broadcasts it through port 165.
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:
![]() ![]() ![]() |