Error: Service check command 'check_nrpe!check_sda1'

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
NagiosNewb9
Posts: 3
Joined: Mon Sep 29, 2014 9:39 am

Error: Service check command 'check_nrpe!check_sda1'

Post by NagiosNewb9 »

Hi folks,

So, for my internship project I need to install Nagios and configure it on a couple of machines. This all worked fine with the check_nt plugin, but now it's time to use the check_npre plugin as the servers that need to be checked run on OpenSUSE.

For installing NRPE on the server that will be monitored I followed a small tutorial and that worked fine. I tested it local, and it seems to be fine, thus I am fairly sure that the problem lies not there.

When I run the /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg command, I get the following output:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: Service check command 'check_nrpe!check_sda1' specified in service '/dev/hda1 Free Space' for host 'remotehost' not defined anywhere!
Error: Service check command 'check_nrpe!check_load' specified in service 'CPU Load' for host 'remotehost' not defined anywhere!
Error: Service check command 'check_nrpe!check_users' specified in service 'Current Users' for host 'remotehost' not defined anywhere!
Error: Service check command 'check_nrpe!check_total_procs' specified in service 'Total Processes' for host 'remotehost' not defined anywhere!
Error: Service check command 'check_nrpe!check_zombie_procs' specified in service 'Zombie Processes' for host 'remotehost' not defined anywhere!
        Checked 13 services.
        Checked 2 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 24 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 2 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   5

***> One or more problems was encountered while running the pre-flight check...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

[root@localhost libexec]#
I manually put the check_nrpe file in the libexec folder, because it was not there before but this did not solve this issue.

If somebody could give me a push in the right direction, that would be great!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Error: Service check command 'check_nrpe!check_sda1'

Post by eloyd »

You need a check_nrpe command defined in commands.cfg. Typically, it looks like this:

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
NagiosNewb9
Posts: 3
Joined: Mon Sep 29, 2014 9:39 am

Re: Error: Service check command 'check_nrpe!check_sda1'

Post by NagiosNewb9 »

eloyd wrote:You need a check_nrpe command defined in commands.cfg. Typically, it looks like this:

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
This command does not appear to be in the file, so I added it manually. When I add it, I get the following error message:

Code: Select all

Website: http://www.nagios.org
Reading configuration data...
Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios.cfgse' for reading!
   Error processing main config file!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error: Service check command 'check_nrpe!check_sda1'

Post by slansing »

Is "nagios.cfgse" your actual config file? Did you accidentally add 'se' to the end of it? What is the output of:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgse

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
NagiosNewb9
Posts: 3
Joined: Mon Sep 29, 2014 9:39 am

Re: Error: Service check command 'check_nrpe!check_sda1'

Post by NagiosNewb9 »

slansing wrote:Is "nagios.cfgse" your actual config file? Did you accidentally add 'se' to the end of it? What is the output of:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgse

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Oh, how stupid of me. I indeed screwed up the command and added se by accident. So, it appears that the adding of the check_nrpe in the commands.cfg file did the job. Thank you very much!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Error: Service check command 'check_nrpe!check_sda1'

Post by eloyd »

Glad I could help.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked