Error: Service check command...not defined anywhere!

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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Error: Service check command...not defined anywhere!

Post by hsmith »

Those are all commands that need to be called via NRPE.

Code: Select all

[root@xi libexec]# ./check_nrpe -H 10.1.1.1 -c check_yum
YUM WARNING:  O/S requires an update.
For example.

Code: Select all

define service {
        host_name                       myvps.net
        service_description             CPU Stats
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_cpu_stats!-a '-w 85 -c 95'
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        nagiosadmin
        _xiwizard                       linux-server
        register                        1
        }

My example is XI, but I kind of blew my core VM up earlier.

Clear it up a bit?
Former Nagios Employee.
me.
al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

hsmith wrote:Those are all commands that need to be called via NRPE.

Code: Select all

[root@xi libexec]# ./check_nrpe -H 10.1.1.1 -c check_yum
YUM WARNING:  O/S requires an update.
For example.

Code: Select all

define service {
        host_name                       myvps.net
        service_description             CPU Stats
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_cpu_stats!-a '-w 85 -c 95'
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        nagiosadmin
        _xiwizard                       linux-server
        register                        1
        }

My example is XI, but I kind of blew my core VM up earlier.



Clear it up a bit?
A little. Where do I put the commands that need to be called? Anywhere In the commands.cfg file?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Error: Service check command...not defined anywhere!

Post by rkennedy »

You will need to install NRPE on the client server in order for Nagios to check the client server.

Here's documentation about NRPE, and how to set it up -
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
Former Nagios Employee
al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

rkennedy wrote:You will need to install NRPE on the client server in order for Nagios to check the client server.

Here's documentation about NRPE, and how to set it up -
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
Thank you. I did already install NRPE. I'm going to post my nagios.cfg from the monitoring server if that will help. I don't know where I went wrong!

Code: Select all

[root@nagios libexec]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nag                                                                                                                                                             ios.cfg|more

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributo
rs
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://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_load' specified in service 'CPU Load' for ho
st 'ora_linux7_xen2.xyz.local' not defined anywhere!
Error: Service check command 'check_users' specified in service 'Current Users'
for host 'ora_linux7_xen2.xyz.local' not defined anywhere!
Error: Service check command 'check_total_procs' specified in service 'Total Pro
cesses' for host 'ora_linux7_xen2.xyz.local' not defined anywhere!
        Checked 12 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:   3

***> 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.
al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

hsmith wrote:Those are all commands that need to be called via NRPE.
My example is XI, but I kind of blew my core VM up earlier.

Clear it up a bit?
So does this go in the /usr/local/nagios/etc/objects/service.cfg on the nagios server?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Error: Service check command...not defined anywhere!

Post by Box293 »

al_orange wrote:

Code: Select all

Error: Service check command 'check_load' specified in service 'CPU Load' for host 'ora_linux7_xen2.xyz.local' not defined anywhere!
Error: Service check command 'check_users' specified in service 'Current Users' for host 'ora_linux7_xen2.xyz.local' not defined anywhere!
Error: Service check command 'check_total_procs' specified in service 'Total Processes' for host 'ora_linux7_xen2.xyz.local' not defined anywhere!
Can you please post the config file that has the services for ora_linux7_xen2.xyz.local
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

Box293 wrote: Can you please post the config file that has the services for ora_linux7_xen2.xyz.local

Code: Select all

[root@ora_linux7_xen2 etc]# vi services
# /etc/services:
# $Id: services,v 1.55 2013/04/14 ovasik Exp $
#
# Network services, Internet style
# IANA services version: last updated 2013-04-10
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# Updated from RFC 1700, ``Assigned Numbers'' (October 1994).  Not all ports
# are included, only the more common ones.
#
# The latest IANA port assignments can be gotten from
#       http://www.iana.org/assignments/port-numbers
# The Well Known Ports are those from 0 through 1023.
# The Registered Ports are those from 1024 through 49151
# The Dynamic and/or Private Ports are those from 49152 through 65535
#
# Each line describes one service, and is of the form:
#
# service-name  port/protocol  [aliases ...]   [# comment]

tcpmux          1/tcp                           # TCP port service multiplexer
tcpmux          1/udp                           # TCP port service multiplexer
rje             5/tcp                           # Remote Job Entry
rje             5/udp                           # Remote Job Entry
echo            7/tcp
echo            7/udp
discard         9/tcp           sink null
discard         9/udp           sink null
systat          11/tcp          users
systat          11/udp          users
daytime         13/tcp
daytime         13/udp
qotd            17/tcp          quote
qotd            17/udp          quote
msp             18/tcp                          # message send protocol (historic)
msp             18/udp                          # message send protocol (historic)
chargen         19/tcp          ttytst source
chargen         19/udp          ttytst source
ftp-data        20/tcp
ftp-data        20/udp
# 21 is registered to ftp, but also used by fsp
ftp             21/tcp
ftp             21/udp          fsp fspd
ssh             22/tcp                          # The Secure Shell (SSH) Protocol

al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

Or was this the file you needed to look at?

Code: Select all

[root@ora_linux7_xen2 etc]# vi /usr/local/nagios/etc/nrpe.cfg
#############################################################################
# Sample NRPE Config File
# Written by: Ethan Galstad (nagios@nagios.org)
#
# Last Modified: 11-23-2007
#
# NOTES:
# This is a sample configuration file for the NRPE daemon.  It needs to be
# located on the remote host that is running the NRPE daemon, not the host
# from which the check_nrpe client is being executed.
#############################################################################


# LOG FACILITY
# The syslog facility that should be used for logging purposes.

log_facility=daemon



# PID FILE
# The name of the file in which the NRPE daemon should write it's process ID
# number.  The file is only written if the NRPE daemon is started by the root
# user and is running in standalone mode.

pid_file=/var/run/nrpe.pid



# PORT NUMBER
# Port number we should wait for connections on.
# NOTE: This must be a non-priviledged port (i.e. > 1024).
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

server_port=5666



# SERVER ADDRESS
# Address that nrpe should bind to in case there are more than one interface
# and you do not want nrpe to bind on all interfaces.
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

#server_address=127.0.0.1


"/usr/local/nagios/etc/nrpe.cfg" 237L, 8124C
al_orange
Posts: 55
Joined: Mon Nov 23, 2015 7:27 pm

Re: Error: Service check command...not defined anywhere!

Post by al_orange »

Does this look right?

Code: Select all

[root@ora_linux7_xen2 etc]# netstat -at | grep nrpe
tcp6       0      0 [::]:nrpe               [::]:*                  LISTEN
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Error: Service check command...not defined anywhere!

Post by rkennedy »

That looks right, in your NRPE configuration though you're missing the command definitions needed.

Check out page 13 @ https://assets.nagios.com/downloads/nag ... e/NRPE.pdf

This document does a pretty good job at explaining what you need to add.
Former Nagios Employee
Locked