Skip to content

Commit

Permalink
Make plugins passing the $interval parameter
Browse files Browse the repository at this point in the history
only for those using collectd::plugin
  • Loading branch information
txaj committed Dec 11, 2014
1 parent 3fae4b2 commit 2190a9e
Show file tree
Hide file tree
Showing 46 changed files with 206 additions and 110 deletions.
6 changes: 4 additions & 2 deletions manifests/plugin/amqp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
$amqppersistent = true,
$graphiteprefix = 'collectd.',
$escapecharacter = '_',
$interval = undef,
) {

validate_bool($amqppersistent)

collectd::plugin {'amqp':
ensure => $ensure,
content => template('collectd/plugin/amqp.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/amqp.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class collectd::plugin::apache (
$ensure = present,
$instances = { 'localhost' => { 'url' => 'http://localhost/mod_status?auto' } },
$interval = undef,
) {

validate_hash($instances)
Expand All @@ -13,7 +14,8 @@
}

collectd::plugin {'apache':
ensure => $ensure,
content => template('collectd/plugin/apache.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/apache.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/bind.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$serverstats = true,
$zonemaintstats = true,
$views = [],
$interval = undef,
) {

validate_bool(
Expand All @@ -24,7 +25,8 @@
validate_array($views)

collectd::plugin {'bind':
ensure => $ensure,
content => template('collectd/plugin/bind.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/bind.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/contextswitch.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:ContextSwitch
class collectd::plugin::contextswitch (
$ensure = present,
$ensure = present,
$interval = undef,
) {
collectd::plugin {'contextswitch':
ensure => $ensure
ensure => $ensure,
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/cpu.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:CPU
class collectd::plugin::cpu (
$ensure = present,
$ensure = present,
$interval = undef,
) {
collectd::plugin {'cpu':
ensure => $ensure
ensure => $ensure,
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/csv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
class collectd::plugin::csv (
$ensure = present,
$datadir = '/etc/collectd/var/lib/collectd/csv',
$interval = undef,
$storerates = false
) {

collectd::plugin {'csv':
ensure => $ensure,
content => template('collectd/plugin/csv.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/csv.conf.erb'),
interval => $interval,
}
}
8 changes: 5 additions & 3 deletions manifests/plugin/curl.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#
class collectd::plugin::curl (
$ensure = present,
$pages = { },
$ensure = present,
$interval = undef,
$pages = { },
) {
collectd::plugin {'curl':
ensure => $ensure,
ensure => $ensure,
interval => $interval,
}
$defaults = {
'ensure' => $ensure
Expand Down
6 changes: 4 additions & 2 deletions manifests/plugin/df.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$ensure = present,
$fstypes = [],
$ignoreselected = false,
$interval = undef,
$mountpoints = [],
$reportbydevice = false,
$reportinodes = true,
Expand All @@ -25,7 +26,8 @@
)

collectd::plugin {'df':
ensure => $ensure,
content => template('collectd/plugin/df.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/df.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/disk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
$ensure = present,
$disks = [],
$ignoreselected = false,
$interval = undef,
) {

validate_array($disks)
validate_bool($ignoreselected)

collectd::plugin {'disk':
ensure => $ensure,
content => template('collectd/plugin/disk.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/disk.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/entropy.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# https://collectd.org/wiki/index.php/Plugin:Entropy
class collectd::plugin::entropy (
$ensure = present,
$ensure = present,
$interval = undef,
) {

collectd::plugin {'entropy':
ensure => $ensure,
ensure => $ensure,
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/filecount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
class collectd::plugin::filecount (
$ensure = present,
$directories = {},
$interval = undef,
) {
collectd::plugin {'filecount':
ensure => $ensure,
content => template('collectd/plugin/filecount.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/filecount.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
$ensure = present,
$interfaces = [],
$ignoreselected = false,
$interval = undef,
) {

validate_array($interfaces)
validate_bool($ignoreselected)

collectd::plugin {'interface':
ensure => $ensure,
content => template('collectd/plugin/interface.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/interface.conf.erb'),
interval => $interval,
}
}
10 changes: 6 additions & 4 deletions manifests/plugin/iptables.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# https://collectd.org/wiki/index.php/Plugin:IPTables
class collectd::plugin::iptables (
$ensure = present,
$chains = {},
$ensure = present,
$chains = {},
$interval = undef,
) {
validate_hash($chains)

collectd::plugin {'iptables':
ensure => $ensure,
content => template('collectd/plugin/iptables.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/iptables.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/irq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
$ensure = present,
$irqs = [],
$ignoreselected = false,
$interval = undef,
) {
validate_array($irqs)
validate_bool($ignoreselected)

collectd::plugin {'irq':
ensure => $ensure,
content => template('collectd/plugin/irq.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/irq.conf.erb'),
interval => $interval,
}
}
8 changes: 5 additions & 3 deletions manifests/plugin/libvirt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
$interface_device = undef,
$ignore_selected = undef,
$hostname_format = undef,
$interface_format = undef
$interface_format = undef,
$interval = undef,
) {
validate_string($connection)

Expand All @@ -27,7 +28,8 @@
}

collectd::plugin { 'libvirt':
ensure => $ensure,
content => template('collectd/plugin/libvirt.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/libvirt.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/load.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:Load
class collectd::plugin::load (
$ensure = present,
$ensure = present,
$interval = undef,
) {
collectd::plugin {'load':
ensure => $ensure
ensure => $ensure,
interval => $interval,
}
}
8 changes: 5 additions & 3 deletions manifests/plugin/logfile.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# https://collectd.org/wiki/index.php/Plugin:LogFile
class collectd::plugin::logfile (
$ensure = present,
$interval = undef,
$log_level = 'info',
$log_file = '/var/log/collectd.log',
$log_timestamp = true
) {
collectd::plugin { 'logfile':
ensure => $ensure,
content => template('collectd/plugin/logfile.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/logfile.conf.erb'),
interval => $interval,
# Load logging plugin first
# https://github.com/pdxcat/puppet-module-collectd/pull/166#issuecomment-50591413
order => '05',
order => '05',
}
}
12 changes: 7 additions & 5 deletions manifests/plugin/memcached.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# https://collectd.org/wiki/index.php/Plugin:memcached
class collectd::plugin::memcached (
$ensure = present,
$host = '127.0.0.1',
$port = 11211,
$ensure = present,
$host = '127.0.0.1',
$interval = undef,
$port = 11211,
) {
collectd::plugin {'memcached':
ensure => $ensure,
content => template('collectd/plugin/memcached.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/memcached.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/memory.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:Memory
class collectd::plugin::memory (
$ensure = present,
$ensure = present,
$interval = undef,
) {
collectd::plugin {'memory':
ensure => $ensure
ensure => $ensure,
interval => $interval,
}
}
8 changes: 6 additions & 2 deletions manifests/plugin/mysql.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# MySQL plugin
# https://collectd.org/wiki/index.php/Plugin:MySQL
class collectd::plugin::mysql {
collectd::plugin { 'mysql': }
class collectd::plugin::mysql (
$interval = undef,
){
collectd::plugin { 'mysql':
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/network.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
$timetolive = undef,
$maxpacketsize = undef,
$forward = undef,
$interval = undef,
$reportstats = undef,
$listeners = { },
$servers = { },
Expand All @@ -16,8 +17,9 @@
}

collectd::plugin {'network':
ensure => $ensure,
content => template('collectd/plugin/network.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/network.conf.erb'),
interval => $interval,
}
$defaults = {
'ensure' => $ensure
Expand Down
6 changes: 4 additions & 2 deletions manifests/plugin/nfs.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:NFS
class collectd::plugin::nfs (
$ensure = present,
$ensure = present,
$interval = undef,
) {
collectd::plugin {'nfs':
ensure => $ensure
ensure => $ensure,
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/nginx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
$verifypeer = undef,
$verifyhost = undef,
$cacert = undef,
$interval = undef,
) {

collectd::plugin {'nginx':
ensure => $ensure,
content => template('collectd/plugin/nginx.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/nginx.conf.erb'),
interval => $interval,
}
}
6 changes: 4 additions & 2 deletions manifests/plugin/ntpd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
$port = 123,
$reverselookups = false,
$includeunitid = false,
$interval = undef,
) {
collectd::plugin {'ntpd':
ensure => $ensure,
content => template('collectd/plugin/ntpd.conf.erb'),
ensure => $ensure,
content => template('collectd/plugin/ntpd.conf.erb'),
interval => $interval,
}
}
Loading

0 comments on commit 2190a9e

Please sign in to comment.