How to pass a parameter to a custom script

HI all,
Can anybody help me ?
In Icinga Director I’ve defined a custom command: check_buffer_drought, called by following command: PluginDir + /check_by_ssh with following Arguments: -H $address$ and -C /usr/local/LI/etc/buffer/bin/checkBufferDrought.sh 86400, where 86400 are seconds and is the parameter that I want to pass as variable to my script, but I don’t know how.

Hello goldjj,

I think this works:

  • Define a field “time_in_seconds” and add it to your command definition
  • Define a field “c_argument” and add it to your command
  • Change the argument -C to $c_argument$
  • Assign 86400 as value to “time_in_seconds” (in command or check definition)
  • Assign “/usr/local/LI/etc/buffer/bin/checkBufferDrought.sh $time_in_seconds$” to c_argument

Hope this helps,
Michael

Thanks Michael, it works fine