Manage templates and time periods

Overview

OP5 Monitor comes with a standard set of templates and time periods you can use when creating new hosts, services, contacts, and graphs. You can update the default template values or create new ones.

Time periods are reusable configuration objects that you can use in your templates, as well as in other object definitions.

The procedures below explain how to create and update templates and time periods. You can also use the standard configuration shortcuts to perform other operations on them. For more information, see Configuration shortcuts.

Caution: Configuration changes are not final until you click Save to save your changes to the OP5 Monitor database. For more information, see Saving configuration changes and viewing the changelog.

Before you begin

Configuring host, service, and contact templates are complex tasks which require a good understanding of how monitoring works in OP5 Monitor. For more information on monitoring with OP5 Monitor, see the Monitor section.

Create or update a host, service, or contact template

To create or update a host, service, or contact template:

  1. Click Manage > Configure.
  2. In the Templates section, click Host templates, Service templates, or Contact templates.
  3. You can now do one of the following:
    • Click New to create a new template.
    • Enter an existing template name in the Search field or select it from the drop-down list, then click Go. OP5 Monitor pre-fills the template values.
  4. Enter or update the template name.
  5. To base this template on an existing template:
    1. Enter or select the other template name in the template field.
    2. Click Force template values to overwrite existing values with the new ones. OP5 Monitor displays any differences in the selected template.
    3. Select Apply template changes to apply the changes, or Reset to reset the values.
  6. Enter or update the template values, as required. For more details of the options you can update, see the following:
  7. Click Submit.

Host options

The table below lists the options you can configure for hosts.

Option Description
alias Descriptive name for the host.
display_name This value is not used.
address IP address or host name. Using a host name makes monitoring this host dependent on having a working DNS.
hostgroups Host groups of which the host is a member.

parents

Parents of the host. For more information, see Parenting.

children

Children of the host. For more information, see Parenting.
check_command Command to use for host checks. Click Syntax help to expand a command help section, or Edit check command to be redirected to the command configuration page to update the command. For more information, see Create and update commands.

check_command_args

Arguments of the check command. You can consult the Syntax help for help with command line arguments.

contacts

Individual host contacts, used for the following:

  • Sending notifications for this host.
  • Granting access to the host, for users who do not have access to all hosts.
contact_groups

Contact groups for the host, used for the following:

  • Sending notifications for this host.
  • Granting access to the host, for users who do not have access to all hosts.
max_check_attemps Number of times OP5 Monitor tries to recheck the host, if it returns any kind of problem state. Setting the value to 1 causes OP5 Monitor to alert directly without retrying.
check_interval Number of minutes between regular host checks. This does not include any on-demand checks. For more information on on-demand checks, see On-demand checks.
retry_interval Number of minutes between check retries when a host is in a problem state, before the state changes to hard.

check_period

Period for checking the host, based on pre-defined time periods.
obsess Whether to execute the obsessive-compulsive command after each host check.
check_freshness Whether to check passive results for freshness, which is based on the freshness_threshold.
freshness_threshold Threshold for freshness, in seconds. Set to 0 if you want OP5 Monitor to determine the threshold.
active_checks_enabled Whether to perform active checks, which are checks performed by local OP5 Monitor rather than check results received from an external source.
passive_checks_enabled Whether to perform passive checks, which are check results received from an external source rather than performed by local OP5 Monitor. Often used in distributed setups.
event_handler Command to run if event handlers are enabled and a host just changed status.
event_handler_args Arguments for the event handler command.
event_handler_enabled Whether event handlers are enabled. Allows OP5 Monitor to perform additional actions in the event of a status change.
low_flap_threshold

Defines the number of minutes after which a flapping host is no longer considered in flapping state and OP5 Monitor can start sending notifications again. Flapping hosts are hosts which frequently change state.

Default value: 5

high_flap_threshold

Defines the number of minutes after which a host is considered to enter flapping state and OP5 Monitor stops sending notifications.

Default value: 20

flap_detection_enabled Whether to enable detection of flapping state for the host.
flap_detection_options States to use in flap detection logic.
process_perf_data Whether to log processing performance data, which is used for creating graphs.
retain_status_information Whether to save the status information for the host every hour, so it can be reloaded after changes to OP5 Monitor.
retain_nonstatus_information Whether to save other information for the service every hour, so that service checks can derive average values over a longer term.
notification_interval Number of minutes between repeat notifications for a problem state. Set this to the recommended value of 0 if you only want OP5 Monitor to send one notification.
first_notification_delay Number of minutes to wait after a host enters hard state before sending a notification.
notification_period

