Allow service template associated w/hostgroup

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
rkcarter
Posts: 5
Joined: Mon Aug 25, 2014 10:05 am
Location: Ann Arbor, Michigan, USA

Allow service template associated w/hostgroup

Post by rkcarter »

Here's my use case. We have a non-production environment and a production environment. The checks are the same within each corresponding hostgroup (example: thisservice-appservers-nonprod and thisservice-appservers-production). The only difference is that the non-production gets sends an email to the devs, the production triggers an email and a page. We fairly often add/remove new servers to/from each hostgroup.

Currently, I'm having to set up a duplicate set of services, one using a template for non-production and one using a template for production, specifying the differing destination. Ideally, I could have one set of checks, and just a service template associated with the nonprod hostgroup with the dev email, and a second service template associated with the production hostgroup with its email and pager.

Perhaps the text accompanying the field could briefly explain, i.e. "service templates for associated services."
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Allow service template associated w/hostgroup

Post by npolovenko »

Hello, @rkcarter. So the only difference between the production service checks and non-production checks is that they notify different emails = contacts? Why not assign one service check two both contact groups, production team and non-production team? Also, some contacts can be integrated with the pager duty and some not, right? I apologize if I'm missing something.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rkcarter
Posts: 5
Joined: Mon Aug 25, 2014 10:05 am
Location: Ann Arbor, Michigan, USA

Re: Allow service template associated w/hostgroup

Post by rkcarter »

npolovenko wrote:Hello, @rkcarter. So the only difference between the production service checks and non-production checks is that they notify different emails = contacts? Why not assign one service check two both contact groups, production team and non-production team? Also, some contacts can be integrated with the pager duty and some not, right? I apologize if I'm missing something.
If I understand what you're saying, then every time the non-production service fails, the production people would get paged... which is what we're trying to avoid. Now *I* apologize if I'm missing something.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Allow service template associated w/hostgroup

Post by npolovenko »

@rkcarter, If the only difference between the non-production and production service templates is in the destination emails + one is using pager alerts, then here's what I suggest. Assign the same service checks to both production and non-production hosts. Define notification settings not in the XI contact settings, and not in the service/service template settings but in host settings. They will get automatically applied to services that belong to these hosts. For example, if the service A on the host A sends a notification it will use the hosts A command, and the service A on the host B will use the host B notification command.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rkcarter
Posts: 5
Joined: Mon Aug 25, 2014 10:05 am
Location: Ann Arbor, Michigan, USA

Re: Allow service template associated w/hostgroup

Post by rkcarter »

Thanks, that will work as long as the host-down and the service-down destinations are identical (which they generally are of course). However, I've had cases where the host-downs go to an infrastructure support group, and the service-down messages go to differing places.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Allow service template associated w/hostgroup

Post by ssax »

In those cases you would need to create the separate services if you're using this method. Those are the one-offs but the majority of them would be single services.
Locked