阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

MySQL服务器部署Nagios监控

97次阅读
没有评论

共计 2117 个字符,预计需要花费 6 分钟才能阅读完成。

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 的下载地址:请点这里

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2117字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中