2016-05-27 49 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文件。這解決了我的問題!