Pass in varaible to nrpe
Posted: Fri May 01, 2015 6:21 am
Hi all,
I am trying to pass in a variable to an nrpe agent through nagios.
I have a nagios server and have defined a global environment variable e.g
I can manually check that this varaible can be called by doing a
However when I try and pass in arguments into the command e.g
It displpays "$" on the nagios webpage, does anybody know why this is and how variables can be passed in?
One aditional question if variables can be defined and called, is there any way to pass in a varaible that performs an action .eg
Thanks in advance,
djs
I am trying to pass in a variable to an nrpe agent through nagios.
I have a nagios server and have defined a global environment variable e.g
Code: Select all
test_var=HiCode: Select all
./check_nrpe -H 123.456.7.8 -c pass_arg -a $test_varCode: Select all
define service{
use test-service
host_name d3t
service_description Pass arg 1
check_command pass_arg_h!$test_var
}One aditional question if variables can be defined and called, is there any way to pass in a varaible that performs an action .eg
Code: Select all
define service{
test_var=`ls -l /etc/nagios/ | wc -l`
use test-service
host_name d3t
service_description Pass arg 1
_YahooID john32
check_command pass_arg_h!$test_var
}
Thanks in advance,
djs