Defined Type: nut::cgi::ups

Defined in:
manifests/cgi/ups.pp

Overview

Add a UPS to visualise with the CGI scripts.

Examples:

Visualise a UPS

include ::nut::cgi
::nut::cgi::ups { 'sua1000i@remotehost':
  description => 'A remote UPS',
}

Parameters:

  • description (String)

    Description of the UPS.

  • ups (Nut::Device) (defaults to: $title)

    The UPS to visualise.

See Also:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'manifests/cgi/ups.pp', line 13

define nut::cgi::ups (
  String      $description,
  Nut::Device $ups         = $title,
) {

  if ! defined(Class['nut::cgi']) {
    fail('You must include the nut::cgi base class before using any nut::cgi defined resources')
  }

  ::concat::fragment { "nut hosts ${ups}":
    content => "MONITOR ${ups} \"${description}\"\n",
    target  => "${::nut::cgi::conf_dir}/hosts.conf",
  }
}