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://<server_name>/nagios/pnp/index.php?host=$HOSTNAME$
        ...
        }

The notes_url icon will appear in the UI: 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
nagios/configuration_templates.txt · Last modified: 2010-02-08 14:24 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0