nagios check_mysql uptime_【Linux】nagios plugin:check_mysql_health

[root@wallet03 ~]# yum install -y perl-DBI perl-DBD-MySQL perl-Time-HiRes

[root@wallet03 ~]# tar zxvf check_mysql_health-2.2.2.tar.gz

[root@wallet03 ~]# cd check_mysql_health-2.2.2

[root@wallet03 check_mysql_health-2.2.2]# ./configure

[root@wallet03 check_mysql_health-2.2.2]# make

[root@wallet03 check_mysql_health-2.2.2]# make install

[root@wallet03 ~]# cd /usr/local/nagios/libexec

[root@wallet03 libexec]# ./check_mysql_health --help

Copyright (c) 2009 Gerhard Lausser

Check various parameters of MySQL databases

Usage:

check_mysql_health [-v] [-t ] [[--hostname ]

[--port | --socket ]

--username --password ] --mode

[--method mysql]

check_mysql_health [-h | --help]

check_mysql_health [-V | --version]

Options:

--hostname

the database server's hostname

--port

the database's port. (default: 3306)

--socket

the database's unix socket.

--username

the mysql db user

--password

the mysql db user's password

--database

the database's name. (default: information_schema)

--replication-user

the database's replication user name (default: replication)

--warning

the warning range

--critical

the critical range

--mode

the mode of the plugin. select one of the following keywords:

connection-time (Time to connect to the server)

uptime (Time the server is running)

threads-connected (Number of currently open connections)

threadcache-hitrate (Hit rate of the thread-cache)

threads-created (Number of threads created per sec)

threads-running (Number of currently running threads)

threads-cached (Number of currently cached threads)

connects-aborted (Number of aborted connections per sec)

clients-aborted (Number of aborted connections (because the client died) per sec)

slave-lag (Seconds behind master)

slave-io-running (Slave io running: Yes)

slave-sql-running (Slave sql running: Yes)

qcache-hitrate (Query cache hitrate)

qcache-lowmem-prunes (Query cache entries pruned because of low memory)

keycache-hitrate (MyISAM key cache hitrate)

bufferpool-hitrate (InnoDB buffer pool hitrate)

bufferpool-wait-free (InnoDB buffer pool waits for clean page available)

log-waits (InnoDB log waits because of a too small log buffer)

tablecache-hitrate (Table cache hitrate)

table-lock-contention (Table lock contention)

index-usage (Usage of indices)

tmp-disk-tables (Percent of temp tables created on disk)

table-fragmentation (Show tables which should be optimized)

open-files (Percent of opened files)

slow-queries (Slow queries)

long-running-procs (long running processes)

cluster-ndbd-running (ndnd nodes are up and running)

sql

[root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.30.50 --username nagios --password nagios --mode connection-time

OK - 0.02 seconds to connect as nagios | connection_time=0.0213s;1;5

[root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.30.50 --username nagios --password nagios --mode uptime

OK - database is up since 226209 minutes | uptime=13572561s

[root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.30.50 --username nagios --password nagios --mode slave-lag

OK - Slave is 0 seconds behind master | slave_lag=0;10;20

[root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.30.50 --username nagios --password nagios --mode slave-io-running

OK - Slave io is running

[root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.30.50 --username nagios --password nagios --mode slave-sql-running

OK - Slave sql is running

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值