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