Defined Type: monit::check::filesystem

Defined in:
manifests/check/filesystem.pp

Overview

monit::check::filesystem

Implement Monit’s CHECK FILESYSTEM

Parameters:

  • template (String) (defaults to: 'monit/check/filesystem.erb')

    Template used to generate the check file.

  • path (Optional[Variant[ Stdlib::Absolutepath, Pattern['^/'] ]]) (defaults to: undef)

    Path of the filesystem to check (Deprecated. Use $paths).

  • paths (Variant[ Array[Stdlib::Absolutepath], Array[Pattern['^/']] ]) (defaults to: [])

    List of paths of filesystems to check. If empty, will check all mounted filesystems, but the ones with a type in $monit::fs_banned_types.

  • ensure (Monit::Check::Ensure) (defaults to: 'present')

    Whether this check must be present or absent.

  • group (String) (defaults to: $name)

    Monit group.

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

    Service poll time.

  • alerts (Array[String]) (defaults to: [])

    Alert recipients (with event filters) to set.

  • noalerts (Array[String]) (defaults to: [])

    Alerts to disable for this check.

  • tests (Monit::Check::Tests) (defaults to: [])

    Monit tests.

  • depends (Array[String]) (defaults to: [])

    Dependencies of this check on other checks.

  • priority (String) (defaults to: '20')

    Used as a prefix for the filename generated. Load order doesn’t matter to Monit. This is just a facility to organize your checks by filename.

  • bundle (String) (defaults to: $name)

    Used to group checks by filename. All checks in the same bundle will be added to the same filename.

  • order (Integer) (defaults to: 0)

    Order of the check within the bundle filename.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'manifests/check/filesystem.pp', line 35

define monit::check::filesystem (
  # Check type specific.
  String $template             = 'monit/check/filesystem.erb',
  Optional[Variant[
      Stdlib::Absolutepath,
      Pattern['^/']
  ]] $path                     = undef,
  Variant[
    Array[Stdlib::Absolutepath],
    Array[Pattern['^/']]
  ] $paths                     = [],

  # Common parameters.
  Monit::Check::Ensure $ensure = 'present',
  String $group                = $name,
  Optional[String] $every      = undef,
  Array[String] $alerts        = [],
  Array[String] $noalerts      = [],
  Monit::Check::Tests $tests   = [],
  Array[String] $depends       = [],
  String $priority             = '20',
  String $bundle               = $name,
  Integer $order               = 0,
) {
  if !empty($path) {
    warning('\$path parameter is deprecated and will be removed in future versions! Please use \$paths instead')
    $_paths = $paths + $path
  }
  else {
    $_paths = $paths
  }

  if empty($_paths) {
    $paths_real = keys($::facts['mountpoints'].filter |$key, $value| { !($value['filesystem'] in $monit::fs_banned_types) })
  }
  else {
    $paths_real = $_paths
  }
  $paths_real.each |$path| {
    monit::check::instance { "${name}_${path}_instance":
      ensure   => $ensure,
      name     => "${name}_${path}",
      type     => 'filesystem',
      header   => template($template),
      group    => $group,
      every    => $every,
      alerts   => $alerts,
      noalerts => $noalerts,
      tests    => $tests,
      depends  => $depends,
      priority => $priority,
      bundle   => $bundle,
      order    => $order,
    }
  }
}