Page 1 of 1

Nagios fail start after define service.

Posted: Fri Nov 13, 2015 6:02 am
by nssantos
Hi everyone, I have these problem:

I have the file /usr/local/nagios/etc/servers/clients.cfg containing the following contents:

Code: Select all

define host{
use                             linux-server
host_name                       planetlab2.emich.edu
alias                           server
address                         198.108.101.61
max_check_attempts              5
check_period                    24x7
notification_interval           30
notification_period             24x7
}
define service {
        use                             generic-service
        host_name                       planetlab2.emich.edu
        service_description             SSH
        check_command                   check_ssh
        notifications_enabled           0
        }
But if I add a new "define service" one, like this:

Code: Select all

define service {
        use                             generic-service
        host_name                       planetlab2.emich.edu
        service_description             Uptime
        check_command                   check_nrpe!check_uptime!1051200!10512000
        max_check_attempts              2
        normal_check_interval           1
        retry_check_interval            1
        check_period                    24x7
        notification_interval           120
        notification_period             24x7
        notification_options            w,c,r
        contact_groups                  admins
        notifications_enabled           0
}
I canot start Nagios, and receive the following message on terminal:

nss@nss-X450LA:~$ sudo /etc/init.d/nagios start
[....] Starting nagios (via systemctl): nagios.serviceJob for nagios.service failed. See "systemctl status nagios.service" and "journalctl -xe" for details.
failed!


Anyone knows how to solve this?

Thx

Re: Nagios fail start after define service.

Posted: Fri Nov 13, 2015 10:33 am
by jdalrymple
Post the output of

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
This verifies the syntax and validity of your configuration. It will output the errors preventing your nagios daemon from starting. You may have to modify the paths above if you have customized your installation directories.

Re: Nagios fail start after define service.

Posted: Fri Nov 13, 2015 11:39 am
by nssantos
I fix the error using the following new service:

Code: Select all

define service{
        use                             generic-service
        host_name                       planetlab2.emich.edu
        service_description             Espaco em disco
        check_command                   check_local_disk
        notifications_enabled           0
}
But in the web interface appear this:
Image

Do you know how to fix?
Thx!

Re: Nagios fail start after define service.

Posted: Fri Nov 13, 2015 12:03 pm
by hsmith
We need to see the command definition for check_local_disk to be sure.