I have several services defined over a host group. On a few machines the alerting criteria needs to be "tighter". If I define multiple hosts in CCM it seems only the first host gets the service. For example I have a machine ven3.vca.com which is in hostgroup Windows-Servers. I have defined the service "Disk Space" for the hostgroup with alerting at 80% and 90%. For a handful of machines I would like to alert on 90% and 95%. I created another service with these parameters but ven3.vca.com still alerts at 80%. If I create three services, one for each host, then it overrides the hostgroup service def. What am I missing here?
define service {
service_description Disk Space
use generic-service
hostgroup_name Windows-Servers
check_command check_win_disk!.!80!90!!!!!
register 1
}
define service {
host_name citrixlicense.vca.com,isa2004.vca.com,ven3.vca.com
service_description Disk Space
use generic-service
check_command check_win_disk!.!90!95!!!!!
register 1
}
I don't know if there's a simple solution in the CCM for this, but take a look at this Core doc on inheritance and see if the option you need is in there. (I haven't played with these, but I think what you're looking for can be done). http://nagios.sourceforge.net/docs/3_0/ ... tance.html
With respect I think you missed my point. Normally with duplicate service definitions I would bang out (!isa2004.vca.com,!ven3.vca.com,...) but I cannot figure out how to do that in CCM. Also why would it work for individual host names. For example if I define three services with one hostname on each they will override the service def with the hostgroup but if I define just one with multiple hosts it only seems to override the hostgroup service on the last host in the list.
How do I bang out (!isa2004.vca.com,!ven3.vca.com,...) in CCM?
define service {
service_description Disk Space
use generic-service
hostgroup_name Windows-Servers
display_name Disk Space - Normal
check_command check_win_disk!.!80!90!!!!!
register 1
}
define service {
host_name citrixlicense.vca.com,isa2004.vca.com,ven3.vca.com
service_description Disk Space
use generic-service
hostgroup_name null
display_name Disk Space - Tight
check_command check_win_disk!.!90!95!!!!!
register 1
}
define service {
host_name sql2k8.vca.com
service_description Memory Used
use generic-service
display_name Memory Used - Very Tight
check_command check_win_mem!98!99!!!!!!
register 1
}
define service {
service_description Memory Used
use generic-service
hostgroup_name Windows-Servers
display_name Memory Used - Normal
check_command check_win_mem!80!90!!!!!!
register 1
}
define service {
host_name citrix3.vca.com,citrix4.vca.com,citrix5.vca.com,hyperv2.vca.com,ven3.vca.com
service_description Memory Used
use generic-service
display_name Memory Used - Tight
check_command check_win_mem!90!95!!!!!!
register 1
}
Currently the CCM does not the allow the '!' exclusions. In order to use that you'd have to maintain that set of configs manually in the /usr/local/nagios/etc/static directory.