template for Nagios host group

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
anusha
Posts: 21
Joined: Mon Sep 11, 2017 4:38 am

template for Nagios host group

Post by anusha »

Hi Team,

I am trying to add check_period for one hostgroup but I am getting error and unable to add it. Can someone please let me know the procedure for it.

hostgroup.cfg

define hostgroup {

hostgroup_name XXX
alias XXX
members XXX,YYY,ZZZZ
check_period multiple-time-slots
notification_period multiple-time-slots

}
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: template for Nagios host group

Post by mcapra »

That is not a valid directive for hostgroup definitions.

There's a few alternatives off the top of my head. You could define a check_period in a template and apply that to your corresponding hosts. Or apply your services to a hostgroup and let the common check_period propagate across your hosts' services that way.
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: template for Nagios host group

Post by tmcdonald »

Thanks for the assist, @mcapra!

This is correct - hostgroups are used for just that, grouping hosts. If you are looking at applying the same settings to multiple objects, look into templates.
Former Nagios employee
Locked