Zabbix 监控MySQL主从状态(Python脚本)
1、在被监控机(Mysql Slave端)放置检查脚本: /usr/local/zabbix/bin/check_mysql_repl.py #!/usr/bin/python #coding:utf-8
1、在被监控机(Mysql Slave端)放置检查脚本:
/usr/local/zabbix/bin/check_mysql_repl.py
2、配置zabbix_agent.conf,添加Key和监控脚本:
vi /usr/local/zabbix/etc/zabbix_agentd.conf,文件最后添加以下两行:
UserParameter=mysql.repl_io,/usr/local/zabbix/bin/check_mysql_repl.py io UserParameter=mysql.repl_sql,/usr/local/zabbix/bin/check_mysql_repl.py sql
UserParameter是固定的
mysql.repl_io 是自定的Key,,下面添加监控项的时候用到
/usr/local/zabbix/bin/check_mysql_repl.py io 这一段就是上面的脚本及参数
重启zabbix_agentd
3、添加监控项:
4、添加触发器:
此触发器的作用是检测到脚本的返回值不是1就会报警。
就这样一个简单的监控主从配置就完成!~~

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



1. Download the import template directly and import the template through the following steps: Click configuration->templates>import->Import the downloaded xml file. 2. Configure the client key on the monitored host, open the /etc/zabbix/zabbix_agentd.conf configuration file, and add in the last line: UserParameter=redis_stats[*],redis-cli-h127.0.0.1-p$1info |grep$2|cut-d:-f2 After the configuration is completed, pass /etc/init.d/zabbix_agentdre

1. Zabbixserver and proxy install the mtrmtr script and place it in the following path of zabbixserver and proxy: execute chownzabbix:zabbixmtrtrace.shzabbix to create the mtrtrace template: 5. Associate the host to the template and observe the data in zabbix: [monitoring]-[latestdata]:

Introduction to SNMP 1 Overview of SNMP SNMP has developed to become the most widely used network management protocol. The currently applied versions mainly include SNMPv1, SNMPv2c and SNMPv3. The main differences between the versions are in the definition of information, the operation of communication protocols and the security mechanism. At the same time, two extensions of SNMP applications, remote network monitoring RMON (Remote Network Monitoring) and RMON2, have also appeared. From the perspective of the physical layer, using SNMP to manage the network should include: network management station (NMS), agent (Agent), and proxy server (proxy). NMS can generate commands and receive notification information. There must be at least one in the network management

Project Description The purpose of this project is to build a zabbix monitoring system that can implement WeChat alarms, conveniently monitor the entire NGINX cluster, and at the same time deploy and manage the entire cluster in batches. Project steps: Install zabbixserver on the zabbix server (192.168.2.138), install zabbixagent (192.168.2.58) on the nginx side, configure the Nginx load balancing cluster, and turn on status statistics. Write a monitoring script on the nginx side to get the status of nginx. The server-side web adds monitoring items and outputs pictures. Register the enterprise WeChat and configure the WeChat interface. Add the interface push script to the zabbix server and test that the interface is normal. in we

In JavaAPI development, monitoring management is a very important part. In order to ensure the stability and reliability of the application, we need to monitor various indicators, such as CPU usage, memory usage, network traffic, etc., and respond in a timely manner. In this case, Zabbix is an excellent monitoring tool. Zabbix is an open source monitoring solution that can monitor various parameters and services, including networks, servers, applications, databases, etc. It provides a powerful We

Case: zabbix configures nginx monitoring 1. Modify the configuration file vim/usr/local/nginx/conf/nginx.conflocation/nginx_status{stub_status;} Description: nginx_status custom field, access address (example: 192.168.169.131/nginx_status) stub_status fixed Parameter #Restart nginx./nginxreload Browser access status description: ActiveconnectionsNginx is processing the number of active links; important serverNginx starts to the present

Zabbix monitors nginxa machine: zabbix server (192.168.234.128) b machine: zabbix client (192.168.234.125) Operation on b machine (zabbix client): edit nginx virtual host configuration file: [root@centos~]#vi/ etc/nginx/conf.d/default.conf Add the following content in server{}: location/nginx_status{stub_statuson;access_logoff;allow127.0.0.1;denyall;}Reload ngi

The main tools used: Macros (divided into template macros, host macros, and automatically discovered macros) Host macro format: $MACRO (can fill in the value directly) Automatically discovered macros: #MACRO (needs to match the value of the created key) General structure 1. Agent host—the agent host creates the macro variable $MYSQLPORT. The value of the macro variable is the automatic discovery script parameter of Discoveryrules. 2. Template—Create automatic discovery rules in the template, relying on the automatic discovery script to obtain the automatic discovery macro variable. 3. Monitoring items – Create monitoring items in Discoveryrules. The names and key values of the monitoring items are automatically sent.
