NRPE uses standard port

This forum was archived to /woltlab and is now in read-only mode.
  • Hi,


    I am trying to use the check_load plugin on a remote host via NRPE.

    On the command line this command works fine: "check_nrpe -2 -p 1011 -H 10.161.111.11 -c check_load -a 7.0 9.0"


    When I use the CheckCommand object which is attached, without the "-a" parameter, I get a response from the check_load plugin:

    Quote

    Warning threshold must be float or float triplet!

    Usage: check_load [-r] -w WLOAD1, WLOAD5, WLOAD15 -c CLOAD1, CLOAD5, CLOAD15

    So the command object uses the right NRPE port, but fails because its missing the "-a" parameter for the check_load plugin.


    When I enable the "-a" parameter I get the following error:

    Quote

    connect to address 10.161.11.11 port 5666: Connection refused

    connect to host 10.161.111.11 port 5666: Connection refused


    So why is the standard port used when I enable the parameters for check_load?


  • In your checkcommand definition there is a problem with the order of the arguments.


    You have 2 possibilitys:


    1. Change the "-a" argument to be the last argument

    From the help of the check_nrpe for "-a":

    Quote


    If provided, this must be the last option supplied on the command line.


    2. you use the nrpe command provided by icinga2.

    see here:

    https://www.icinga.com/docs/ic…ga-template-library/#nrpe

  • thank you for the reply but isnt the -a argument the last argument in the command object?
    if not, what do I have to change?

  • You definitely should use the CheckCommand definition, as it already takes care about proper argument passing for "-a". All those arguments must be defined as Array value type.


    More over advantage - one check command for any service, no more duplicated and extra maintenance.


    Your example in short, using the full power of host and service custom attributes:



    Either way, I recommend to drop NRPE for security reasons and migrate to the Icinga 2 client.

  • Thanks. I have solved it by using the custom attributes and the nrpe command from icinga. The Icinga 2 client may be implemented later on.