本帖最后由 乐橙306 于 2016-5-5 10:01 编辑
- 参考文档
- http://www.apelearn.com/bbs/thread-8087-1-1.html
- nagios
- server:118.192.147.6
- agent:118.192.147.101
- 系统软件安装环境:
- 关闭selinux iptables
- linux系统版本:CentOS 6.4 x64
- nagios版本:3.5.1
- 1.Nagios安装 - 服务端
- Centos6默认的yum源里没有nagios相关的rpm包,但是我们可以安装一个epel的扩展源:
- yum install -y epel-release
- 然后安装nagios相关的包
- yum install -y httpd nagios nagios-plugins nagios-plugins-all nrpe nagios-plugins-nrpe
- 设置登录nagios后台的用户和密码:htpasswd -c /etc/nagios/passwd nagiosadmin
- 检测配置文件:nagios -v /etc/nagios/nagios.cfg
- 启动服务:
- service httpd start
- service nagios start
- service nrpe start
- 浏览器访问: http://ip/nagios
- 2. Nagios安装 - 客户端
- 在客户端机器上
- yum install -y epel-release
- yum install -y nagios-plugins nagios-plugins-all nrpe nagios-plugins-nrpe
- vi /etc/nagios/nrpe.cfg 找到“allowed_hosts=127.0.0.1” 改为 “allowed_hosts=127.0.0.1,113.57.219.51” 后面的ip为服务端ip; 找到” dont_blame_nrpe=0” 改为 “dont_blame_nrpe=1”
- 启动客户端 /etc/init.d/nrpe start
- 3.服务端测试客户端数据
- [root@niaoyun-6 plugins]# cd /usr/lib64/nagios/plugins
- [root@niaoyun-6 plugins]# ./check_ping -H 118.192.147.101 -w 100,10% -c 200,20%
- PING OK - Packet loss = 0%, RTA = 0.37 ms|rta=0.371000ms;100.000000;200.000000;0.000000 pl=0%;10;20;0
编辑回复