免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 39918 | 回复: 16
打印 上一主题 下一主题

高手请进nagios: nrpe Connection refused by host!!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-08 11:05 |只看该作者 |倒序浏览
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 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-09-08 14:00 |只看该作者
修改nrpe.cfg配置文件
   server_address=127.0.0.1      
    allowed_hosts=192.168.1.115,127.0.0.1   //192.168.1.115是我的监控机

是不是上面配置不对

论坛徽章:
0
3 [报告]
发表于 2009-09-08 14:29 |只看该作者

回复 #2 deargodzw 的帖子

配置是没问题,我在想是不是SSL的问题

论坛徽章:
8
戌狗
日期:2014-09-26 16:39:44水瓶座
日期:2014-10-10 02:06:57金牛座
日期:2014-10-11 23:04:042015亚冠之首尔
日期:2015-06-23 15:37:0015-16赛季CBA联赛之天津
日期:2016-01-22 18:58:2915-16赛季CBA联赛之佛山
日期:2016-05-31 19:18:0815-16赛季CBA联赛之同曦
日期:2016-08-10 16:26:3315-16赛季CBA联赛之辽宁
日期:2018-01-10 11:47:40
4 [报告]
发表于 2009-09-08 14:51 |只看该作者
我是直接把nrpe加到xinetd进程中的

论坛徽章:
0
5 [报告]
发表于 2010-12-30 16:19 |只看该作者
你找到解决方法没? 找到了可以说一下吗?     我也遇到你这个问题!

论坛徽章:
0
6 [报告]
发表于 2011-05-20 14:15 |只看该作者
修改一句话
allowed_hosts=192.168.1.115,127.0.0.1,192.168.1.113

论坛徽章:
0
7 [报告]
发表于 2011-05-20 16:16 |只看该作者
{:3_195:}

论坛徽章:
0
8 [报告]
发表于 2011-08-08 15:23 |只看该作者
两端的5666都在监听吗/还有修改被监控端的nrpe.cfg文件,ip写上监控主机的ip

论坛徽章:
0
9 [报告]
发表于 2011-08-23 17:42 |只看该作者
http://hi.baidu.com/hanyan_007/b ... 26eedfb745ae0c.html

希望对大家有点帮助{:2_176:}

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
10 [报告]
发表于 2011-08-23 22:00 |只看该作者
应该是配置不准确。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP