NRPE 警告阈值必须是正整数

NRPE 警告阈值必须是正整数

操作系统:Ubuntu 12.10 Server 64位

我已经安装了 Icinga,以及 ido2db、pnp4nagios 和 icinga-web(最新版本,按照文档中的说明,使用 apt 安装等)。我正在使用 icinga-web 来监控我的主机。目前,我只有本地主机,一切都很完美。

我正在尝试添加一个主机并使用 NRPE(版本 2.12)对其进行监控:

root@server:/etc/icinga# /usr/lib/nagios/plugins/check_nrpe -H client
NRPE v2.12

配置看上去不错。

我在服务器上的 /etc/icinga/objects/client.cfg 中创建了一个如下所示的文件:

root@server:/etc/icinga/objects# cat client.cfg
define host{
 use generic-host ; Name of host template to use
 host_name client
 alias client.toto
 address xx.xx.xx.xx
 }

# Service Definitions
define service{
 use generic-service
 host_name client
 service_description CPU Load
 check_command check_nrpe_1arg!check_load
 }

define service{

 use generic-service
 host_name client
 service_description Number of Users
 check_command check_nrpe_1arg!check_users
 }

并在我的 /etc/icinga/commands.cfg 中添加:

# this command runs a program $ARG1$ with no arguments
define command {
 command_name check_nrpe
 command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

# this command runs a program $ARG1$ with no arguments
define command {
 command_name check_nrpe_1arg
 command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

但它不起作用。

这些是来自客户端的日志:

Dec 3 19:45:12 client nrpe[604]: Connection from xx.xx.xx.xx port 32641
Dec 3 19:45:12 client nrpe[604]: Host address is in allowed_hosts
Dec 3 19:45:12 client nrpe[604]: Handling the connection...
Dec 3 19:45:12 client nrpe[604]: Host is asking for command 'check_users' to be run...
Dec 3 19:45:12 client nrpe[604]: Running command: /usr/lib/nagios/plugins/check_users -w -c
Dec 3 19:45:12 client nrpe[604]: Command completed with return code 3 and output: check_users: Warning t hreshold must be a positive integer#012Usage:check_users -w  -c 
Dec 3 19:45:12 client nrpe[604]: Return Code: 3, Output: check_users: Warning threshold must be a positive integer#012Usage:check_users -w  -c 

Dec 3 19:44:49 client nrpe[32582]: Connection from xx.xx.xx.xx port 32129
Dec 3 19:44:49 client nrpe[32582]: Host address is in allowed_hosts
Dec 3 19:44:49 client nrpe[32582]: Handling the connection...
Dec 3 19:44:49 client nrpe[32582]: Host is asking for command 'check_load' to be run...
Dec 3 19:44:49 client nrpe[32582]: Running command: /usr/lib/nagios/plugins/check_load -w -c
Dec 3 19:44:49 client nrpe[32582]: Command completed with return code 3 and output: Warning threshold mu st be float or float triplet!#012#012Usage:check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLO AD15
Dec 3 19:44:49 client nrpe[32582]: Return Code: 3, Output: Warning threshold must be float or float trip let!#012#012Usage:check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
Dec 3 19:44:49 client nrpe[32582]: Connection from xx.xx.xx.xx closed.

你有什么想法吗?

答案1

如果您查看接收器 check_user 脚本,您会注意到必须传递必需的参数。日志清楚地表明了这一点以及预期的格式。您也可以查看 nrpe 手册页。您可以查看网站上提供的 nagios 核心文档。最后,通过检查 nrpe.cfg 脚本示例(可能在 /etc/nagios 中)来注意如何调用 check_user 脚本。

答案2

对于其他寻求答案的人。我相信提问者一定已经找到了答案

注释掉 /etc/nagios/nrpe.cfg 中的行

# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for 
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'.  This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.

#command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

相关内容