Scheduling downtime for many services

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
markus_b
Posts: 2
Joined: Fri Dec 02, 2011 3:40 pm

Scheduling downtime for many services

Post by markus_b »

We are operating clusters for which many hosts >50 run exactly the same service. The service is currently defined for the hostgroup (contains all hosts of the cluster). Once in a while we have to restart all of the services, this generates a flood of notifications (a down and a up notification per host). The proper way out is to schedule downtime during the restart, but this is not practical as I can not schedule downtime for a specific service, but the entire hostgroup. There seems to be no way to schedule downtime for an entire hostgroup too.

Any idea how to schedule downtime for many hosts in an easy way ?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Scheduling downtime for many services

Post by jsmurphy »

For clusters such as that, I would recommend creating a service group, add that one service to it. Then when you need to schedule downtime you can do it based on the service group which will do that service on each host!
markus_b
Posts: 2
Joined: Fri Dec 02, 2011 3:40 pm

Re: Scheduling downtime for many services

Post by markus_b »

I've tried service groups, but there is no dice: I am unable to define downtime for a servicegroup, the interface does not offer the option. Also, servicegroups are a pain to define because you have to define every host,service instance. You can not use a hostgroup, for example.
In the meantime I've come cross the 'check_cluster' plugin, which comes close to what I need. It allows to define a service which checks for other services and comes back with a warning if not enough of them are running. Unfortunately thione too, requires to enumerate all hosts and services it looks after.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Scheduling downtime for many services

Post by jsmurphy »

I'm beginning to get to used to Nagios XI I think :mrgreen: (You can select hostgroups in that), you are right it is per host although you can set downtime with it. You click the link in the brackets with the literal servicegroup definition name and it brings up a list of commands you can run. Now I haven't tried this but there is a wildcard of * available for hosts (which means any host)... so potentially you could make a servicegroup definition like:

define servicegroup {
servicegroup_name sg-name
alias sg-alias
members *,service name
}

I would really like to know if that works for you! Glad you found a work around however :)
[email protected]
Posts: 6
Joined: Wed Feb 01, 2012 3:35 pm

Re: Scheduling downtime for many services

Post by [email protected] »

With this:

define servicegroup {
servicegroup_name ove-test
members *,ntp
}

I get this:

Error: Could not find a service matching host name '*' and description 'ntp' (config file '/etc/nagios3/conf.d/servicegroup.cfg', starting on line 24)
Error: Could not expand member services specified in servicegroup (config file '/etc/nagios3/conf.d/servicegroup.cfg', starting on line 24)

So it doesn't seem to work.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Scheduling downtime for many services

Post by jsmurphy »

Well that's unfortunate, thanks for following up... I had been curious about that but never got around to trying it.
Locked