To me the only difference I see is that if you have a host who has specific settings: for example --> Notification_intervals, Contacts, maybe an event handler, and maybe a special check_command.
Then instead of creating another host template for that and retyping everything again. You could simply create a template using that host's template settings. Makes things a bit faster instead of retyping it. If that makes sense.
Vice versa for services as well if you wanted to use it's configuration as a template.
Code: Select all
define host {
host_name testing template
alias testing template
address localhost
check_period 24x7
check_command check_ping!3000,80%!5000,100%!!!!!!
contacts nagiosadmin
notification_period 24x7
initial_state o
importance 0
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 2
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options a
notifications_enabled 1
notification_interval 5.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
notes Service config created via Puppet
retain_status_information 1
retain_nonstatus_information 1
_TESTFREE Service config created via Puppet
}
This is from my objects.cache file
Code: Select all
define host {
host_name local
alias local
address 127.0.0.1
check_period 24x7
check_command check_ping!3000,80%!5000,100%!!!!!!
contacts nagiosadmin
notification_period 24x7
initial_state o
importance 0
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 2
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 0
notification_options a
notifications_enabled 1
notification_interval 5.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
notes Service config created via Puppet
retain_status_information 1
retain_nonstatus_information 1
_TESTFREE Service config created via Puppet
}
Notice that my testing template carried over all the settings of the host local.
Also note that, anything you override while using this template with a new host/service will take what you overridden. For example Host address and host name.
Let me know if this helps!