Percona Nagios Plugins Installation and Configuration
Percona Nagios Plugins Installation and Configuration
本文主要講述了用percona-monitoring-plugins-nagios監控mysql的配置方法。
1 下載percona monitor nagios外掛
cd /usr/local/src
wget
tar -xzf percona-monitoring-plugins-1.1.5.tar.gz
cd percona-monitoring-plugins-1.1.5/nagios/bin
cp * /usr/local/nagios/libexec/
2 配置nagios server外掛目錄
vi /usr/local/nagios/etc/resource.cfg
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec
3 在nagios server上的配置
在nagios server端:
vi /usr/local/nagios/etc/objects/ commands.cfg
define command{
command_name check_nrpe_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$
}
define command{
command_name check_mysql_service
command_line $USER1$/check_mysql -H $HOSTADDRESS$ --extra-opts=client@/etc/nagios/mysql.cnf
}
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
define command{
command_name check_mysql_connections
command_line $USER1$/pmp-check-mysql-status -H $HOSTADDRESS$ -x Threads_connected -o / -y max_connections -T pct -w 80 -c 95
}
define command{
command_name check_mysql_active_threads
command_line $USER1$/pmp-check-mysql-status -H $HOSTADDRESS$ -x Threads_running -w $ARG1$ -c $ARG2$
}
define command{
command_name check_mysql_processlist
command_line $USER1$/pmp-check-mysql-processlist -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
define command {
command_name check_mysql_innodb
command_line $USER1$/pmp-check-mysql-innodb -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
define command{
command_name check_mysql_replication_delay
command_line $USER1$/pmp-check-mysql-replication-delay -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
}
define command{
command_name check_mysql_replication_running
command_line $USER1$/pmp-check-mysql-replication-running -H $HOSTADDRESS$
}
define command{
command_name check_mysql_deadlocks
command_line $USER1$/pmp-check-mysql-deadlocks -H $HOSTADDRESS$ -i 5 -w 12 -c 60
}
define command{
command_name check_mysql_table_checksum
command_line $USER1$/pmp-check-pt-table-checksum -H $HOSTADDRESS$
}
在nagios server端:
vim /usr/local/nagios/etc/servers/mysql/ mysql02-2.111.cfg
### percona monitor plugin for mysql ################
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description NRPE Service
check_command check_nrpe_service
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Service
check_command check_mysql_service
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description Free Memory
check_command check_nrpe!rdba_unix_memory
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL PID
check_command check_nrpe!rdba_mysql_pidfile
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Processlist
check_command check_mysql_processlist!states_count!16!32
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL User Connections
check_command check_mysql_processlist!max_user_conn!90!95
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Connections
check_command check_mysql_connections
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Active Threads
check_command check_mysql_active_threads!40!400
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL InnoDB Idle Blocker
check_command check_mysql_innodb!idle_blocker_duration!60!600
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL InnoDB Long Transaction
check_command check_mysql_innodb!max_duration!86400!172800
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL InnoDB Lock Waits
check_command check_mysql_innodb!waiter_count!10!25
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Replication Running
check_command check_mysql_replication_running
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Replication Delay
check_command check_mysql_replication_delay!300!600
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Deadlocks
check_command check_mysql_deadlocks
}
define service{
use mysql,srv-pnp
host_name mysql02-2.111
service_description MySQL Table Checksums
check_command check_mysql_table_checksum
}
在nagios server端:
cat /etc/nagios/mysql.cnf
[client]
user=nagios
password=123456
chown root:nagios /etc/nagios/mysql.cnf
chmod 640 /etc/nagios/mysql.cnf
重啟nagios 服務
/etc/init.d/nagios restart
4 在被監控的mysql端上的配置
建立mysql使用者,讓nagios可以連線:
GRANT processlist,SELECT, REPLICATION CLIENT on *.* to 'nagios'@'nagios server ip' IDENTIFIED BY 'nagios';
cat /usr/local/nagios/etc/nrpe.cfg
新增如下兩行:
## percona monitor plugin for mysql ###
command[rdba_unix_memory]=/usr/local/nagios/libexec/pmp-check-unix-memory -d -w 96 -c 98
command[rdba_mysql_pidfile]=/usr/local/nagios/libexec/pmp-check-mysql-pidfile
最終訪問nagios的監控如下:
5 參考文件
http://kedar.nitty-witty.com/blog/install-percona-monitoring-tools-for-nagios-mysql-plugins
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28916011/viewspace-2134513/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用Percona Monitoring Plugins模板監控MySQLPluginMySql
- CentOS原始碼安裝、配置Nagios(core)+PluginsCentOS原始碼iOSPlugin
- GoldenGate<一> step by step installation and configurationGo
- Nginx下構建nagios監控平臺Nagios+nrpe+nagios-plugins+pnp安裝文件薦NginxiOSPlugin
- Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.iOSError
- Oracle DB Installation and Configuration Requirements Quick Reference-169706.1OracleUIREM
- ASM 11.2 Configuration KIT (ASM 11gR2 Installation & Configuration, Deinstallation, Upgrade, ASM JobASM
- Mvvmcross Plugins - Cirrious.MvvmCross.Plugins.MessengerMVVMROSPluginMessenger
- Jquery PluginsjQueryPlugin
- Post Installation for Databases Created after Installation of 10.2.0.4.4Database
- LDAP Server InstallationLDAServer
- Mysql MAC installationMySqlMac
- installation tips
- Facebook之Social PluginsPlugin
- cacti+nagios之nagios的搭建(三)iOS
- cacti+nagios 之cacti整合nagios(四)iOS
- nagios 搭建iOS
- 2.3.3.2 Application InstallationAPP
- .NET Core installation for DockerDocker
- How to cleanup ASM installationASM
- Go 1.8 的 Plugins 使用GoPlugin
- gulp 和 gulp plugins 使用Plugin
- vite plugins小試牛刀VitePlugin
- MySQL Percona XtraBackupMySql
- nagios安裝配置pnp4nagios-0.6.6薦iOS
- nagios安裝iOS
- Nagios簡介iOS
- Ubuntu下nagios安裝pnp4nagios外掛UbuntuiOS
- Oracle 10g installationOracle 10g
- RHEL_PXE_Installation_ServerServer
- webpack學習(四)配置pluginsWebPlugin
- webpack3--plugins大用處WebPlugin
- Unity Plugins的使用方法UnityPlugin
- 【漢化】Yanfly Engine Plugins - TemplatePlugin
- Innodb plugins 的安裝(一)Plugin
- Innodb plugins 的安裝(二)Plugin
- Innodb plugins 的安裝(三)Plugin
- nagios mail告警通知iOSAI