91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nagios 監控mysql(check_mysql_health插件)

發布時間:2020-04-24 22:34:44 來源:網絡 閱讀:851 作者:yangzhimingg 欄目:移動開發
nagios 監控mysql(check_mysql_health插件)

http://labs.consol.de/wp-content/uploads/2011/08/check_mysql_health-2.1.7.tar.gz
 
# mount /dev/cdrom /media/cdrom
# rpm -ivh /media/cdrom/Server/perl-DBI-1.52-2.el5.i386.rpm
# rpm -ivh /media/cdrom/Server/perl-DBD-MsSQL-3.0007-2.el5.i386.rpm --nodeps
 
# tar zxf check_mysql_health-2.1.7.tar.gz
# cd check_mysql_health-2.1.7
# ./configure
# make && make install
 
# mysql -u root -p123456
> grant all on *.* to ming@'localhost' identified by '123456';
> quit
 
注:讓該用戶有訪問本地mysql的權限即可,可用mysql -u ming -p123456驗證,權限不一定給all

 
方式一(localhost監控):
 
# vi /usr/local/nagios/etc/objects/commands.cfg
 
define command{
        command_name    check_mysql_health
        command_line    $USER1$/check_mysql_health --hostname $ARG1$ --port $ARG2$ --username $ARG3$ --password $ARG4$ --mode $ARG5$
--warning $ARG6$ --critical $ARG7$
        }
:wq

# vi /usr/local/nagios/etc/objects/localhost.cfg

define service{
        use                             local-service         ; Name of service template to use
        host_name                       myhostname
        service_description             check_mysql_connections
        check_command                   check_mysql_health!192.168.1.10!3306!ming!123456!threads-connected!700!1000
        }

:wq
 

可先測試一下:
 
#./check_mysql_health --hostname 192.168.1.10 --port 3306 --username ming --password 123456 --mode threads-connected --warning 700 --critical 1000
 
注:在線程數(連接數)超過1000或無法連接時紅燈報警,線程數在700以內0以上為綠燈,700到1000之間為黃燈。
 
方式二(nrpe監控):
 
下面要借助于nrpe(nrpe安裝步驟略)

# vi /usr/local/nagios/etc/nrpe.cfg
command[check_mysql]=/usr/local/nagios/libexec/check_mysql_health --hostname 192.168.1.10 --port 3306 --username ming --password 123456 --mode threads-connected --warning 700 --critical 1500

:wq
 
重啟nrpe:
 
# killall nrpe
# /usr/local/nagios/bin/nrpe  -c /usr/local/nagios/etc/nrpe.cfg -d

# vi /usr/local/nagios/etc/objects/ming.cfg                     (ming.cfg為監控主機的文件,自建的)

define service{
        use                             local-service         ; Name of service template to use
        host_name                       myhostname
        service_description             check_mysql
        check_command                   check_nrpe!check_mysql
        }

:wq
 
 
附:
利用check_mysql_health實現多種監控模式:
       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)慢查詢
       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)
       slow-queries             (Slow queries)
       long-running-procs       (long running processes)
       cluster-ndbd-running     (ndnd nodes are up and running)
       sql                      (any sql command returning a single number)

 

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

从江县| 腾冲县| 纳雍县| 永定县| 随州市| 顺义区| 康马县| 莱西市| 鄂托克旗| 鄂温| 宝兴县| 乐安县| 都昌县| 称多县| 星子县| 抚宁县| 镇平县| 民勤县| 介休市| 阿坝县| 册亨县| 黎平县| 陕西省| 疏附县| 东乡| 大名县| 讷河市| 六安市| 梁山县| 黄平县| 凌云县| 连平县| 绥化市| 康乐县| 胶州市| 涟水县| 延长县| 九龙坡区| 永丰县| 前郭尔| 衡阳市|