- 论坛徽章:
- 0
|
5可用积分
我在安装nagios过程中, 监控机和被监控机的配置都配好了,可以监控端口了,我在被监控机(192.168.1.113)上装好了nagios-plugin 、nrpe,如下:
[root@yibaner install]# useradd nagios -s /sbin/nologin -M
[root@yibaner install]# tar xvf nagios-plugins-1.4.13.tar
[root@yibaner install]# cd nagios-plugins-1.4.13
[root@yibaner nagios-plugins-1.4.13]# ./configure --prefix=/usr/local/nagios
[root@yibaner nagios-plugins-1.4.13]# make && make install
[root@yibaner nagios-plugins-1.4.13]# chown -R nagios:nagios /usr/local/nagios/ //修改文件权限
(2) nrpe的程序的安装:
[root@yibaner src]# tar zxvf nrpe-2.12.tar.gz
[root@yibaner nrpe-2.12]# cd nrpe-2.12
[root@yibaner nrpe-2.12]# ./configure
[root@yibaner nrpe-2.12]# make all
[root@yibaner nrpe-2.12]# make install-plugin
[root@yibaner nrpe-2.12]# make install-daemon
[root@yibaner nrpe-2.12]# make install-daemon-config //都没报错
修改nrpe.cfg配置文件
server_address=127.0.0.1
allowed_hosts=192.168.1.115,127.0.0.1 //192.168.1.115是我的监控机
[root@localhost ~]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
[root@localhost ~]# netstat -apl | grep 5666
tcp 0 0 localhost.localdomain:5666 *:* LISTEN 3582/nrpe
5666端口也开启了,iptables我也关了!
[root@yibaner nrpe-2.12]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
正常的返回值为被监控服务器上安装的NRPE的版本信息:
NRPE v2.12
在监控机上我装上了nrpe,安装如下:
[root@server1 yahoon]# tar -zxvf nrpe-2.8.1.tar.gz
[root@server1 yahoon]# cd nrpe-2.8.1
[root@server1 nrpe-2.8.1]# ./configure
[root@server1 nrpe-2.8.1]# make all
[root@server1 nrpe-2.8.1]# make install-plugin //成功配置,都不报错的
iptables也关了
测试:
[root@server1 nrpe-2.8.1]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.113 //113是我的被监控机
显示如下:Connection refused by host
什么原因!谢谢了!非常谢谢!
我在115监控机用telnet连113上的5666时出现如下:
[root@localhost nagios]# telnet 192.168.1.113 5666
Trying 192.168.1.113...
telnet: connect to address 192.168.1.113: Connection refused
telnet: Unable to connect to remote host: Connection refused
这是不是说明5666端口关闭了? 可是端口5666确实是开启了,iptables也关了,selinux 也关了 ,两台电脑之间能PING通,我都测试了,这又是什么原因呢?搞晕了!
[ 本帖最后由 lm870403 于 2009-9-8 15:17 编辑 ] |
|