Period for sending out notifications for the host, based on pre-defined time periods. The time period must coincide with a configured contact time period for OP5 Monitor to send notifications.

notification_options One or more states for which to send notifications.
notifications_enabled Whether notifications are enabled for the host.
stalking_options Status changes to log for stalking, a debugging mode where OP5 Monitor logs every status change.
file_id File where the configuration is saved. Changing this value is not recommended.
icon_image Image file to use for the icon.
icon_image_alt Alternative text which appears when the user hovers the cursor over the icon.
statusmap_image Host icon to use for status and network maps.
notes Descriptive information about the host.
action_url Optional URL for extra host actions page in the host view Actions column.
notes_url Optional URL or relative path to a notes page for the host accessed from the host view Actions column.
2d_coords Custom x- and y-coordinates for a status map if you want to draw your own map.
Custom variable Custom variables for this host. For more information on custom variables, see Custom variables.

Service options

The table below lists the options you can configure for services.

Option Description
display_name Name used when displaying the service in the user interface. This value is not used.

is_volatile

Set to Yes if the service needs to treated as in a volatile state, where notifications, logging and applicable event handlers are triggered every time the service is checked after it has gone into a hard state and it is still in a hard state. This option is useful for services that are meant to automatically reset to an OK state each time they are checked or events such as security alerts that need attention every time there is a problem, not just the first time.

If you are interested in just logging, use stalking_options instead.

check_command Command to use for service checks. Click Syntax help to expand a command help section, or Edit check command to be redirected to the command configuration page to update the command. For more information, see Create and update commands.

check_command_args

Arguments of the check command. You can consult the Syntax help for help with command line arguments.
servicegroups Service groups of which the service is a member.
max_check_attemps Number of times OP5 Monitor tries to recheck the service, if it returns any kind of problem state. Setting the value to 1 causes OP5 Monitor to alert directly without retrying.
check_interval Number of minutes between regular service checks. This does not include any on-demand checks. For more information on on-demand checks, see On-demand checks.
retry_interval Number of minutes between check retries when a service is in a problem state, before the state changes to hard.
active_checks_enabled Whether to perform active checks, which are checks performed by local OP5 Monitor rather than check results received from an external source.
passive_checks_enabled Whether to perform passive checks, which are check results received from an external source rather than performed by local OP5 Monitor. Often used in distributed environments.

check_period

Period for checking the service, based on pre-defined time periods.
parallelize_check This option is deprecated.
obsess Whether to execute the obsessive-compulsive command after each service check.
check_freshness Whether to check passive results for freshness, based on the freshness_threshold.
freshness_threshold Threshold for freshness, in seconds. Set to 0 if you want OP5 Monitor to determine the threshold.
event_handler Command to run if event handlers are enabled and a service just changed status.
event_handler_args Arguments for the event handler command.
event_handler_enabled Whether event handlers are enabled. Allows OP5 Monitor to perform additional actions in the event of a status change.
low_flap_threshold

Defines the number of minutes after which a flapping service is no longer considered in flapping state and OP5 Monitor can start sending notifications again. Flapping services are services which frequently change state.

Default value: 5

high_flap_threshold

Defines the number of minutes after which a service is considered to enter flapping state and OP5 Monitor stops sending notifications.

Default value: 20

flap_detection_enabled Whether to enable detection of flapping state for the service.
flap_detection_options States to use in flap detection logic.
process_perf_data Whether or not to log processing performance data, which is used for creating graphs.
retain_status_information Whether to save the status information for the service every hour, so it can be reloaded after changes to OP5 Monitor.
retain_nonstatus_information Whether to save other information for the service every hour, so that service checks can derive average values over a longer term.
notification_interval Number of minutes between repeat notifications for a problem state. Set this to the recommended value of 0 if you only want one OP5 Monitor to send one notification.
first_notification_delay Number of minutes to wait after a host enters hard state before sending a notification.
notification_period Period for sending out notifications for the service, based on pre-defined time periods. The time period must coincide with a configured contact time period for OP5 Monitor to send notifications.
notification_options One or more states for which to send notifications.
notifications_enabled Whether notifications are enabled for the service.
contacts

Individual contacts, used for the following:

  • Sending notifications for this service.
  • Granting access to the service, for users who do not have access to all services.
contact_groups

Contact groups for the host, used for the following:

  • Sending notifications for this service.
  • Granting access to the service, for users who do not have access to all services.
