Apply service only if host is member of two hostgroups
Posted: Fri Jan 13, 2012 5:49 pm
I'm in the process of designing a new nagios installation and hostgroups are the current topic of discussion. I would like to be able to target hosts by the hostgroups they are in, but I don't think nagios works the way I want it to. I'm hoping someone can give me some ideas to work around this, or think about it differently.
Based on the host definitions below, I know how to apply a service to each hostgroup. If I want to apply a service to all webservers, that is straightforward. Same thing if I want to target a location or OS platform.
So here is my question. Is there a way to target webservers running on Windows? or Windows servers at location1? I don't see any obvious way to do this, but it would make managing hostgroups easier.
Thanks in advance for any help on this.
define host{
host_name serverA
hostgroups windows,location1,webserver
define host{
host_name serverB
hostgroups windows,location1,webserver
define host{
host_name serverC
hostgroups windows,location2,webserver
define host{
host_name serverD
hostgroups linux,location1,webserver
Based on the host definitions below, I know how to apply a service to each hostgroup. If I want to apply a service to all webservers, that is straightforward. Same thing if I want to target a location or OS platform.
So here is my question. Is there a way to target webservers running on Windows? or Windows servers at location1? I don't see any obvious way to do this, but it would make managing hostgroups easier.
Thanks in advance for any help on this.
define host{
host_name serverA
hostgroups windows,location1,webserver
define host{
host_name serverB
hostgroups windows,location1,webserver
define host{
host_name serverC
hostgroups windows,location2,webserver
define host{
host_name serverD
hostgroups linux,location1,webserver