Nagios fail start after define service.

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
nssantos
Posts: 13
Joined: Fri Nov 13, 2015 5:55 am

Nagios fail start after define service.

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios fail start after define service.

Post 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.
nssantos
Posts: 13
Joined: Fri Nov 13, 2015 5:55 am

Re: Nagios fail start after define service.

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

Re: Nagios fail start after define service.

Post by hsmith »

We need to see the command definition for check_local_disk to be sure.
Former Nagios Employee.
me.
Locked