Templates should be used to ease repetitive work.
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://<server_name>/nagios/pnp/index.php?host=$HOSTNAME$
...
}
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
}