Skip to content

Commit

Permalink
Merge pull request #776 from juniorsysadmin/datatype-oracle
Browse files Browse the repository at this point in the history
collectd::plugin::oracle - Use data types
  • Loading branch information
bastelfreak authored Apr 4, 2018
2 parents 3e19fed + 4aead24 commit add56c9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
18 changes: 11 additions & 7 deletions manifests/plugin/oracle.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Oracle plugin
# https://collectd.org/wiki/index.php/Plugin:Oracle
class collectd::plugin::oracle (
$ensure = 'present',
$manage_package = undef,
$interval = undef,
Enum['present', 'absent'] $ensure = 'present',
Boolean $manage_package = false,
Optional[Integer[1]] $interval = undef,
) {

include ::collectd

$config_file = "${collectd::plugin_conf_dir}/15-oracle.conf"
$conf_dir = $collectd::plugin_conf_dir

if $manage_package {
package { 'collectd-oracle':
Expand All @@ -20,7 +21,7 @@
interval => $interval,
}

concat { $config_file:
concat { "${conf_dir}/15-oracle.conf":
ensure => $ensure,
mode => $collectd::config_mode,
owner => $collectd::config_owner,
Expand All @@ -33,10 +34,13 @@
'collectd_plugin_oracle_conf_header':
order => '00',
content => '<Plugin oracle>',
target => $config_file;
target => "${conf_dir}/15-oracle.conf",
}

concat::fragment {
'collectd_plugin_oracle_conf_footer':
order => '99',
content => '</Plugin>',
target => $config_file;
target => "${conf_dir}/15-oracle.conf",
}
}
4 changes: 3 additions & 1 deletion manifests/plugin/oracle/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
include ::collectd
include ::collectd::plugin::oracle

$conf_dir = $collectd::plugin_conf_dir

concat::fragment { "collectd_plugin_oracle_database_${name}":
order => '20',
content => template('collectd/plugin/oracle/database.conf.erb'),
target => $collectd::plugin::oracle::config_file,
target => "${conf_dir}/15-oracle.conf",
}
}
4 changes: 3 additions & 1 deletion manifests/plugin/oracle/query.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
include ::collectd
include ::collectd::plugin::oracle

$conf_dir = $collectd::plugin_conf_dir

concat::fragment { "collectd_plugin_oracle_query_${name}":
order => '10',
content => template('collectd/plugin/oracle/query.conf.erb'),
target => $collectd::plugin::oracle::config_file,
target => "${conf_dir}/15-oracle.conf",
}
}

0 comments on commit add56c9

Please sign in to comment.