Increasing Service Definition $ARG count beyond $ARG9

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
santosltd
Posts: 18
Joined: Thu Feb 16, 2012 6:45 pm

Increasing Service Definition $ARG count beyond $ARG9

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Increasing Service Definition $ARG count beyond $ARG9

Post 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.
santosltd
Posts: 18
Joined: Thu Feb 16, 2012 6:45 pm

Re: Increasing Service Definition $ARG count beyond $ARG9

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Increasing Service Definition $ARG count beyond $ARG9

Post 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?
Former Nagios employee
Locked