summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-04-18 11:47:24 +0000
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-04-18 11:47:24 +0000
commit8b017ab9ff19f9a3773603fc33cc3820ec730c9e (patch)
treee759233ee0074d564c6d6ba18ca1596ae0946ab8 /manifests
parent3de81e20f12d274efb0352693e394e98c1484c2b (diff)
rearranged some definitions, fixed config issues
git-svn-id: https://svn/ipuppet/trunk/modules/munin@1229 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'manifests')
-rw-r--r--manifests/plugin.pp56
1 files changed, 32 insertions, 24 deletions
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index dbf8eb1..782f9f2 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -1,6 +1,10 @@
# plugin.pp - configure a specific munin plugin
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
# See LICENSE for the full license granted to you.
+# adapted and improved by admin(at)immerda.ch
+
+
+### configpaths
class munin::plugin::scriptpaths {
case $operatingsystem {
@@ -19,6 +23,7 @@ class munin::plugin::scriptpaths {
}
}
+### defines
define munin::plugin (
$ensure = "present",
@@ -87,6 +92,26 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') {
}
}
}
+define munin::plugin::deploy ($source = '', $enabled = 'true') {
+ $real_source = $source ? {
+ '' => "munin/plugins/$name",
+ default => $source
+ }
+ include munin::plugin::scriptpaths
+ debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=$munin::plugin::scriptpaths::script_path" )
+ file { "munin_plugin_${name}":
+ path => "$munin::plugin::scriptpaths::script_path/${name}",
+ source => "puppet://$servername/$real_source",
+ ensure => file,
+ mode => 0755, owner => root, group => 0;
+ }
+
+ if $enabled {
+ plugin{$name: ensure => present }
+ }
+}
+
+### clases for plugins
class munin::plugins::base {
case $operatingsystem {
@@ -148,47 +173,30 @@ class munin::plugins::linux inherits munin::plugins::base {
}
class munin::plugins::debian inherits munin::plugins::base {
- plugin { apt_all: ensure => present; }
+ munin::plugin { apt_all: ensure => present; }
}
class munin::plugins::vserver inherits munin::plugins::base {
- plugin {
+ munin::plugin {
[ netstat, processes ]:
ensure => present;
}
}
class munin::plugins::gentoo inherits munin::plugins::base {
- munin::plugin::deploy { "gentoo_lastupdated": }
+ munin::plugin::deploy { "gentoo_lastupdated": config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"}
}
class munin::plugins::centos inherits munin::plugins::base {
}
-define munin::plugin::deploy ($source = '', $enabled = 'true') {
- $real_source = $source ? {
- '' => "munin/plugins/$name",
- default => $source
- }
- include munin::plugin::scriptpaths
- debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=$munin::plugin::scriptpaths::script_path" )
- file { "munin_plugin_${name}":
- path => "$munin::plugin::scriptpaths::script_path/${name}",
- source => "puppet://$servername/$real_source",
- ensure => file,
- mode => 0755, owner => root, group => 0;
- }
- if $enabled {
- plugin{$name: ensure => present }
- }
-}
class munin::plugins::dom0 inherits munin::plugins::physical {
- munin::plugin::deploy { "xen": }
- munin::plugin::deploy { "xen-cpu": }
- munin::plugin::deploy { "xen_memory": }
- munin::plugin::deploy { "xen_vbd": }
+ munin::plugin::deploy { "xen": config => "user root"}
+ munin::plugin::deploy { "xen-cpu": config => "user root"}
+ munin::plugin::deploy { "xen_memory": config => "user root"}
+ munin::plugin::deploy { "xen_vbd": config => "user root"}
}
class munin::plugins::physical inherits munin::plugins::base {