Defined Type: confdroid_nagios::nagios::objects::templates

Defined in:
manifests/nagios/objects/templates.pp

Summary

Define manages populates /etc/nagios/conf.d/templates.cfg.

Overview

confdroid_nagios::nagios::objects::templates.pp Module name: confdroid_nagios Author: 12ww1160 (12ww1160@confdroid.com) notifications. for the defined service or host.

Parameters:

  • ng_template_object (Optional[String]) (defaults to: undef)

    the object type for the templates. Valid options are contact, host and service.

  • ng_template_object_name (Optional[String]) (defaults to: undef)

    populates the name field, i.e. generic-contact, generic-host, generic-service.

  • ng_svc_notification_period (String) (defaults to: '24x7')

    Period in which to send out notifications for service events, i.e. 24x7.

  • ng_host_notification_period (String) (defaults to: '24x7')

    Period in which to send out notifications for host events , i.e. 24x7.

  • ng_service_notification_options (String) (defaults to: 'w,u,c,r,f,s')

    What service events to send out notifications for: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), f = notify when the service starts and stops flapping. n = none (the contact will not receive any type of service notifications).

  • ng_host_notification_options (String) (defaults to: 'd,u,r,f,s')

    What host events to send out notifications for: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), f = notify when the host starts and stops flapping, s = notify when host or service scheduled downtime starts and ends. n = none (the contact will not receive any type of host notifications).

  • ng_service_notification_commands (String) (defaults to: 'notify-service-by-email')

    Command to use for service event notification. Command must be defined in commands.cfg

  • ng_host_notification_commands (String) (defaults to: 'notify-host-by-email')

    Command to use for host event notification. Command must be defined in commands.cfg.

  • ng_object_register (String) (defaults to: '0')

    Whether to register the object to Nagios. Since this is a template definition, we do not want to register those.

  • ng_template_object_use (Optional[String]) (defaults to: undef)

    Which template to use for a given host or service definition, i.e. generic-host, generic-service etc.

  • ng_notifications_enabled (String) (defaults to: '1')

    Whether notifications are enabled. Valid options are 0 and 1.

  • ng_event_handler_enabled (String) (defaults to: '1')

    Whether event handlers are enabled. Valid options are 0 and 1.

  • ng_flap_detection_enabled (String) (defaults to: '1')

    Whether flap detection is enabled. Valid options are 0 and 1.

  • ng_process_perf_data (String) (defaults to: '1')

    Whether to process performance data. Valid options are 0 and 1.

  • ng_retain_status_information (String) (defaults to: '1')

    Whether to retain status information. Valid options are 0 and 1.

  • ng_retain_nonstatus_information (String) (defaults to: '1')

    Whether to retain non-status information. Valid options are 0 and 1.

  • ng_notification_period (String) (defaults to: '24x7')

    Which period in to send out

  • ng_notification_interval (String) (defaults to: '30')

    how often (in minutes) we should resend notifications for the current status.

  • ng_check_period (String) (defaults to: '24x7')

    Which period in to run checks for the defined object.

  • ng_max_check_attempts (String) (defaults to: '10')

    how often to check the defined object maximal.

  • ng_notification_options (Optional[String]) (defaults to: undef)

    see ng_service_notification_options and ng_host_notification_options.

  • ng_contact_groups (String) (defaults to: 'admins')

    contact groups for the defined object. Specified contact group must exit in contact_groups

  • ng_active_checks_enabled (String) (defaults to: '1')

    Whether to enable active checks. Valid options are 0 and 1.

  • ng_passive_checks_enabled (String) (defaults to: '1')

    Whether to enable passive checks. Valid options are 0 and 1.

  • ng_parallelize_check (String) (defaults to: '1')

    Whether to parallelize checks Valid options are 0 and 1.

  • ng_obsess_over_service (String) (defaults to: '1')

    Whether to obsess over the service. Valid options are 0 and 1.

  • ng_check_freshness (String) (defaults to: '0')

    Whether to check freshness. Valid options are 0 and 1.

  • ng_is_volatile (String) (defaults to: '0')

    Whether the service is volatile. Valid options are 0 and 1.

  • ng_check_interval (String) (defaults to: '5')

    How often to check the service under normal conditions.

  • ng_retry_interval (String) (defaults to: '1')

    Re-check the service every x minutes until a hard state can be determined.

  • ng_host_check_command (String) (defaults to: 'check-host-alive')

    the check command for host checks



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'manifests/nagios/objects/templates.pp', line 79

define confdroid_nagios::nagios::objects::templates (
  Optional[String] $ng_template_object        = undef,
  Optional[String] $ng_template_object_name   = undef,
  String $ng_svc_notification_period          = '24x7',
  String $ng_host_notification_period         = '24x7',
  String $ng_service_notification_options     = 'w,u,c,r,f,s',
  String $ng_host_notification_options        = 'd,u,r,f,s',
  String $ng_service_notification_commands    = 'notify-service-by-email',
  String $ng_host_notification_commands       = 'notify-host-by-email',
  String $ng_object_register                  = '0',
  Optional[String] $ng_template_object_use    = undef,
  String $ng_notifications_enabled            = '1',
  String $ng_event_handler_enabled            = '1',
  String $ng_flap_detection_enabled           = '1',
  String $ng_process_perf_data                = '1',
  String $ng_retain_status_information        = '1',
  String $ng_retain_nonstatus_information     = '1',
  String $ng_notification_period              = '24x7',
  String $ng_notification_interval            = '30',
  String $ng_check_period                     = '24x7',
  String $ng_check_interval                   = '5',
  String $ng_retry_interval                   = '1',
  String $ng_max_check_attempts               = '10',
  String $ng_host_check_command               = 'check-host-alive',
  Optional[String] $ng_notification_options   = undef,
  String $ng_contact_groups                   = 'admins',
  String $ng_active_checks_enabled            = '1',
  String $ng_passive_checks_enabled           = '1',
  String $ng_parallelize_check                = '1',
  String $ng_obsess_over_service              = '1',
  String $ng_check_freshness                  = '0',
  String $ng_is_volatile                      = '0',

) {
  $ng_nagios_server       = $confdroid_nagios::params::ng_nagios_server
  $ng_target_templates    = $confdroid_nagios::params::ng_target_templates
  $ng_templates_rule_erb  = $confdroid_nagios::params::ng_templates_rule_erb
  $fqdn                   = $confdroid_nagios::params::fqdn

  if $ng_nagios_server == $fqdn {
    concat::fragment { $name:
      target  => $ng_target_templates,
      content => template($ng_templates_rule_erb),
    }
  }
}