Results 1 to 2 of 2

Thread: check_nrpe parameter passing problems

  1. #1
    Junior Member
    Join Date
    Aug 2015
    Location
    Baltimore, MD
    Posts
    2

    check_nrpe parameter passing problems

    Hey All,
    First time poster here, very frustrated and pretty sure I'm just missing something simple.

    I have a check on a host which runs a bash script that takes 4 parameters. When it runs only 1 of the 4 parameters I pass in the commands.cfg makes it to the host it would seem.

    I've searched around a lot on this issue and haven't been able to find a solution. From what I've read most problems people report with passing parameters to NRPE stem from not having "dont_blame_nrpe" set properly or from not having nrpe compiled with support for parameters. This is not the case for my situation. dont_blame_nrpe is set to 1 and the module was compiled with parameter support. What's more, I have a check on the same host (set up within the same pack) that takes a single parameter and works just fine.

    Here is my commands.cfg in the pack:

    Code:
    define command {
       command_name   check_nrpe
       command_line   $PLUGINSDIR$/check_nrpe -u -H $HOSTADDRESS$ -c $ARG1$ -a '$ARG2$ $ARG3$ $ARG4$ $ARG5$'
    }
    I've also tried the above with double quotes around the whole set of arguments and double quotes around each individual argument. I get the same result no matter what.

    And the service definition:

    Code:
    define service{
       service_description check-worker-count
       use            generic-service
       register       0
       host_name      nrpe-pack
       check_command  check_nrpe!check-worker-count!worker-name!12!90!80
    }
    And the /etc/nrpe.d/check-worker-count.cfg on the host:

    Code:
    command[check-worker-count]=/usr/lib64/nagios/plugins/check_worker_count.sh -n $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$
    I have check_worker_count.sh on the host outputting $* at the very beginning and here is what it's getting:

    -n worker-name -p -w -c
    Compare to a run of the script locally with the parameters passed at the command line:

    -n worker-name -p 12 -w 90 -c 80
    Any guidance would be greatly appreciated. I'm beating my head up against a wall here.

  2. #2
    Junior Member
    Join Date
    Aug 2015
    Location
    Baltimore, MD
    Posts
    2
    I was able to get an answer elsewhere:

    Don't bother separating all of the -a ARGs into separate ARGs in the Nagios conf. You'll drive yourself crazy with the quotes. For simplicity, make your command_line something like:

    Code:
    $PLUGINSDIR$/check_nrpe -u -t 30 -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
    And then use it like this:

    Code:
    check_command  check_nrpe!check-worker-count!worker-name 12 90 80
    With this solution I also did not have to alter the check-worker-count.cfg on the host. It seems that NRPE was able to split up that one argument from the Shinken server into the appropriate pieces.
    Last edited by DegenerateDevOps; 08-10-2015 at 10:02 PM. Reason: More detail

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •