Page 1 of 1

Help a newbie with service checks

Posted: Wed Jan 12, 2011 1:46 am
by sunblock
Trying to learn nagios for the third time. Usually after a day I just get frustrated and stick with sitescope .. I am trying to monitor a remote machine via NRPE. Everything is installed and working on both machines, I can run nrpe tests from the command line on the monitoring server. My problem is one more of configuration, I can get this test host setup, but none of my services that I add get listed under that host. the services do not appear anywhere. many of the service examples I have seen also list the host_name, which makes sense to append that service check to whichever host but when I add that to the below service statements nagios will not reload and produces a configuration error. I wish it gave a more specific error ... I know it has to be something simple, yet its driving me nuts. Any Ideas ?

my cfg file



define host{
use linux-server
host_name mercury
alias mercury
address xx.xx.xx.xx
contact_groups admins
}


define service{
use generic-service
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}


define service{
use generic-service
service_description Load
contact_groups admins
check_command check_nrpe!check_load
}

Re: Help a newbie with service checks

Posted: Thu Jan 13, 2011 11:52 am
by cyberlogi
The NRPE documentation suggests that you should include a host_name with your services:

define service{
use generic-service
host_name mercury
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}

That might fix your issue.

Re: Help a newbie with service checks

Posted: Fri Jan 14, 2011 11:44 am
by mguthrie
Cyberlogi is correct, a service definition requires a hostname.