====== Configuration templates ======
Templates should be used to ease repetitive work.
===== Enable PNP4Nagios for all host =====
In the generic host definition template, define **notes_url** to point to the pnp page:
define host{
name generic-host ; The name of this host template
...
notes_url http:///nagios/pnp/index.php?host=$HOSTNAME$
...
}
The **notes_url** icon will appear in the UI:
{{:nagios:host-notes-link.png|Notes URL link in UI}}
===== Define per host/group template =====
New definitions should inherit the generic-host template, while adding host/groupwise customization if needed. Example:
# Template for for all hosts of example company
define host{
name example-generic-host
use generic-host
hostgroups example-group
contact_groups example-admins
register 0
;example customs:
notification_period office_hours
...
}
# Template for all services of example company
define service{
name example-generic-service
use generic-service
contact_groups example-admins
register 0
;example customs:
notification_period office_hours
...
}
# The Contact Group as defined in the template
define contactgroup{
contactgroup_name example-admins
alias Example Administrators
members example-admin
}
# Individual contact in the Contact Group
define contact{
contact_name example-admin
email admin@example.com
...
}
# The Host Group as defined in the template
define hostgroup{
hostgroup_name example-group
alias Example Company Ltd
members example-router, example-web-server
}
===== Frequently customized options =====
* max_check_attempts (HARD problem state if reached)
* normal_check_interval
* retry_check_interval
* notification_interval
* notification_period
* notification_options (notify on what states?)
* notifications_enabled