In order to use WebLogic's SNMP agent, it needs to be enabled and configured using the Administration Console. To do this, select the Services/SNMP node from the left pane of the Administration Console and then select the SNMP tab. Check the Enabled option and set the SNMP Port on which the SNMP agent will be available. Ensure that the port number for the SNMP agent is available. It may happen that the default value for the port, 161, is already used by the operating system on which you have deployed WebLogic. Table 22-1 lists the other configuration settings that are available for the SNMP agent.
Management Information Base (MIB) Data Refresh Interval
The MIB agent caches requested MIB values. This option defines the minimum number of seconds that the values will be cached before the agent attempts to refresh them.
This option defines the community prefix that is used to form the community name. It defaults to public.
This can configure the agent to output debug information. A value of 0 means that no debug information will be sent, 1 indicates that fatal information will be sent, 2 indicates critical information, and 3 indicates noncritical information.
This option specifies whether the traps that are generated conform to the SNMPv1 or SNMPv2 protocol. It defaults to SNMPv1.
Send Automatic Traps Enabled
This option, which defaults to true, determines whether the automatically generated traps (server start and stop, etc.) are sent to SNMP managers.
Once the agent has been configured and the server restarted, you can start interacting with it using a network management tool. WebLogic comes with a simple utility, snmpgetnext, which can be used to interrogate the SNMP agent. In order to run this utility, you need to supply the community name to use, the port number and host address, and finally the SNMP query itself. Here is an example that shows how to query the domain's SNMP agent for the address of the Administration Server:
java snmpgetnext -c public -p 1611 10.0.10.10 .126.96.36.199.188.8.131.525.360.1.30
Don't be confused by the string of numbers at the end of the query it represents an object name that uniquely identifies an MBean attribute for the server. The rest of this section is concerned with naming. In particular, we look at how to construct object names that can be used to identify attributes of managed resources within the domain. We also examine how a community name can be used to identify a particular Managed Server.
22.2.1 The Management Information Base
A Management Information Base (MIB), a standard text file that contains the definitions and properties of all managed resources and services supported by the agent, accompanies WebLogic's SNMP agent. The MIB defines a hierarchy of objects, which represent manageable attributes that may be queried using the SNMP interfaces. Each such manageable attribute has a unique identifier, called an object identifier (OID), which also is recorded in the MIB. OIDs identify resources of interest and are used when interacting with SNMP agents. All OIDs in SNMP are specified as a sequence of numbers or mnemonic keywords defining a unique path through a global namespace. For example, WebLogic Server is only one of many thousands of devices that are SNMP-enabled. All of these devices can be managed, in principal, by a single agent, so they need to be uniquely named. For this reason, there is an OID for WebLogic Server itself: .184.108.40.206.4.140.625. All OIDs specified in the MIB are relative to this root OID.
You can find the file documenting the MIB in WL_HOMEserverlibBEA-WEBLOGIC-MIB.asn1. It conforms to the standard Abstract Syntax Notation.1 (ASN.1) format. An important aspect of the objects available to WebLogic's SNMP agent is that they all correspond to MBean attributes. Hence, the OIDs listed in the MIB enable you to uniquely identify a particular MBean attribute from the hierarchy of MBeans that are made available for management. You also can find a nicely formatted, searchable, cross-referenced version on the Web at http://edocs.bea.com/wls/docs81/snmp/index.html.
Many management tools allow you to search through the information in the MIB to find the resource of interest. You can also construct one by referencing the MIB. In the earlier example, we used an OID for the serverRuntimeListenAddress attribute. Here is how we constructed the OID for this resource:
So, the complete OID that identifies the server's listen address is .220.127.116.11.4.140.625.360.1.30, which is what we used in our example when querying the SNMP agent.
22.2.2 Community Names
A community name is simply a textual password that can be assigned to an SNMP agent when it is configured. The agent verifies the community name against that supplied by a requesting management agent to ensure that the agent has permission to request data. It also is used when sending trap notifications. If WebLogic's agent receives an incorrect community name, it generates an authenticationFailure trap that is sent to the source of the request.
The community name in WebLogic serves a dual purpose. Because the SNMP agent on the Administration Server serves as the agent for the entire domain, a querying agent needs to be able to identify a Managed Server if it wants information from a particular Managed Server. This can be accomplished by using the following format for the community name when querying the SNMP agent:
Here, community_name represents the community name that was assigned to the agent, and server_name is the name of the Managed Server within the domain. Thus, if we need to query for the listen address for a Managed Server ServerA within the domain, we could issue the following SNMP query:
java snmpgetnext -c public@ServerA -p 1611 10.0.10.10 .18.104.22.168.22.214.171.1245.360.1.30
To identify manageable attributes on the Administration Server itself, simply use the community name:
Finally, if you want to retrieve the values of a manageable attribute for every server within the domain, you can use the following format:
Here, domain_name represents the name of the WebLogic domain. The following example shows how to request the addresses of all the servers in mydomain:
java snmpwalk -c public@mydomain -p 1611 10.0.10.10 .126.96.36.199.188.8.131.525.360.1.30
Managing the Web Server
Using JNDI and RMI
Using CMP and EJB QL
Packaging and Deployment
Performance, Monitoring, and Tuning
Logging and Internationalization