Chinaunix首页 | 论坛 | 博客
  • 博客访问: 313170
  • 博文数量: 103
  • 博客积分: 1590
  • 博客等级: 上尉
  • 技术积分: 1075
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-02 10:17
文章分类

全部博文(103)

文章存档

2013年(32)

2012年(7)

2010年(64)

我的朋友

分类: LINUX

2010-02-21 15:35:16

nagios:插件下载

1.服务器,客户端安装nrpe模块,安装必要的软件:

yum mysql-devel
yum install gcc glibc glibc-common
yum install openssl-devel

其中 mysql-devel安装是因为在编译nagios的mysql插件的时候我们需要用到mysql.h等文件。而openssl也是必须安装的nrpe之间的通信是走的ssl通道。

2. 安装nrpe软件,需要先安装nagios官方扩展:

useradd -d /usr/local/nagios -s /sbin/nologin nagios
 
wget http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.13.tar.gz
tar xvfz nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
 
./configure --prefix=/usr/local/nagios
make && make install
 
wget http://nchc.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
tar xvfz nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --prefix=/usr/local/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
 
chown -R nagios.nagios /usr/local/nagios/libexec

其中添加nagios用户是因为希望mysql监测插件不要以root身份运行。

3.编辑nrpe配置文件

主要是配置客户端nrpe

vi /usr/local/nagios/etc/nrpe.cfg

修改两个地方的设置,一个是本机地址,一个是受控服务器地址(nagios服务器地址)

server_address=192.168.0.115
allowed_hosts=192.168.0.114

服务器端测试

./check_nrpe -H 192.168.0.115 -p 5666 -c check_load
/usr/local/nagios/libexec/check_nrpe -H 192.168.0.115

两条指令均正确执行而无错则证明nrpe已经正确安装并且正常工作了。

4.安装mysql监测插件check_mysql_perf

wget http://

安装check_mysql_perf之前一定要先编译一些nagios官方扩展nagios-plugins-1.4.13

cd nagios-plugins-1.4.13
./configure --prefix=/usr/local/nagios
make

安装check_mysql_perf

tar zxvf check_mysql_perf-1.3.2.3.tar.gz
cd check_mysql_perf-1.3.2.3
./configure --prefix=/usr/local/nagios --with-officialplugins=/root/download/nagios-plugins-1.4.13  --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

安装完之后在/usr/local/nagios/libexec下会有check_mysql_perf,安装成功。

安装成功之后检测:

libexec/check_mysql_perf -m qcache-hitrate  -H 192.168.1.115 -u nagios -d nagiosdb

提示用户没有权限,这时候只要我们建立一个只可以访问nagiosdb的nagios用户就可以开始监测mysql服务器了。

监控端和服务端都需要安装此插件。

 

相关文章:

  • 原文链接:
  • 阅读(451) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~