NSClient++ Help (#1) - arguments ignored (#756) - Message List

arguments ignored

Hello,

I tried for some hours to get command arguments working, but no succes yet:

Nagios host: ./check_nrpe -H x.x.x.x -p yyyy -c mycheck -a 10 100 (built with ./configure --enable-ssl --enable-command-args)

NSCLient++ host (windows server 2003), NSC.ini contains these settings: CheckExternalScripts.dll use_ssl=1 allow_arguments=1 (is set twice) mycheck=java classxyz "C:\path\xy" %ARG1% %ARG2%

Basically it works as expected. The only thing is that the java program gets as parameters the strings "%ARG1$" and "$ARG2$" instead of the actual values "10" "100" from the Nagios host.

The log does not show any problem, there the values are listed: 2011-03-16 14:05:01: debug:NSClient++.cpp:1106: Injecting: mycheck: 10, 100

Setting the values directly works: mycheck=java classxyz "C:\path\xy" 10 100

Any idea what I have overseen?

norbert

  • Message #2102

    This is an easy one to miss.

    The case is the following:

    There are two (2) module used when you check external scripts.

    1. NRPEHandler (accepts the call)
    2. CheckExternalScripts (executes the command)

    Both these modules have the ability to allow (or disallow) arguments.

    So what you have configure id:

    So add the same to the CheckExternalScripts module if you want to allow arguments all the way.

    The reason for this is that it is not uncommon for instance to want to allow arguments to internal commands like CheckCPU but NOT to external Commands like scripts. The (main) reason for disallowing arguments is security when forking things via the shell.

    Another scenario is if you are relaying on a "alias facade" in essence allowing only your internal commands (read aliases) to use arguments but not remote commands (coming in via NRPE).

    Michael Medin

    • Message #2103

      Thanks Michael for your reply. I still don't quite get it.

      I have set allow_arguments=1 in these two sections: [NRPE] [External Script]

      That's what I meant by 'is set twice'. Is there still another position where allow_arguments=1 is needed?

Subscriptions