日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

nagios check_mysql uptime_nagios使用check_mysql监控mysql

發布時間:2023/12/1 数据库 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nagios check_mysql uptime_nagios使用check_mysql监控mysql 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

如果沒有check_mysql插件,需要安裝Mysql數據庫

1、建立專用數據庫: [root@svr3 ~]#mysql -u root -p

Enter password:

Welcome to the MySQL monitor. ?Commands end with ; or \g.

Your MySQL connection id is 51910

Server version: 5.5.3-m3-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database nagios;

Query OK, 1 row affected (0.00 sec)

mysql> grant select on nagios.* to nagios@'%' identified by '123qweasd';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> select User,Password,Host from user;

+----------------+-------------------------------------------+------------------+

| User ? ? ? ? ? | Password ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| Host ? ? ? ? ? ? |

+----------------+-------------------------------------------+------------------+

| root ? ? ? ? ? | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 | localhost ? ? ? ?|

| nagios ? ? ? ? | *A1F1CB851D62F002C09A0C9C4A76262473432F55 | % ? ? ? ? ? ? ? ?|

+----------------+-------------------------------------------+------------------+

14 rows in set (0.00 sec)

12 rows in set (0.00 sec)

2.測試check_mysql

[root@svr3 ~]# /usr/local/nagios/libexec/check_mysql -H 10.1.1.30 -u nagios -d nagios -p 123qweasd

Uptime: 970046 ?Threads: 1 ?Questions: 684583 ?Slow queries: 3 ?Opens: 672 ?Flush tables: 1 ?Open tables: 369 ?Queries per second avg: 0.705 3.在command.cfg里增加插件命令: #check mysql define command{ command_name check_mysql command_line $USER1$/check_mysql -H $HOSTADDRESS$ -u nagios -d nagios -p 123qweasd } ?4.在localhost.cfg里定義服務 define service { ? ? ? ? host_name svr3.labexam.com ? ? ? ? service_description MysqlDB ? ? ? ? check_period 24x7 ? ? ? ? max_check_attempts 2 ? ? ? ? normal_check_interval 1 ? ? ? ? retry_check_interval 1 ? ? ? ? contact_groups sagroup,dbagroup ? ? ? ? notification_interval 5 ? ? ? ? notification_period 24x7 ? ? ? ? notification_options w,u,c,r ? ? ? ? check_command check_mysql }

總結

以上是生活随笔為你收集整理的nagios check_mysql uptime_nagios使用check_mysql监控mysql的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。