Use JMX to build the weblogic9 monitoring software (1)

Source: Internet
Author: User
Build weblogic9 monitoring software using JMX

For my work, I need to monitor multiple WebLogic servers. When the server status is abnormal, I will send an email notification.
You can use the JMX function of WebLogic as required.

I. Changes and new features of weblogic9 in JMX
Weblogic9 differs greatly from the previous 8.1 series versions. Before jmx1.0, WebLogic uses its own jmx1.0-based implementation. Since jmx1.0, WebLogic uses
The implementation of jmx1.2 included in jdk1.5. Therefore, the monitoring program is completely different for different versions. With the release of JSR-160, the original
Weblogic. Management. mbeanhome is no longer in use.

II. The domain structure of domain WebLogic must contain an adminserver.
The simplest domain can contain a server instance, which serves as both a management role and an application and a resource. This simplest deployment environment is mostly used in the development environment, in the production environment, the load is usually deployed on the managedserver.

**************************************** *******************************
**************************************** *******************************
3. Introduction to weblogic9 mbean
1. WebLogic provides a series of mbeans for configuring, monitoring, and managing WebLogic Server resources.

Mbean types include the following:
A. Runtime
Mbean contains the running status of servers and resources. Generally, it only contains the current status of services or resources, and these statuses are not persistent. After the service instance is stopped, these statistics and measurements are
Not saved. Runtime
Mbean is available throughout the runtime. When a server instance is started, the server instantiates a serverruntimembean and fills it with running data.

B. Configuration mbean contains configuration information about servers and resources, which is stored in the XML configuration file of domain.

WebLogic does not provide mbeans for application modules.
1) each server in the domain has a copy of its own domain configuration document. During server startup, each server contacts adminserver to update its configuration file.

2) To change the domain configuration, the Management Server maintains a separate, editable copy of the domain configuration file, which is placed in the config/pending directory of the domain.

3) when the service instance is disabled, the config mbean on the server instance will be destroyed.

**************************************** *******************************
2. mbean's data model, through understanding the data model, can guide us to write general access logic.
Although the JMX specification does not force the organization of mbean models
Weblogic's domain configuration is described in XML format, so WebLogic uses a hierarchical model to organize mbeans to map XML structures. For example, Domain Configuration
The root of the document is that the elements below the root are sums. Each domain maintains a root element represented by a mbean of a separate type of domainmbean, within the domainmbean
The JMX attribute provides access and mbean methods.

**************************************** *******************************
3. All mbeans of Weblogic mbean object name must be registered in the mbean service based on the javax. Management. objectname type.
For more information, see the online documentation.

WebLogic service naming format: COM. BEA: Name = name, type = type [, typeofparentmbean = nameofparentmbean] [, typeofparentmbean1 = nameofparentmbean1]...

Com. Bea is the domain name of JMX. For WebLogic, the domain name of JMX is com. Bea. If you create mbean by yourself, you must name the domain name yourself.

Name = name, type = type [, typeofparentmbean = nameofparentmbean]
[, Typeofparentmbean1 = nameofparentmbean1]... is a key attribute of JMX. The key attribute is the key in the form of key = value.
Value pairs. The order of key attributes is not important. The name must start with COM. BEA.

**************************************** *******************************
4. mbean server. Is the core of the JMX proxy and acts as the mbean container.

The JVM of adminserver includes three mbean servers provided by BEA, which are:
Domainruntimembean server: Provides domain-specific services. Only adminserver has this instance.

Runtimembean server: provides monitoring, runtime control, and active configuration of specified server instances. Custom mbeans are also registered in this service. Each server in the domain has this instance.

Editmbean server: Provides pending configuration to lock, save, and activate changes through configurationmanagermbean.
Only adminserver has this instance.

**************************************** *******************************
**************************************** *******************************
5. The program structure analysis design describes some basic content of JMX in weblogic. Let's take a look at how to implement it.

First, let's sort out the requirements:

Monitors multiple weblogic9 servers, where servers are distributed on different physical/virtual hosts and proxy applications cannot be deployed on each server.

Monitor the server status. Currently, You need:
Whether the server is in production mode
Current JVM heap size
Connection Pool running status
In the future, the number of connections leaked by the connection pool and the number of times the connection pool fails to be reconnected may increase.

Secondly, we analyze the requirements. From the above requirements, we can summarize the following requirements:
The monitoring site of the program must support scalability and can be dynamically added
JMX Remote API connection is required
The monitoring points do not affect each other, that is, if a monitoring problem occurs, other monitoring items can continue to be executed.
Use email notification to analyze requirements and implementation mechanisms:
Dynamically add monitoring items
Provides configurable capabilities to write monitoring projects to the configuration file.
Provides plug-in capabilities, allowing you to write plug-ins to implement specific monitoring capabilities.
Use JMX for remote connection
Encapsulate three methods
Different monitoring sites
Multiple Threads are used to enable separate threads for each monitoring site.
Notification Mechanism
Use email notification. The email notification method can be configured.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.