Page 1 of 1

Increasing Service Definition $ARG count beyond $ARG9

Posted: Thu Nov 21, 2013 6:23 pm
by santosltd
Is there a setting where I can increase the ARG count for services beyond ARG8?

I am running a check_multi NRPE script which takes many arguments which consist of "var=value" assignments which are passed into the check_multi script - I need it increased to at least $ARG10 or $ARG12

Thanks

Re: Increasing Service Definition $ARG count beyond $ARG9

Posted: Fri Nov 22, 2013 10:05 am
by slansing
Can't you place those "var=" values on the same line? Or multiple times on one line? Each $ARGn$ is just a spaced section on a command line command, essentially.

Re: Increasing Service Definition $ARG count beyond $ARG9

Posted: Mon Nov 25, 2013 5:58 pm
by santosltd
No what you have suggested wont work.

Each check_multi variable definition must be a standalone argument with "-s VAR=VALUE" you cant have "-s VAR1=VALUE1 VAR2=VALUE2" where in the latter example would be the equivalent of $ARG2$ expanded from "VAR1=VALUE1 VAR2=VALUE2". You could get around this by trying to assign "-s VAR1=VALUE1 -s VAR2=VALUE2" to $ARG2 in the GUI - but that does not work as '-s' is apparentlty "illegal" and wont be accepted by the NagiosXI ARG input GUI.

The only solution is to write a wrapper script (which I have written) that expands VAR=VALUE,VAR=VALUE,VAR=VALUE... comma separated lists and then expand them one by one - prefixing each one with "-s " so that check_multi accepts the arguments. If check_multi supported multiple variable definitions with one "-s " argument then what you suggest would work - but it doesnt.

The only solution is to either hack check_multi so it can accept lists of variable definitions with one '-s ' command line argument - or do what I have done and write a wrapper that expands a compact form from NagiosXI argument list using a comma separated list in NagiosXI then expanding them and then automatically prefixing each argument with '-s' to set the variable.

This is probably just a check_multi problem but this issue might be a restriction in other command line checks as well.

A suggestion would be an optional prefix string - if enabled that can be automatically prefixed to each argument before its passed into the command - this could either be done at the command definition level or at a service check definition level - eg

[x] prefix args with [ "-s" ] " $ARG1: [ ARG1 input box ]

A check box and optional text prefix string can be applied against each argument within the ARG string box - so it is reformatted before being passed to the lower level commands.

Re: Increasing Service Definition $ARG count beyond $ARG9

Posted: Tue Nov 26, 2013 11:42 am
by tmcdonald
So as far as check_multi goes, that's not written or maintained by us so you'll have to contact the author for that one. http://my-plugin.de/wiki/projects/check_multi/start

In regards to having a check box in front of each arg, that's certainly a possibility. Wanna put in a feature request with us?