Using NRPE to execute command with variables
Posted: Mon Apr 10, 2017 3:17 pm
I have the following command I want to run on several remote servers using NRPE. Something similar to the following:
command[check_http_json-int]=/usr/lib64/nagios/plugins/check_http_json --user administrator --pass foopass -u http://<some_url>.flagstar.com:4502/system/sling/monitoring/mbeans/java/lang/Memory.infinity.json -e {noname}.mbean:attributes.HeapMemoryUsage.mbean:attributes.used.mbean:value -w 1000000000 -c 3000000000
Of course, each server has different settings. The variables I want to set are:
_JSON_USER
_JSON_PW
_JSON_URL
_JSON_ELEMENT
_JSON_WARN
_JSON_CRIT
I know this is incorrect, but I imagine the configuration would look something like (assuming I can set soome Free Variables on the Host?):
command[check_http_json-int]=/usr/lib64/nagios/plugins/check_http_json --user $JSON_USER --pass $JSON_PW -u $JSON_URL -e $JSON_ELEMENT -w $JSON_WANR -c $JSON_CRITICAL
Is there some documentation you can direct me to how to use pass some variables to a remote host? I'm not having much luck finding much.
command[check_http_json-int]=/usr/lib64/nagios/plugins/check_http_json --user administrator --pass foopass -u http://<some_url>.flagstar.com:4502/system/sling/monitoring/mbeans/java/lang/Memory.infinity.json -e {noname}.mbean:attributes.HeapMemoryUsage.mbean:attributes.used.mbean:value -w 1000000000 -c 3000000000
Of course, each server has different settings. The variables I want to set are:
_JSON_USER
_JSON_PW
_JSON_URL
_JSON_ELEMENT
_JSON_WARN
_JSON_CRIT
I know this is incorrect, but I imagine the configuration would look something like (assuming I can set soome Free Variables on the Host?):
command[check_http_json-int]=/usr/lib64/nagios/plugins/check_http_json --user $JSON_USER --pass $JSON_PW -u $JSON_URL -e $JSON_ELEMENT -w $JSON_WANR -c $JSON_CRITICAL
Is there some documentation you can direct me to how to use pass some variables to a remote host? I'm not having much luck finding much.