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
45
46
47
48
49
50
51
52
53
54
|
# File 'manifests/plugins/iostat.pp', line 1
class collectd::plugins::iostat (
$modules,
$filter_metrics = false,
$filter_metric_rules = {},
$plugin_template = 'collectd/plugins/iostat/10-iostat.conf.erb',
$package_name = 'collectd-python',
$package_ensure = present,
$package_required = false
) {
validate_hash($modules)
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ] }
include collectd
if $::osfamily == 'RedHat' {
exec { 'install epel-release':
command => 'yum install -y epel-release',
before => Package['sysstat']
}
}
package { 'sysstat':
ensure => present,
}
file { ['/usr/share/collectd/iostat-collectd-plugin/']:
ensure => directory,
owner => root,
group => 'root',
mode => '0755',
before => File['get collectd_iostat_python.py']
}
file { 'get collectd_iostat_python.py':
ensure => present,
replace => 'yes',
path => '/usr/share/collectd/iostat-collectd-plugin/collectd_iostat_python.py',
owner => root,
group => 'root',
mode => '0755',
content => template('collectd/plugins/iostat/collectd_iostat_python.py.erb'),
require => Package['sysstat']
}
collectd::plugins::plugin_common { 'iostat':
modules => $modules,
filter_metrics => $filter_metrics,
filter_metric_rules => $filter_metric_rules,
package_name => $package_name,
package_ensure => $package_ensure,
package_required => $package_required,
plugin_file_name => '10-iostat.conf',
plugin_template => $plugin_template,
}
}
|