Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Nagios > 正文

nagios客户端安装

时间:2014-12-24 23:15 来源:未知 作者:www.51ou.com 阅读:

nagios客户端安装:

环境准备和服务端相差无几,按照服务端的准备即可,但无需lamp 环境;

 

!!!安装插件nagios-plugins-1.4.16.tar.gz 、nrpe-2.12.tar.gz 与服务端一致

 

#安装一个系统性能的命令

yum install sysstat -y

 

 

#安装监控的插件

tar zxf Params-Validate-0.91.tar.gz
cd Params-Validate-0.91
perl Makefile.PL
make
make install

 

tar zxvf Class-Accessor-0.31.tar.gz
cd Class-Accessor-0.31
perl Makefile.PL
make

make install
cd ../

tar zxvf Config-Tiny-2.12.tar.gz
cd Config-Tiny-2.12
perl Makefile.PL
make
make install
cd ../

 

tar zxvf Math-Calc-Units-1.07.tar.gz
cd Math-Calc-Units-1.07
perl Makefile.PL
make
make install
cd ..

 

tar zxvf Regexp-Common-2010010201.tar.gz
cd Regexp-Common-2010010201
perl Makefile.PL
make
make install
cd ..


tar zxvf Nagios-Plugin-0.34.tar.gz
cd Nagios-Plugin-0.34
perl Makefile.PL
make
make install
cd ../

 

拷贝插件到libexec

cp -ap  check_memory.pl  /usr/local/nagios/libexec/
cp -ap check_iostat  /usr/local/nagios/libexec/

#见附件
授权
chmod 755 /usr/local/nagios/libexec/check_memory.pl
chmod 755 /usr/local/nagios/libexec/check_iostat

 

编辑配置文件nrpe

备份:cp /usr/local/nagios/etc/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg.ori
sed -i '199,203d' /usr/local/nagios/etc/nrpe.cfg

 

添加基本插件调用

echo "command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,6 -c 30,25,20">>/usr/local/nagios/etc/nrpe.cfg
echo "command[check_mem]=/usr/local/nagios/libexec/check_memory.pl -w 6% -c 3%">>/usr/local/nagios/etc/nrpe.cfg
echo "command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 8% -p /">>/usr/local/nagios/etc/nrpe.cfg
echo "command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%">>/usr/local/nagios/etc/nrpe.cfg
echo "command[check_iostat]=/usr/local/nagios/libexec/check_iostat -w 6 -c 10">>/usr/local/nagios/etc/nrpe.cfg

 

启动nrpe

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

#-c 指定配置文件 -d 后台启动

echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d">>/etc/rc.local

#设置开机自启动

ss -anp | grep 5666

#查看端口

客户端安装、配置完毕

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《 nagios客户端安装》技术文章,《 nagios客户端安装》详细使用和说明,有时《 nagios客户端安装》可能不完善、敬请谅解!如果《 nagios客户端安装》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片