Okay I'm going to start off by saying I'm new so be nice!
In my templates.cfg I have 4 definitions for 4 templates. I have another folder containing .cfg's for each of those templates.
As of right now all the templates use the the same hours for reporting/ creating a ticket. In one of the defined templates .cfg's there are 100 hosts and I am trying to change 20 or so of them to not send tickets on Sunday.
Would the only way to accomplish this be to create a new template definition and move those hosts or can I add a statement to the host definition to point to a different notification schedule I create?
This is in the template.cfg
define hostgroup{
hostgroup_name Group_HQ ; The name of the hostgroup
alias Head Quarters ; Long name of the group
}
define host{
name template_HQ ; The name of this host template
hostgroups Group_HQ
check_period 24x7 ; By default, hosts are checked round the clock
active_checks_enabled 1
check_command check-host-alive-HQ
event_handler_enabled 1 ; Host event handler is enabled
process_perf_data 0 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notifications_enabled 1 ; 1 enabled, 0 disabled
obsess_over_host 0
flap_detection_enabled 0 ; Flap detection is enabled
contact_groups normal ; Notifications get sent to the admins by default
notification_period 24x7 ; Send host notifications at any time
notification_options d,u
check_interval 1 ; Actively check the server every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 3 ; Check each server 2 times (max)
first_notification_delay 2 ; This defines the time to wait before sending first notification when host enters a non-UP state
notification_interval 0 ; Interval to send alarms if still active
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
This is in the template_HQ.cfg
define host{
use template_HQ ; Inherit default values from a template
host_name HeadQuarters ; The name we're giving to this host
alias x.x.x.x ; A longer name associated with the host
}
Defining specific timeperiods within a template group
-
- Posts: 2
- Joined: Wed Dec 21, 2016 7:46 pm
Re: Defining specific timeperiods within a template group
You may find this documentation useful:Koukidrftr wrote: Would the only way to accomplish this be to create a new template definition and move those hosts or can I add a statement to the host definition to point to a different notification schedule I create?
https://assets.nagios.com/downloads/nag ... tance.html
Specifically this blurb:
Essentially, the answer to your question is that yes you could define a specific time period within those host objects different from the one defined in the template, and the "local" settings would take precedence. For 20 out of 100 hosts, this would probably be the easiest fix.One important thing to understand with inheritance is that "local" object variables always take precedence over variables defined in the template object.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 2
- Joined: Wed Dec 21, 2016 7:46 pm
Re: Defining specific timeperiods within a template group
Perfect! Thank you for the reference.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Defining specific timeperiods within a template group
@Koukidrftr, did you have any other questions, or are we ready to lock this up?