Defined Type: nut::client::upssched

Defined in:
manifests/client/upssched.pp

Overview

Define actions for upssched.

Examples:

Configure an action when local UPS has disconnected

class { '::nut::client':
  use_upssched => true,
}
::nut::client::upssched { 'local ups has disconnected':
  args       => [
    'upsgone',
    10,
  ],
  command    => 'start-timer',
  notifytype => 'commbad',
  ups        => 'test@localhost',
}

Parameters:

  • args (Array[Variant[String, Integer], 1])

    Additional arguments to pass to the command.

  • command (Enum['start-timer', 'cancel-timer', 'execute'])

    The command to run.

  • notifytype (Nut::Event)

    The event notification to apply the action to.

  • ups (Variant[Nut::Device, Enum['*']])

    The UPS to apply the action to, or “*” to apply to all.

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'manifests/client/upssched.pp', line 24

define nut::client::upssched (
  Array[Variant[String, Integer], 1]             $args,
  Enum['start-timer', 'cancel-timer', 'execute'] $command,
  Nut::Event                                     $notifytype,
  Variant[Nut::Device, Enum['*']]                $ups,
) {

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

  if $::nut::client::use_upssched {
    ::concat::fragment { "nut upssched ${title}":
      content => template("${module_name}/upssched.at.erb"),
      target  => "${::nut::common::conf_dir}/upssched.conf",
    }
  }
}