手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL服务器部署Nagios监控

[日期:2014-10-10] 来源:Linux社区  作者:Linux [字体: ]

MySQL服务器部署Nagios监控

-- ulimit -n 65535
-- 监控nagios客户端强行安装
1,安装
[root@localhost nagios]# ll
总计 768
-rw-r--r-- 1 root root 713389 12-16 12:08 nagios-plugins-1.4.11-1.x86_64.rpm
-rw-r--r-- 1 root root  32706 12-16 12:09 nrpe-2.12-1.x86_64.rpm
-rw-r--r-- 1 root root  18997 12-16 12:08 nrpe-plugin-2.12-1.x86_64.rpm

Shell> rpm -ivh *.rpm --nodeps  --force

2,检测
[root@rdb-s108 nagios]# /usr/lib64/nagios/plugins/check_mysql -unagios -P3306 -S -Hlocalhost -ppwdnagios -s/opt/mysql/product/mysql/mysql3306.sock -d test -w 60 -c 100

3,加进配置文件里面去
[root@rdb-s108 nagios]# vim /etc/nagios/nrpe.cfg

command[check_mysqlapi]=/usr/lib64/nagios/plugins/check_mysql -unagios -P3306 -S -Hlocalhost -ppwdnagios -s/opt/mysql/product/mysql/mysql3306.sock -d test -w 60 -c 100
加监控主机服务器ip地址
allowed_hosts = 127.0.0.1,192.168.188.110,10.80.98.2

-- 赋予权限
chmod 775 /usr/lib/nagios/plugins/check_mysql
-- 磁盘监控,查看
fdisk -l
Disk /dev/sda: 193.2 GB, 193273528320 bytes
255 heads, 63 sectors/track, 23497 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      104391  83  Linux
/dev/sda2              14      23497  188635230  8e  Linux LVM

取 Disk 后面的 /dev/sda 作为磁盘监控

4,重启nagios,失败

5,先删除再启动
[root@rdb-s108 bin]# killall nrpe 【】先删除
[root@rdb-s108 local]#  /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
[root@rdb-s108 local]#

6,vim "/etc/nagios/nrpe.cfg" 看情况
注释:# command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
打开:#command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

grant SUPER,REPLICATION CLIENT on *.* to nagios@'localhost' identified by 'pwdnagios';

7,检测状况 service nrpe status

8,检查
shell> vim /etc/nagios/nrpe.cfg
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda
shell> fdisk -l
shell> service nrpe restart

网络监控器Nagios全攻略 http://www.linuxidc.com/Linux/2013-07/87067.htm

Nagios搭建与配置详解 http://www.linuxidc.com/Linux/2013-05/84848.htm

Nginx环境下构建Nagios监控平台 http://www.linuxidc.com/Linux/2011-07/38112.htm

在RHEL5.3上配置基本的Nagios系统(使用Nagios-3.1.2) http://www.linuxidc.com/Linux/2011-07/38129.htm

CentOS 5.5+Nginx+Nagios监控端和被控端安装配置指南 http://www.linuxidc.com/Linux/2011-09/44018.htm

Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用 http://www.linuxidc.com/Linux/2013-11/93047.htm

Nagios 的详细介绍请点这里
Nagios 的下载地址请点这里

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-10/107809.htm

linux
相关资讯       Nagios监控  Nagios监控MySQL 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款