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,
}
}
|