nagios 监控mysql

发布时间:2020-04-09 00:51:27 作者:yang12313
来源:网络 阅读:700

安装nrpe-2.13.tar.gz   nagios-plugins-1.4.15.tar.gz
vim commands.cfg
加入:
#vim'check_mysql'  command definition

define command {      

command_name    check_mysql    

command_line  $USER1$/check_mysql  -H $HOSTADDRESS$  -u nagios  -d nagios 

vim  localhost.cfg (没有采用自定配置文件service.cgf这类的。我的是本机监控)
加入
define service{       

use          local-service    ;Name of service template to  use        host_name    192.168.1.204       

service_description    MYSQL       

check_command     check_mysql       

notifications_enabled    0

(或者check_nrpe!check_mysql 这个根据自己来,我本机上加上了check_nrpe就不能运行{看到有文章用 check_nrpe!check_mysql })

nrpe.cnf配置 pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,192.168.1.204
dont_blame_nrpe=0
debug=0
command_timeout=60
connection_timeout=300
command[check_mysql]=/usr/local/nagios/libexec/check_mysql  -m connection-time -u xxxx -p xxxxxx  -P 3306  -H 192.168.1.204(在本地不需要添加-H选项)
停止nrpe  ps -ef | grep  nrpe        kill (-9)  pid启动nrpe: /usr/local/nagios/libexec/bin/nrpe  -c /usr/local/nagios/etc/nrpe.cfg -d

重启nagios  service  nagios  restart

推荐阅读:
  1. nagios如何安装
  2. 搭建nagios监控步骤

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql 监控 数据库

上一篇:Kubernetes部署(九):CoreDNS、Dashboard、Ingress部署

下一篇:2.域环境下安装准备

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》