Hi,
I want to have different check_periods for different hosts for some common services.
For example, below I have given the service definition applicabale for several hosts:
common-for-hosts.cfg:
Code:
define service{
use generic-service
name my-service
hostgroup_name my-hosts
}
define service{
use my-service
service_description A common service
check_command check_nrpe!check_system_memory
}
And below are two hosts (for example):
host1.cfg:
Code:
define host{
use linux-server
host_name host1
address host1.mydomain.com
hostgroups my-hosts
check_period officehours
}
define service{
<host specific check(s)>
}
host2.cfg:
Code:
define host{
use linux-server
host_name host2
address host2.mydomain.com
hostgroups my-hosts
}
define service{
<host specific check(s)>
}
What I expect here is that the memory check service to be run only during office hours for hos1 and 24x7 for host2, as I have defined the check_period for the host1. But what happens is that only the host check ie whether the host is alive or not is done during office hours; but the services are tried 24x7.
On page
http://nagios.sourceforge.net/docs/3...ions.html#host
the explanation for check_period reads as
Quote:
check_period: This directive is used to specify the short name of the time period during which active checks of this host can be made.
|
If this is not the correct way, can somebody please teach me do it in the correct way?
Please let me know if you have any questions in this regard.
Thanks