Puppet Class: librenms::applications::smartmontools

Inherits:
librenms::params
Defined in:
manifests/applications/smartmontools.pp

Overview

Parameters:

  • enabled (Boolean) (defaults to: true)
  • cache (String) (defaults to: '/var/cache/smart')
  • use_sn (Boolean) (defaults to: true)
  • smart_options (Hash) (defaults to: {})


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/applications/smartmontools.pp', line 1

class librenms::applications::smartmontools (
  Boolean $enabled = true,

  String $cache = '/var/cache/smart',
  Boolean $use_sn = true,
  Hash $smart_options = {},
) inherits librenms::params {

    $snmpd_dir = $librenms::params::snmpd_dir

    if $enabled {
        $file_existance = 'present'
    } else {
        $file_existance = 'absent'
    }

    file {"${snmpd_dir}/smart.config":
        ensure  => $file_existance,
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        content => template('librenms/smart.conf.erb'),
    }

    file {'/etc/cron.d/smart':
        ensure => $file_existance,
        owner  => 'root',
        group  => 'root',
        mode   => '0644',
        source => 'puppet:///modules/librenms/smart_cron.d',
    }

    create_resources(librenms::fetch, {
            'smart' => {
            use => $enabled,
    }})

    librenms::snmpd{'smart':
        use      => $enabled,
        script   => 'smart',
        filename => 'smartmontools',
        do_sudo  => true,
    }
}