2016-05-27 18 views
0

我想从我的iCinga服务器这样从iCinga2

/usr/local/nagios/libexec/check_nrpe -H <host> -c \ 
'nrpe_check_traffic_status' -a '2' '3' -p <port> 

我在插件此做了一些打印执行NRPE插件执行check_nrpe是结果

>>opt>> -w >> arg 2 
>>opt>> -c >> arg -p     ### THIS LINE IS ERROR ### 
Threshold values should be numerical 

它不能被正确执行,它发送-p作为第二个参数,而不是3到远程nrpe

但同样的工作,当我给这样的

/usr/local/nagios/libexec/check_nrpe -H <host> -c \ 
'nrpe_check_traffic_status' -p <port>-a '2' '3' 

结果

>>opt>> -w >> arg 2 
>>opt>> -c >> arg 3 
TRAFFIC STATUS OK; 

有没有人遇到这个问题?有没有解决方案? 或者有没有办法在iCinga2配置中更改这个参数位置?

注意:我已经尝试在commands.conf文件中更改参数参数up/down,没用。

回答

0

最后,我找到了一种方法来配置参数的位置,而从icinga执行,

下面是详细信息:iCinga_Doc

arguments = { 
    "-X" = { 
    value = "$x_val$" 
    key = "-Xnew"  /* optional, set a new key identifier */ 
    description = "My plugin requires this argument for doing X." 
    required = false /* optional, no error if not set */ 
    skip_key = false /* always use "-X <value>" */ 
    set_if = "$have_x$" /* only set if variable defined and resolves to a numeric value. String values are not supported */ 
    order = -1   /* first position */ 
    repeat_key = true /* if `value` is an array, repeat the key as parameter: ... 'key' 'value[0]' 'key' 'value[1]' 'key' 'value[2]' ... */ 
    } 
    "-Y" = { 
    value = "$y_val$" 
    description = "My plugin requires this argument for doing Y." 
    required = false /* optional, no error if not set */ 
    skip_key = true  /* don't prefix "-Y" only use "<value>" */ 
    set_if = "$have_y$" /* only set if variable defined and resolves to a numeric value. String values are not supported */ 
    order = 0   /* second position */ 
    repeat_key = false /* if `value` is an array, do not repeat the key as parameter: ... 'key' 'value[0]' 'value[1]' 'value[2]' ... */ 
    } 
} 

新增orderrepeat_key=falsecommand.conf文件。这解决了我的问题!