Help a newbie with service checks

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
sunblock
Posts: 1
Joined: Wed Jan 12, 2011 1:33 am

Help a newbie with service checks

Post 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
}
cyberlogi
Posts: 3
Joined: Wed Jan 12, 2011 7:39 pm

Re: Help a newbie with service checks

Post 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.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Help a newbie with service checks

Post by mguthrie »

Cyberlogi is correct, a service definition requires a hostname.
Locked