From a68885e2ebfb2584a145bdddb27038bc966c26e2 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 13:18:34 -0600 Subject: [PATCH 01/17] plugin/bind: add package for redhat systems --- manifests/plugin/bind.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/bind.pp b/manifests/plugin/bind.pp index 51d2bb7d7..5daef2d77 100644 --- a/manifests/plugin/bind.pp +++ b/manifests/plugin/bind.pp @@ -24,6 +24,12 @@ ) validate_array($views) + if $::osfamily == 'Redhat' { + package { 'collectd-bind': + ensure => $ensure, + } + } + collectd::plugin {'bind': ensure => $ensure, content => template('collectd/plugin/bind.conf.erb'), From b8fb2bc58d27c5e13c55d323ec0a102a8ae597d9 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:46:42 -0600 Subject: [PATCH 02/17] plugin/amqp: add package for redhat systems --- manifests/plugin/amqp.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/amqp.pp b/manifests/plugin/amqp.pp index cf4d3f494..2609fd034 100644 --- a/manifests/plugin/amqp.pp +++ b/manifests/plugin/amqp.pp @@ -16,6 +16,12 @@ validate_bool($amqppersistent) + if $::osfamily == 'Redhat' { + package { 'collectd-amqp': + ensure => $ensure, + } + } + collectd::plugin {'amqp': ensure => $ensure, content => template('collectd/plugin/amqp.conf.erb'), From ca26ce801ac30dc1bc2935982372e5d520795a46 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:47:08 -0600 Subject: [PATCH 03/17] plugin/curl: add package for redhat systems --- manifests/plugin/curl.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/plugin/curl.pp b/manifests/plugin/curl.pp index da577ad61..cba5a5dfa 100644 --- a/manifests/plugin/curl.pp +++ b/manifests/plugin/curl.pp @@ -4,6 +4,13 @@ $interval = undef, $pages = { }, ) { + + if $::osfamily == 'Redhat' { + package { 'collectd-curl': + ensure => $ensure, + } + } + collectd::plugin {'curl': ensure => $ensure, interval => $interval, From 97e126ddb645cc81607bc5af74c1985e93ce623c Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:47:21 -0600 Subject: [PATCH 04/17] plugin/curl_json: add package for redhat systems --- manifests/plugin/curl_json.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/curl_json.pp b/manifests/plugin/curl_json.pp index 6eb6861ba..b571b4a1f 100644 --- a/manifests/plugin/curl_json.pp +++ b/manifests/plugin/curl_json.pp @@ -11,6 +11,12 @@ include collectd::params validate_hash($keys) + if $::osfamily == 'Redhat' { + package { 'collectd-curl_json': + ensure => $ensure, + } + } + $conf_dir = $collectd::params::plugin_conf_dir # This is deprecated file naming ensuring old style file removed, and should be removed in next major relese From 094fe12a458da5015bd0b41071135a3db8f5e6f2 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:50:45 -0600 Subject: [PATCH 05/17] plugin/iptables: add package for redhat systems --- manifests/plugin/iptables.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/iptables.pp b/manifests/plugin/iptables.pp index edb3862d1..8e0dd76a0 100644 --- a/manifests/plugin/iptables.pp +++ b/manifests/plugin/iptables.pp @@ -6,6 +6,12 @@ ) { validate_hash($chains) + if $::osfamily == 'Redhat' { + package { 'collectd-iptables': + ensure => $ensure, + } + } + collectd::plugin {'iptables': ensure => $ensure, content => template('collectd/plugin/iptables.conf.erb'), From e17fd8ae42730d2dc8f11110b350b77c8df3fd64 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:51:15 -0600 Subject: [PATCH 06/17] plugin/mysql: add package for redhat systems --- manifests/plugin/mysql.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/plugin/mysql.pp b/manifests/plugin/mysql.pp index 8830123f5..4dcd03895 100644 --- a/manifests/plugin/mysql.pp +++ b/manifests/plugin/mysql.pp @@ -3,6 +3,13 @@ class collectd::plugin::mysql ( $interval = undef, ){ + + if $::osfamily == 'Redhat' { + package { 'collectd-mysql': + ensure => $ensure, + } + } + collectd::plugin { 'mysql': interval => $interval, } From a5340e5ed3de48144010c7e4f8b18fbe80fedef9 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:53:14 -0600 Subject: [PATCH 07/17] plugin/nginx: add package for redhat systems --- manifests/plugin/nginx.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/nginx.pp b/manifests/plugin/nginx.pp index cb0fbdc70..b553f0b23 100644 --- a/manifests/plugin/nginx.pp +++ b/manifests/plugin/nginx.pp @@ -10,6 +10,12 @@ $interval = undef, ) { + if $::osfamily == 'Redhat' { + package { 'collectd-nginx': + ensure => $ensure, + } + } + collectd::plugin {'nginx': ensure => $ensure, content => template('collectd/plugin/nginx.conf.erb'), From 4e926bc9f73d4186a0146c5df803147d54b18c48 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:54:18 -0600 Subject: [PATCH 08/17] plugin/perl: add package for redhat systems --- manifests/plugin/perl.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/perl.pp b/manifests/plugin/perl.pp index 2b8af65e5..6b3824e00 100644 --- a/manifests/plugin/perl.pp +++ b/manifests/plugin/perl.pp @@ -8,6 +8,12 @@ include collectd::params $conf_dir = $collectd::params::plugin_conf_dir + if $::osfamily == 'Redhat' { + package { 'collectd-perl': + ensure => $ensure, + } + } + collectd::plugin { 'perl': ensure => $ensure, globals => true, From 78e49089d851486c3f06a5c0ca27c02509f7f824 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:54:31 -0600 Subject: [PATCH 09/17] plugin/ping: add package for redhat systems --- manifests/plugin/ping.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/ping.pp b/manifests/plugin/ping.pp index 61127b6e6..88c4411f2 100644 --- a/manifests/plugin/ping.pp +++ b/manifests/plugin/ping.pp @@ -12,6 +12,12 @@ validate_array($hosts) + if $::osfamily == 'Redhat' { + package { 'collectd-ping': + ensure => $ensure, + } + } + $conf_dir = $collectd::params::plugin_conf_dir file { From 7ffa8dbd4ee03ff0dbcf18c620d0bb4edabfe0bb Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:54:50 -0600 Subject: [PATCH 10/17] plugin/python: add package for redhat systems --- manifests/plugin/python.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/python.pp b/manifests/plugin/python.pp index 2c2c3919f..5e0cbe801 100644 --- a/manifests/plugin/python.pp +++ b/manifests/plugin/python.pp @@ -11,6 +11,12 @@ validate_hash($config) + if $::osfamily == 'Redhat' { + package { 'collectd-python': + ensure => $ensure, + } + } + $conf_dir = $collectd::params::plugin_conf_dir # This is deprecated file naming ensuring old style file removed, and should be removed in next major relese From e9f8110f8127267938a3a8ed3544c890376e6c51 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:55:05 -0600 Subject: [PATCH 11/17] plugin/sensors: add package for redhat systems --- manifests/plugin/sensors.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/sensors.pp b/manifests/plugin/sensors.pp index acc4f31fe..a85421db5 100644 --- a/manifests/plugin/sensors.pp +++ b/manifests/plugin/sensors.pp @@ -7,6 +7,12 @@ $interval = undef, ) { + if $::osfamily == 'Redhat' { + package { 'collectd-sensors': + ensure => $ensure, + } + } + collectd::plugin {'sensors': ensure => $ensure, content => template('collectd/plugin/sensors.conf.erb'), From ec761d320627e5b69e4622987ed6dbf2f58445b2 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:56:25 -0600 Subject: [PATCH 12/17] plugin/snmp: add package for redhat systems --- manifests/plugin/snmp.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/snmp.pp b/manifests/plugin/snmp.pp index 1c4b43ca3..c476760c5 100644 --- a/manifests/plugin/snmp.pp +++ b/manifests/plugin/snmp.pp @@ -7,6 +7,12 @@ ) { validate_hash($data, $hosts) + if $::osfamily == 'Redhat' { + package { 'collectd-snmp': + ensure => $ensure, + } + } + collectd::plugin {'snmp': ensure => $ensure, content => template('collectd/plugin/snmp.conf.erb'), From a334b6e989acb988b2783d90e91c99ab7cff8e88 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:57:20 -0600 Subject: [PATCH 13/17] plugin/write_http: add package for redhat systems --- manifests/plugin/write_http.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/write_http.pp b/manifests/plugin/write_http.pp index 3497071bf..cfa5e7942 100644 --- a/manifests/plugin/write_http.pp +++ b/manifests/plugin/write_http.pp @@ -7,6 +7,12 @@ validate_hash($urls) + if $::osfamily == 'Redhat' { + package { 'collectd-write_http': + ensure => $ensure, + } + } + collectd::plugin {'write_http': ensure => $ensure, content => template('collectd/plugin/write_http.conf.erb'), From 1c463e345164b177f222bc25bc0babfc4c443322 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 21:59:48 -0600 Subject: [PATCH 14/17] plugin/write_riemann: add package for redhat systems --- manifests/plugin/write_riemann.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/write_riemann.pp b/manifests/plugin/write_riemann.pp index 95dd7d969..b85b2c352 100644 --- a/manifests/plugin/write_riemann.pp +++ b/manifests/plugin/write_riemann.pp @@ -11,6 +11,12 @@ validate_bool($store_rates) validate_bool($always_append_ds) + if $::osfamily == 'Redhat' { + package { 'collectd-write_riemann': + ensure => $ensure, + } + } + collectd::plugin {'write_riemann': ensure => $ensure, content => template('collectd/plugin/write_riemann.conf.erb'), From a101e470a4a1a591f4fc27bfb4af46122282021d Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 22:52:17 -0600 Subject: [PATCH 15/17] plugin/postgresql: add package for redhat systems --- manifests/plugin/postgresql.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/plugin/postgresql.pp b/manifests/plugin/postgresql.pp index e3f7b21ca..0930346ae 100644 --- a/manifests/plugin/postgresql.pp +++ b/manifests/plugin/postgresql.pp @@ -8,6 +8,12 @@ ) { include collectd::params + if $::osfamily == 'Redhat' { + package { 'collectd-postgresql': + ensure => $ensure, + } + } + collectd::plugin {'postgresql': ensure => $ensure, interval => $interval, From 15f9ec566e7f1468f422af473b8ccf8b53cd9aa6 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 8 Jan 2015 22:52:44 -0600 Subject: [PATCH 16/17] plugin/varnish: package should also adhere to the ensure param passed --- manifests/plugin/varnish.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin/varnish.pp b/manifests/plugin/varnish.pp index 1aeb9c74a..e2b1f5d00 100644 --- a/manifests/plugin/varnish.pp +++ b/manifests/plugin/varnish.pp @@ -13,7 +13,7 @@ if $::osfamily == 'Redhat' { package { 'collectd-varnish': - ensure => installed + ensure => $ensure, } } From 06ad3cd3418d25a0cd17bf1357098693e8dae8c4 Mon Sep 17 00:00:00 2001 From: Jeremy Kitchen Date: Wed, 7 Jan 2015 20:44:33 +0000 Subject: [PATCH 17/17] arrayify the values and collects otherwise if you don't pass in an array you get a really awful error :) --- templates/plugin/snmp.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/plugin/snmp.conf.erb b/templates/plugin/snmp.conf.erb index 379184c15..0d0511943 100644 --- a/templates/plugin/snmp.conf.erb +++ b/templates/plugin/snmp.conf.erb @@ -5,7 +5,7 @@ Type "<%= val['Type'] %>" Table <%= val['Table'] %> Instance "<%= val['Instance'] %>" - Values <% val['Values'].sort.each do |x| -%>"<%= x %>" <% end %> + Values <% Array(val['Values']).sort.each do |x| -%>"<%= x %>" <% end %> <% end -%> <% @hosts.sort_by {|k,v| k}.each do |key,val| -%> @@ -13,7 +13,7 @@ Address "<%= val['Address'] %>" Version <%= val['Version'] %> Community "<%= val['Community'] %>" - Collect <% val['Collect'].sort.each do |x| -%>"<%= x -%>" <% end %> + Collect <% Array(val['Collect']).sort.each do |x| -%>"<%= x -%>" <% end %> Interval <%= val['Interval'] %> <% end -%>