[0031] Embodiment two:
[0032] Please refer to figure 2 , The monitoring method based on the J2EE architecture in this embodiment includes the following processing procedures:
[0033] Step 1: Configure the monitoring agent on the monitored device, and configure the monitoring server on the J2EE WEB container;
[0034] Step 2: Configure basic monitoring information on the monitoring server and start the monitoring server;
[0035] Step 3: The monitoring agent registers with the monitoring server, loads or configures the plug-in and the corresponding plug-in configuration file according to the instructions and data of the monitoring server, and feeds back the basic information of the monitoring agent to the monitoring server; The information sent by the monitoring server can be transmitted through the HTTP protocol, and the information sent by the monitoring server to the monitoring agent can be transmitted through the TCP/IP protocol;
[0036] Step 4: The monitoring agent obtains relevant data of the monitored device through the plug-in, and interacts with the monitoring server to complete the monitoring of the monitored device by interacting instructions and data.
[0037] The implementation process of the plug-in will be described in detail below. The plug-in of the present invention tyes the same type of interface into an independent jar package without any dependency. For example, if you want to obtain operating system information and tomcat information, put the interface for obtaining operating system and the interface for obtaining tomcat information into two jar packages, named system_plugin.jar and tomcat_plugin.jar respectively.
[0038] Embodiment two:
[0039] Please refer to image 3 In this embodiment, the monitoring system structure based on the J2EE architecture. In the figure, the monitoring agent (hereinafter referred to as Agent) and the monitoring server (hereinafter referred to as Server) are distributed on two servers, and the Agent and Server can also be distributed in one physical On the machine.
[0040] In the figure, 0001 and 0014 represent the operating systems of Agent and Server respectively. 0002 and 0015 represent the JVM of Agent and Server respectively. 0003 is an Agent management application module, deployed under JVM, mainly used to interact with Server and detect plug-ins and obtain plug-in data during runtime. 0004 is a Java application deployed under the JVM. The monitored object is deployed on the same machine as the Agent, independent of the Agent. 0005 is a non-Java application. The monitored object is deployed on the same machine as the Agent, independent of the Agent. 0006 is a monitoring plug-in used to obtain 0004 application data. When the server initiates a request command, the agent calls the plug-in interface to obtain the data and return it to the server after receiving it. 0007, 0008, and 0009 respectively correspond to JVM, non-Java applications, and operating system plug-ins. The principle is the same as 0006. 0010 and 0011 are the calling methods. When the web plug-in calls the web interface, it is called through JMX, and the two modules are low-coupling. The above 0006,0007,0008,0009 is the main core of the Agent side. These plugins are just examples, and you can add plugins for many projects. When the Agent is running, you can delete any one or more of the plug-ins, or you can add other plug-ins without causing the normal operation of the Agent. After the Agent is started, it will automatically start the plug-in detector to check whether the plug-ins exist. 0012 is the transmission protocol from Server to Agent, and is the TCP/IP protocol used in this embodiment. 0013 is the transfer protocol from Agent to Server, the HTTP protocol used by this system. 0016 is a J2EE Web container, based on JVM, this embodiment uses the open source TOMCAT. 0017 is the server-side working module, deployed under the J2EE container. After the server sends the request command, it receives the monitoring data sent by the agent, and saves, analyzes, and diagnoses the data. 0018 is a browser or a device with the same function. It is mainly used to manage the Server side, monitor indicators, view monitoring data, analyze and diagnose results. 0019 is the database, which is deployed on the Server or independently deployed on another server.
[0041] The monitoring processing steps of this embodiment are as follows:
[0042] Step 1: Start the server terminal 0017, the server work module reads the database related information, and detects whether there is an Agent.
[0043] Step 2: Start the Agent management application module 0003 and register it on the Server. The Agent starts the plug-in detector to detect whether the plug-in 0006, 0007, 0008, 0009 exists, and the Agent transmits the detected data and basic information of the Agent to the Server side for storage.
[0044] Step 3: Log in to the browser 0018 on the server side, and check the information indicators sent by each agent that can be monitored.
[0045] Step 4: Operate on the browser 0018 to add monitoring indicators to be monitored or delete indicators that are being monitored. At this time, the 0006,0007,0008,0009 plug-in starts to be monitored.
[0046] Step 5: When the Agent management application module is running, the Agent plug-in status is detected, and the latest plug-in status is sent to the Server.
[0047] Step 6: The server sends the execution corresponding to the monitored index to the agent at a fixed time or in real time. After the agent obtains the command, it collects the corresponding monitoring index and returns to the server, and the server saves, analyzes, and diagnoses the monitoring data.
[0048] Step 7: The data obtained by the server is displayed on the browser 0018.