Defined Type: nagios::nagios_service_http

Defined in:
manifests/nagios_service_http.pp

Overview

Nagios::Nagios_service_http

Nagios HTTP service monitoring

Parameters:

  • local_ip (Any) (defaults to: $nagios::local_ip)
  • site_name (Any) (defaults to: $title)
  • port (Any) (defaults to: 80)
  • url (Any) (defaults to: '')
  • service (Any) (defaults to: $nagios::service)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'manifests/nagios_service_http.pp', line 4

define nagios::nagios_service_http(
    $local_ip       = $nagios::local_ip,
    $site_name      = $title,
    $port           = 80,
    $url            = '',
    $service        = $nagios::service,
) {

  if $local_ip {
    $_local_ip = $local_ip
  } else {
    $_local_ip = $fqdn
  }

  @@nagios_service { "${::fqdn}_http_${site_name}":
    ensure              => present,
    use                 => 'generic-service',
    host_name           => $::fqdn,
    service_description => "${::fqdn}_http_${site_name}",
    check_command       => "check_http!${site_name} -I ${_local_ip} -p ${port} -u http://${site_name}${url}",
    notify              => Service[$nagios::service],
  }

}