At present we are making some use of host templates for basic UP/DOWN checks.
Also took the advice early and made a series of CONTACT GROUPs to help manage notification targets.
Specifically, the following:
- - generic host template for UP/DOWN
- contains syntax for check_icmp command
- tied to a global / "parent" host-group, of which all "customer" hostgroups are children
- users are instructed to USE the identified common host template to qualify for UP/DOWN monitoring
- three contact groups for each team of users
- TEAM-contacts: human users go in here, used to control access / visibility to registered assets per team (EG: hosts & services)
- TEAM-oncall: non-human mail-group CONTACT(s) for page-out email notifications
- TEAM-info: non-human mail-group CONTACT(s) for non-page-out email notifications
- had to do this as the "mail-group" CONTACT entities will never "login" to xi, so xi level HTML based emails never worked to notify them
- found we had to rely on the underlying nagios / OS mailserver (EG: postfix) to broadcast notifications to email plant
This works really well for us, to ensure all registered hosts are getting consistent UP/DOWN monitoring (assuming they "used" the right template at host ADD).
We do have issues with our users occasionally missing the important step of adding the right contact groups (so they "lose" visiblity of hosts after they leave the HOST record).
Some of my users now want to take it another step, with regards to assigning a contact group, which is inherited.
At present, they have two separate host templates to attempt this (one for the PING stuff, the other with the contact group stuff).
This is split out to accommodate a child template for LAB, vs one for PROD, etc. (for different contact groups), along with their basic TEAM-contacts contact group (for visibility of the new assets).
Apparently this works in one of our xi ENVs, but not any of the others (all at ver 5.8.2).
To that end, I have had a bit of a "montage" of learning about templates, inheritance, etc.
Thus, I understand that host templates are tied to HOST records, *not HOST GROUPs*.
I might tie a host template to a host group, but it still needs to be USEd by a host record (EG: at add time) in order to be leveraged / applied.
All this to say, I would like to think I understand how this should work, but it does not appear to manifest in the testing results.
From what I have observed in other parts of xi, inheritance seems to work well enough for partial records.
Is what I am driving for (HOST record attribute inheritance based on assigned HOST TEMPLATEs) possible?
Possibly I have my sequencing wrong in how I am nesting templates?
What is the value of having "Manage Host Groups" button inside a host template (if it must be USEd at the HOST record level to be applicable?)
Does inheritance hold for nesting host templates (EG: parent template with check settings, child templates with various contact group definitions)?
---
For my test case, I have the following (see at bottom for sample definitions):
- test user (regular, not admin)
- test user is a member of a test contact group
- several host records registered properly & set to ACTIVE
- test user does not "see" any hosts (or services) by default (as their contact group is not mapped to any resources)
- test host template (test_generic-all-hosts-check)
- test host template (test_group_contacts_template)
# initial state
- host record exists with associations as described in "control scenario"
# control scenario (how we do it today)
- manually assign to host records:
- test host template (test_generic-all-hosts-check)
- test contact group to host(s) records directly
- the involved nodes become visible to my test user within xi
RESULT: SUCCESS (hosts become visible as does the service monitors associated to them)
# experiment scenarios
## contact group only via separately assigned host templates
- assign host templates to host record(s)
- test host template (for test contact group)
- apply config & wait ~5 mins to permit "linking"
- verify visibility of host records with test user
RESULT: FAILED (expected, check-in flops due to missing required specifications / parameters for conducting the HOST check)
## ping & contact group via separately assigned host templates
- assign host templates to host record(s)
- test host template (test_generic-all-hosts-check)
- test host template (test_group_contacts_template)
- apply config & wait ~5 mins to permit "linking"
- verify visibility of host records with test user
RESULT: FAILED (test host never becomes "visible" for my test user), does inherit required values for UP/DOWN monitor
## ping & contact group via assignment of child host template
- update test host template (test_generic-all-hosts-check)
- nest test host template (test_group_contacts_template) within test host template (test_generic-all-hosts-check) (via Manage Templates button)
- assign host template (test_generic-all-hosts-check) to host record(s)
- apply config & wait ~5 mins to permit "linking"
- verify visibility of host records with test user
RESULT: FAILED (test host never becomes "visible" for my test user), does inherit required values for UP/DOWN monitor
## ping & contact group via assignment of child host template
- update test host template (test_group_contacts_template)
- nest test host template (test_generic-all-hosts-check) within test host template (test_group_contacts_template) (via Manage Templates button)
- assign host template (test_group_contacts_template) to host record(s)
- apply config & wait ~5 mins to permit "linking"
- verify visibility of host records with test user
RESULT: FAILED (test host never becomes "visible" for my test user), does inherit required values for UP/DOWN monitor
---
host template: UP/DOWN ACTIVE check attributes
Code: Select all
define host {
name test_generic-all-hosts-check
check_command check-host-alive!!!!!!!!
initial_state o
max_check_attempts 5
check_interval 5
retry_interval 1
active_checks_enabled 1
check_period 24x7
check_freshness 1
freshness_threshold 240
event_handler_enabled 1
low_flap_threshold 25
high_flap_threshold 50
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 2
notification_period 24x7
notification_options d,r,
notifications_enabled 1
register 0
}
Code: Select all
define host {
name test_group_contacts_template
use test_generic-all-hosts-check
contact_groups team-testing
register 0
}
Code: Select all
define contactgroup {
contactgroup_name team-testing
alias team-testing
members team_lead,team_member
}
Code: Select all
define command {
command_name check-host-alive
command_line $USER1$/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}
Code: Select all
define host {
host_name hostname.fqdn
use test_group_contacts_template <-- NOTE: This value would change based on what HOST TEMPLATE I associated with the HOST record.
address hostname.fqdn
hostgroups customer,customer_location_cage_team-servers,customer_location_cage_team-servers,location_cage,team-servers,team-servers
contact_groups team-contacts,team-info
icon_image linux-server.png
statusmap_image linux-server.png
register 1
}