Nagios CHECK_NRPE: Socket timeout after 10 seconds

来源:互联网 发布:邮件营销软件sudm 编辑:程序博客网 时间:2024/05/11 15:41

两种方式:

方式一,

nrpe 进程执行某些脚本可能是大于10秒钟,而默认的是10秒钟。所以会发报警信息,解决的方法如下:

 define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 30   # 加上一个 -t 30 指定时间为 30 秒
}   

然后需要重新启动下 nagios 和 apache 的服务

 [root@node2 objects]# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
You have new mail in /var/spool/mail/root
[root@node2 objects]# /etc/init.d/httpd restart
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]

方式二:

这里不修改配置,直接修改源码,重新编译


nrpe-2.12/include/common.h 


#define DEFAULT_SOCKET_TIMEOUT  30      /* timeout after 10 seconds */


重新编译使用新的check_nrpe,拷贝到/usr/local/nagios/libexec即可。



0 0
原创粉丝点击