stalking_options Status changes to log for stalking, a debugging mode where OP5 Monitor logs every status change.
file_id File where the configuration is saved. Changing this value is not recommended.
notes Descriptive information about the service.
notes_url Optional URL for extra service actions page in the service view Actions column.
action_url Optional URL or relative path to a notes page for the service accessed from the service view Actions column.
icon_image Image file to use for the icon.
icon_image_alt Alternative text which appears when the user hovers the cursor over the icon.
Custom variable Custom variables for this service. For more information on custom variables, see Custom variables.

Contact options

The table below lists the options you can configure for contacts.

Option Description
host_notifications_enabled Whether to send notifications about host problems and recoveries to the contact.
service_notifications_enabled Whether to send notifications about service problems and recoveries to the contact.
can_submit_commands Whether the contact is allowed to submit commands, such as perform acknowledgements on the host or service.
retain_status_information Whether to save host or service status information every hour for the contact.
retain_nonstatus_information Whether to save other host or service information every hour for the contact.
host_notification_period Period for receiving notifications for hosts, based on pre-defined time periods.
service_notification_period Period for receiving notifications for services, based on pre-defined time periods.
host_notification_options Types of notifications the contact will receive about hosts.
service_notification_options Types of notifications the contact will receive about services.
host_notification_cmds Command to use to send host notifications.
host_notification_cmds_args Arguments for the host notification command.
service_notification_cmds Command to use to send service notifications.
service_notification_cmds_args Arguments for the service notification command.
contactgroups Contact groups of which the contact is a member.
email Contact email address for notifications.
pager

Contact pager or telephone number, with no spaces and no leading + or 00 for international numbers. For example, 41317740924.

addressx Address lines 1 to 6, can contain any values.
file_id File where the configuration is saved. Changing this value is not recommended.
Custom variable Custom variables to use for this contact. For more information on custom variables, see Custom variables.

Create or update a time period

Time periods are used in templates and other object definitions, for example, during the creation of contacts, to determine when OP5 Monitor can send notifications.

  1. Click Manage > Configure.
  2. In the Checks and notifications section, click Time periods.
  3. You can now do one of the following:
    • Click New to create a new time period.
    • Enter an existing time period name in the Search field or select it from the drop-down list, then click Go. OP5 Monitor pre-fills the time period values.
  4. Enter or update the short name for the time period in timeperiod_name and the long name in alias.
  5. Enter or update the time period values, as required. For more information, see Time period options.
  6. Click Submit.

Time period options

The table below lists the options you can configure for time periods.

Option Description
exclude Other time period definitions to exclude from this time period.
sunday to saturday Time ranges to include for each day, in the format HH:MM-HH:MM using a 24 hour clock. You can define multiple time ranges by separating them with a comma. For example: 00:00-01:00,03:00-06:00.
file_id Default configuration file. Changing this value is not recommended.
Guided or manual Select Manual to manually add the other details. For information on the syntax you need to use, see Nagios time period object definitions . If you select Guided, specify the list of time periods which are excluded from the days and times specified, using the fields listed below.
Exception type

Set to the following values:

  • Date, to enter specific dates for exclusion, for example, 1 February 2016.
  • Day, to enter exclusions as frequencies, for example, first Sunday of every month.

Then set the values below accordingly.

Interval

Choose between the following:

  • For date exceptions, a single date or range of dates to exclude.
  • For day exceptions, a single day or range of days to exclude.
Date, From date, To date, Frequency (Date exception types only) Specify the single date or date range plus frequency to exclude, depending on the Interval chosen.
Weekday, From weekday, To weekday, Frequency (Day exception types only) Specify the single day or range of days plus frequency to exclude, depending on the Interval chosen.
Add and Added exceptions Click Add to add this exception to the list of Added exceptions, then specify more exceptions, if required.
Remove and Edit Select an exception, then click Remove or Edit to remove or edit it.

Configure a graph template

OP5 Monitor uses templates for creating graphs, based on their association with specific check commands. By default, the graph templates distributed with OP5 Monitor are located in directory /op5/monitor/op5/pnp/templates.dist, although you can create your own custom templates in /op5/monitor/op5/pnp/templates. The templates are PHP files named after the check command they work with.

This procedure explains how to associate a graph template with a check command. For guidance in creating custom graph templates to use in OP5 Monitor, see Create a new graph template.

  1. Click Manage > Configure.
  2. In the Templates section, click Graph templates.
  3. To search for a graph template, enter it in the search field or select it from the drop-down list in the Graph template field, then click Go.
  4. Select the plugin to associate with the graph template in Check command.
  5. Click Submit.