1

So I've just started configuring Nagios in my environment and I'm getting the above error when trying to user the NRPE plugin.

The host file is as follows:

define {

    host_name   servername    
    alias       servername
    address     xxx.xxx.xxx.xxx
    use         generic-host    
}

define service {    
    use                     generic-service    
    host_name               servername   
    service_description CPU load    
    check_command           check_nrpe!alias_cpu    
}

This is the check_nrpe.cfg file that is located in /etc/nagios-plugins/config

NOTE: this command runs a program $ARG1$ with arguments $ARG2$

define command {   
        command_name    check_nrpe    
        command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$    
}

NOTE: this command runs a program $ARG1$ with no arguments

define command {    
        command_name    check_nrpe_1arg    
        command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$    
}

Any ideas what is wrong or where to start to solve this?

4
  • what happens if you execute /usr/lib/nagios/plugins/check_nrpe with the respective arguments as the user nagios is running as?
    – RSchulze
    Nov 1, 2013 at 14:02
  • it works fine , example : ./check_nrpe - H xxx.xxx.xxx.xxx -c alias_cpu returns " OK CPU Load ok . | some stats..... "
    – NickDa
    Nov 1, 2013 at 14:12
  • Yah, see the answer to serverfault.com/questions/549882/…
    – Keith
    Nov 1, 2013 at 16:11
  • Well you didn't run it as nagios would have run it without a second argument. nagios would have run it as "check_nrpe -H host -c ARG -a". Probably giving the -a without any parameter causes an error. But you seem to have found a solution that fits your needs.
    – Marki
    Nov 1, 2013 at 16:52

2 Answers 2

3

so heres what fixed my issue By running from inside the config gile the check_nrpe_1arg . Seems the default check_nrpe is waiting for 2 arguments which is not always the case!

1

I always run these commands from a terminal first to see what's going on instead of trying to debug them in Nagios. It's just easier and you can typically provide switches to the plugins that make them more verbose. I'll usually become the nagios user, whatever that username is, when doing this.

$ /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$

You'll have to determine the variable values for $HOSTADDRESS$, $ARG1$ and $ARG2$ but this should be straightforward.

1
  • i run the command in the format above (directly) and it worked without an issue. NAgios just does not seem to like it....
    – NickDa
    Nov 1, 2013 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .