I am trying to put in an exclude argument into the check_oracle_health. When I put the arg string into $ARG1$ and save, it splits it at the "!". I tested the string by running it on the command line and it works. I also replaced the "!" with another "?" and that did not split the ARG into 2. I also tried to escape the "!", but that did not work.
The "!" character is used to separate arguments in the Nagios Core config files. Since XI runs on top of Core, the "!" is not an allowed character in the commands. One trick to get around it is to add "!" as a USER macro in resource.cfg like so:
# Path to the plugins
$USER1$=/usr/local/nagios/libexec
# Port for NSClient++
$USER7$=12489
# Password for NSClient++
$USER8$=secret
#Escaping exclamation points
$USER9$=!
Then in your definition, set your ARG to use $USER9$ wherever you need the exclamation:
exclamation.png
hello world.png
You do not have the required permissions to view the files attached to this post.
# Path to the plugins
$USER1$=/usr/local/nagios/libexec
# Path to event handlers
#$USER2$=/usr/local/nagios/libexec/eventhandlers
# Port for NSClient++
$USER7$=12489
# Password for NSClient++
$USER8$=secret
#Escaping exclamation points
$USER9$=!
The ARG was not split, but the regex was not picked up. I ran it on the command line and it worked. Do I need to do anything to get the macro pulled in? I did not see anything inside XI, so I just edited the file. Also tried restarting nagios.
How were you testing this? Did you use the Test Check Command or did you apply config and let the check run? The Test Check Command button has some issues with escaping and won't work in all cases.
Never mind it works. I created a check with dummy to see if it was coming through. Then realized I was missing an argument for the check_oracle_health. Thanks again for your help.
Just curious, if I wanted to add another macro, is a restart in nagios required or just editing the file is enough?