Tags: jmx server system monitoring cpu virtual machineNext, we provide another implementation method:First look at a class diagram:JDK implements nine built-in mbeans that can monitor all the information of virtual machines: ManagementFactoryThe factory class can get the corresponding MBean instance through ObjectName, and naturally the desired data can be obtained.2 The code is as follows:Package pyc. jvm.
.
Third, test whether JMX successfully configured
Start Tomcat, enter in Windows command window: Netstat-aon | Findstr "8999" If this port is already in use, it proves that the JMX configuration was successful
Four, turn on JMX monitoring
Run%java_home%\lib\jconsole.jar
Enter Tomcat machine IP, port input 8999
If you
server address)
Go to the JDK installation directory, under the/jre/lib/management directory, to view the files. and modify the Jmxremote.access file, the last two lines of the file display "Monitorrole and controlrole" comment cancellation, where monitorrole is only the role of read-only permissions, Controlrole have higher permissions: Read-write, and so on. After editing is complete, save.
By default, the Jmxremote.password file does not exist in this directory, we can rename the Jmxremo
Monitoring Zabbix using JMX to monitor Tomcat
1. Install the java tool on the zabix server (zabbix has been installed on the server)
[Root @ db02 ~] # Rpm-ivhHttp://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-java-gateway-2.4.7-1.el6.x86_64.rpm
[Root @ db02 ~] # Vim/etc/zabbix/zabbix_server.confJavaGateway = 127.0.0.1JavaGatewayPort = 10055Startjavapolers = 5[Root @ db02 ~] # Vim/etc/zabbix/zabbix_java_
Tomcat Modify Configurationcatalina.sh file Join
Export catalina_opts= "-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.authenticate=false- dcom.sun.management.jmxremote.ssl=false-djava.rmi.server.hostname=192.168.100.42- dcom.sun.management.jmxremote.port=12345 "2.tomcat/lib Join Catalina-jmx-remote.jar3. Restart Tomcat4. To detect if the client jmx is successful, enter the following comm
Due to the use of proxy distributed monitoring, it is necessary to install Java_getway on the proxy side. That is, when compiling, add--enable-java
Modify Zabbix_java related optionsGo to the directory below for seeting.sh script editing; start the./startup.sh to see if Port 10052 is startedlisten_ip = "0.0.0.0" Listen_port = 10052 Pid_file = "/tmp/zabbix_java.pid"start_pollers = 5
Modify the proxy configuration file and the server configuration f
After getting familiar with JMX, the problem is that mbean is located on a remote server and RMI is required for access. JMX also provides the RMI method.
Based on the JMX example helloagent. Java mentioned in the previous article
Import java. Lang. Management. managementfactory;Import javax. Management. mbeanserver;I
();}}This code first creates an MBean Server instance and an Html adapter instance. The MBean Server is created using a factory class. When the MBean Server is created, the input string is used as the domain name of the MBean Server. The domain name is the identifier of the MBean Server.Next, instantiate HelloWorld MBean and register it in MBean Server. An ObjectName instance is used for registration. The ObjectName class provides a naming system for MBean in
This article describes how to use the Python Dynamic Monitor program log content. the dynamic here refers to the constant addition of new log content to log files, dynamic Monitoring refers to the monitoring log new append log content log files are generally generated by day, by judging the file generation date and the current time in the program, change the monitoring
monitored by default:10. nagios configuration file descriptionAfter nagios is installed, the main directory is/usr/local/nagios. All configuration files are in the/usr/local/nagios/etc directory:Cgi. cfgHtpasswd. users // used for web login verification.Nagios. cfg // Main configuration file of nagios. If you are monitoring other hosts, you need to add configuration files for other hosts.Resource. cfg // defines the location of the nagios plug-inThe
Real-time air quality monitoring data can reflect real-time air quality, air quality real-time monitoring data interfaces can query the latest air quality results in different cities, air quality data in recent weeks, and data from various monitoring points.Interface Name: Air quality real-time monitoring dataInterface
Generally, log files are generated on a daily basis. The program judges the file generation date and current time, and replaces the monitored log files.The program is just a simple example, monitoring test1.log 10 seconds, to monitoring test2.log
Program monitoring uses the linux Command tail-f to dynamically monitor n
Here to monitor memory usage as an example, write a simple demo program, the specific operation according to the 51reboot tutorials written below.
First, the establishment of a database to build tables
To create a Falcon database:
Mysql> CREATE DATABASE Falcon character set UTF8;Query OK, 1 row Affected (0.00 sec)To create the table stat used by memory monitoring, the table structure is as follows:
CREA
After installing the COLLECTD tool on the host, you can obtain data such as cpu,memery,if-traffic of the virtual machine on the host by using the COLLECTD tool. Monitoring of these data can be achieved through Nagios monitoring scripts.The following is a simple monitoring virtual machine memory script:#!/bin/bash#desc:tocheckmemoryaboutvminstancestate_ok=0state_w
1 Dnspython Processing module installation, source modewget http://www.dnspython.org/kits/1.9.4/dnspython-1.9.4.tar.gzTar zxf dnspython-1.9.4.tar.gzCD dnspython-1.9.4/Python setup.py Install2 parsing examplesA record query example#!/usr/bin/env python#-*-coding:utf-8-*-import dns.resolverdomain = raw_input ("Please enter a domain name to resolve:") A = Dns.resolver.query (Domain, ' A ') for I in A.response.answer:for j in i.items:if J.rdtype = = 1:pri
Scroll event Implementation Monitoring scroll bar and pagination display example (zepto.js )Requirements: in the app landing page at the bottom of the previous User's purchase record, request this div box only show 3 and a half, but a page has 10, the Div sliding bar to the bottom of the page to automatically load the next page of concurrent loading buried Point.Implementation: first understand three concep
This article mainly introduces the jquery scroll event Implementation Monitoring scroll bar Paging Simple example, using AJAX to load, and also introduced (document). Height () and the difference between the height (), which is required for friends to refer to below.The Scroll event applies to the Window object, but can also scroll the iframe frame with the CSS overflow property set to the scroll element.1$
Share an AIX process monitoring script:When the number of MWM processes is greater than 2 o'clock, call SendMail to send the message to notify the user, the script is as follows#!/usr/bin/ksh#---------------------------------------------------------------##scriptname: MWMCheckShell#Createdby:Xin23# on:2015.02.04#------------------------------------------------------ ---------##definedirectorymwmcheckdir=/home/monitor/mwm_check_ dircd $MWMCHECKDIR #def
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.