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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

Can you please post the file that contains those 4 service definitions for us to take a look at?
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:Can you please post the file that contains those 4 service definitions for us to take a look at?
Is that the nrpe.cfg?

If so, it is the sample nrpe config file, with the addition of:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

That's actually your commands.cfg.

Look for something that looks similar to -

Code: Select all

define service {
}
define service {
}
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 »

Code: Select all

[nagiosadmin@nagios etc]$ vi services.cfg
define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     CPU Load
        check_command           check_nrpe!check_load
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Total Processes
        check_command           check_nrpe!check_total_procs
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Current Users
        check_command           check_nrpe!check_users-a '-w 5 -c 10'
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     SSH Monitoring
        check_command           check_nrpe!check_ssh
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     FTP Monitoring
        check_command           check_nrpe!check_ftp
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Check Swap
        check_command           check_nrpe!check_swap -w 20 -c 10
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Check Processes
        check_command           check_nrpe!check_procs
        }

rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

al_orange wrote:

Code: Select all

[nagiosadmin@nagios etc]$ vi services.cfg
define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     CPU Load
        check_command           check_nrpe!check_load
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Total Processes
        check_command           check_nrpe!check_total_procs
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Current Users
        check_command           check_nrpe!check_users-a '-w 5 -c 10'
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     SSH Monitoring
        check_command           check_nrpe!check_ssh
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     FTP Monitoring
        check_command           check_nrpe!check_ftp
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Check Swap
        check_command           check_nrpe!check_swap -w 20 -c 10
        }

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Check Processes
        check_command           check_nrpe!check_procs
        }

In that file, try changing a your Current Users definitions, and then let me know if it is fixed.

Code: Select all

define service{
        use                     generic-service
        host_name               ora_linux7_xen2.xyz.local
        service_description     Current Users
        check_command           check_nrpe!check_users-a '-w 5 -c 10'
        }
Change the check_command line to check_nrpe!check_users -a '-w 5 -c 10'
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 »

When I try to vi services.cfg, it says it's read only, and I can't save it. How do I overcome this?

Image
Last edited by al_orange on Tue Jan 12, 2016 5:07 pm, edited 1 time in total.
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 »

Are you doing this as root?
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:Are you doing this as root?
No, I was doing it as nagiosadmin. I just tried it as root. It worked.
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: In that file, try changing a your Current Users definitions, and then let me know if it is fixed.
No, that didn't seem to fix the issue. I did restart Nagios.
Attachments
current users.png
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post by rkennedy »

Can you verify the permissions of your libexec folder and post the result?

Code: Select all

ls -l /usr/local/nagios/libexec/
Former Nagios Employee
Locked