Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
    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?

share|improve this question
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 '13 at 14:02
it works fine , example : ./check_nrpe - H -c alias_cpu returns " OK CPU Load ok . | some stats..... " – user118074 Nov 1 '13 at 14:12
Yah, see the answer to… – Keith Nov 1 '13 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 '13 at 16:52

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.

share|improve this answer
i run the command in the format above (directly) and it worked without an issue. NAgios just does not seem to like it.... – user118074 Nov 1 '13 at 15:09

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!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.