Page 1 of 1

macros for check_http

Posted: Tue Sep 26, 2017 10:56 am
by vuduops
Hi;

Is there a way I can define a single macro in the commands.cfg that can take all the arguments in the service definition.

define command {
command_name check_xi_service_http_content
command_line $USER1$/check_http -H $HOSTADDRESS$ --onredirect=follow -s "$ARG1$"
}

Instead of check_http -H $HOSTADDRESS$ --onredirect=follow -s "$ARG1$" --> can we have a single argument that takes all the options ?

Thanks
Krishna

Re: macros for check_http

Posted: Tue Sep 26, 2017 12:24 pm
by tacolover101
yes - use resources.cfg and reference $USERn$ accordingly - https://assets.nagios.com/downloads/nag ... Macros.pdf

Re: macros for check_http

Posted: Tue Sep 26, 2017 3:30 pm
by dwhitfield
If @tacolover101's response is not enough, I'm afraid you are going to have to explain a bit more about what you want.

I have a couple of questions that may help clarify things:
Are you trying to have a situation where you can change the command "on the fly"? If so, that's probably not going to work very well.
Are you trying to keep passwords out of the CCM?