某日Nagios突然开始时断时续的报错:
CHECK_NRPE: Socket timeout after 10 seconds.
不同的服务轮番timeout,也未找到其报错规律,时而报错时而恢复,导致大量的出错邮件。一开始以为只是网络的不稳定,一段时间后持续如此,那么得找下原因了。
报错的服务均在远程IDC机房,Nagios通过nrpe轮询IDC机房的一台主机(暂且称其为代理主机),而代理主机再通过nrpe轮询IDC机房内部各主机,简单架构图如下:
使用如上级联的结构,虽然有点麻烦,但是对外暴露的接口只需要有一个(代理主机上),一定程度上提高安全性。
在代理主机的日志中,看到如下出错信息:
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Aug 6 10:28:01 CH142 xinetd[21786]: FAIL: nrpe per_source_limit from=::ffff:111.222.33.4
Google了一下,了解到xinetd对单个IP每秒发起的查询数量有限制,代理主机上的NRPE正是依托于xinetd而存在的服务,所以默认受其约束。由于监控项的增多,代理主机的NRPE作为唯一入口,其每秒查询数也增大。这很好解释了为什么之前没有这个问题,最近才出现这个问题。
解决方案:
在/etc/xinetd.d/nrpe中添加
per_source = UNLIMITED
instances = UNLIMITED
然后重启xinetd, OK。
参考:
http://www.agitated.net/blog/?p=399
The post Nagios出错:FAIL nrpe per_source_limit appeared first on SQLParty.