Page 7 of 8

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

Posted: Mon Dec 21, 2015 2:35 pm
by rkennedy
Can you please post the file that contains those 4 service definitions for us to take a look at?

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

Posted: Mon Dec 21, 2015 6:39 pm
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%

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

Posted: Tue Dec 22, 2015 10:46 am
by rkennedy
That's actually your commands.cfg.

Look for something that looks similar to -

Code: Select all

define service {
}
define service {
}

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

Posted: Tue Jan 12, 2016 1:01 pm
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
        }


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

Posted: Tue Jan 12, 2016 1:25 pm
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'

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

Posted: Tue Jan 12, 2016 5:04 pm
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

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

Posted: Tue Jan 12, 2016 5:06 pm
by hsmith
Are you doing this as root?

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

Posted: Tue Jan 12, 2016 5:14 pm
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.

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

Posted: Tue Jan 12, 2016 5:18 pm
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.

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

Posted: Tue Jan 12, 2016 5:22 pm
by rkennedy
Can you verify the permissions of your libexec folder and post the result?

Code: Select all

ls -l /usr/local/nagios/libexec/