summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client/openbsd.pp2
-rw-r--r--manifests/host.pp34
-rw-r--r--manifests/host/cgi.pp15
-rw-r--r--manifests/plugin.pp1
-rw-r--r--manifests/plugins/apache.pp8
-rw-r--r--manifests/plugins/base.pp42
-rw-r--r--manifests/plugins/debian.pp3
-rw-r--r--manifests/plugins/djbdns.pp2
-rw-r--r--manifests/plugins/dom0.pp15
-rw-r--r--manifests/plugins/gentoo.pp8
-rw-r--r--manifests/plugins/interfaces.pp16
-rw-r--r--manifests/plugins/linux.pp6
-rw-r--r--manifests/plugins/muninhost.pp5
-rw-r--r--manifests/plugins/openbsd.pp9
-rw-r--r--manifests/plugins/physical.pp4
-rw-r--r--manifests/plugins/selinux.pp7
-rw-r--r--manifests/plugins/setup.pp27
-rw-r--r--manifests/plugins/vserver.pp11
-rw-r--r--manifests/register/snmp.pp2
-rw-r--r--manifests/snmp_collector.pp2
20 files changed, 95 insertions, 124 deletions
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 1f6248d..89b5752 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -5,7 +5,7 @@ class munin::client::openbsd inherits munin::client::base {
if $operatingsystemrelease == '4.3' {
file{'/usr/src/munin_openbsd.tar.gz':
- source => "puppet://$server/modules/munin/openbsd/package/munin_openbsd.tar.gz",
+ source => "puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz",
owner => root, group => 0, mode => 0600;
}
exec{'extract_openbsd':
diff --git a/manifests/host.pp b/manifests/host.pp
index b9e59e4..cf445ce 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -7,22 +7,18 @@ class munin::host inherits munin
if $munin_ensure_version == '' { $munin_ensure_version = 'installed' }
- File <<| tag == 'munin' |>>
-
package {"munin": ensure => $munin_ensure_version, }
-
+
File <<| tag == 'munin' |>>
file{'/etc/munin/munin.conf.header':
- source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/munin.conf.header",
- "puppet://$server/modules/site-munin/config/host/munin.conf.header.$operatingsystem",
- "puppet://$server/modules/site-munin/config/host/munin.conf.header",
- "puppet://$server/modules/munin/config/host/munin.conf.header.$operatingsystem",
- "puppet://$server/modules/munin/config/host/munin.conf.header" ],
+ source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header",
+ "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem",
+ "puppet:///modules/site-munin/config/host/munin.conf.header",
+ "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem",
+ "puppet:///modules/munin/config/host/munin.conf.header" ],
notify => Exec['concat_/etc/munin/munin.conf'],
- owner => root, group => 0, mode => 0644;
- }
-
+
concatenated_file { "/etc/munin/munin.conf":
dir => '/var/lib/puppet/modules/munin/nodes',
header => "/etc/munin/munin.conf.header",
@@ -37,15 +33,15 @@ class munin::host inherits munin
include munin::plugins::muninhost
case $operatingsystem {
- centos: {
- include munin::host::cgi
- # from time to time we cleanup hanging munin-runs
- file{'/etc/cron.d/munin_kill':
- content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
- owner => root, group => 0, mode => 0644;
- }
- }
+ centos: { include munin::host::cgi }
}
+
+ # from time to time we cleanup hanging munin-runs
+ file{'/etc/cron.d/munin_kill':
+ content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
+ owner => root, group => 0, mode => 0644;
+ }
+
if $use_shorewall {
include shorewall::rules::out::munin
}
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 0cb3b32..cbf1052 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -16,14 +16,13 @@ class munin::host::cgi inherits munin::host {
}
}
}
-
- file{ '/etc/logrotate.d/munin':
- source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate",
- "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem",
- "puppet://$server/modules/site-munin/config/host/logrotate",
- "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem",
- "puppet://$server/modules/munin/config/host/logrotate" ],
+
+ file{'/etc/logrotate.d/munin':
+ source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate",
+ "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem",
+ "puppet:///modules/site-munin/config/host/logrotate",
+ "puppet:///modules/munin/config/host/logrotate.$operatingsystem",
+ "puppet:///modules/munin/config/host/logrotate" ],
owner => root, group => 0, mode => 0644;
}
-
}
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 08ac916..a0989a8 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -17,6 +17,7 @@ define munin::plugin (
$plugin = "/etc/munin/plugins/$name"
$plugin_conf = "/etc/munin/plugin-conf.d/$name.conf"
+ include munin::plugins::setup
case $ensure {
"absent": {
file { $plugin: ensure => absent, }
diff --git a/manifests/plugins/apache.pp b/manifests/plugins/apache.pp
index 030e7e6..b3e7634 100644
--- a/manifests/plugins/apache.pp
+++ b/manifests/plugins/apache.pp
@@ -1,8 +1,4 @@
-class munin::plugins::apache inherits munin::plugins::base {
-
- munin::plugin{ "apache_accesses": }
- munin::plugin{ "apache_processes": }
- munin::plugin{ "apache_volume": }
+class munin::plugins::apache {
+ munin::plugin{ [ 'apache_accesses', 'apache_processes',' apache_volume' ]: }
munin::plugin::deploy { "apache_activity": }
-
}
diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp
index 64756bc..bfccae5 100644
--- a/manifests/plugins/base.pp
+++ b/manifests/plugins/base.pp
@@ -1,55 +1,25 @@
class munin::plugins::base {
- file {
- [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
- source => "puppet://$server/modules/common/empty",
- ignore => [ '\.ignore', 'snmp_*' ],
- ensure => directory, checksum => mtime,
- recurse => true, purge => true, force => true,
- mode => 0755, owner => root, group => 0,
- notify => Service['munin-node'];
-
- '/etc/munin/plugin-conf.d/munin-node':
- ensure => present,
- mode => 0644, owner => root, group => 0,
- notify => Service['munin-node'],
- }
-
+ # setup basic plugins
munin::plugin {
[ df, cpu, interrupts, load, memory, netstat, open_files,
- processes, swap, uptime, vmstat ]:
- ensure => present,
+ processes, swap, uptime, users, vmstat ]:
+ ensure => present,
}
-
include munin::plugins::interfaces
case $kernel {
- openbsd: {
- File['/etc/munin/plugin-conf.d/munin-node']{
- before => File['/var/run/munin'],
- }
- }
- default: {
- File['/etc/munin/plugin-conf.d/munin-node']{
- before => Package['munin-node'],
- }
- }
- }
-
- case $kernel {
+ openbsd: { include munin::plugins::openbsd }
linux: {
case $vserver {
guest: { include munin::plugins::vserver }
- default: {
- include munin::plugins::linux
- }
+ default: { include munin::plugins::linux }
}
}
}
-
+
case $virtual {
physical: { include munin::plugins::physical }
xen0: { include munin::plugins::dom0 }
}
-
}
diff --git a/manifests/plugins/debian.pp b/manifests/plugins/debian.pp
index 6d2faef..f756150 100644
--- a/manifests/plugins/debian.pp
+++ b/manifests/plugins/debian.pp
@@ -1,2 +1 @@
-class munin::plugins::debian inherits munin::plugins::base {
-}
+class munin::plugins::debian { }
diff --git a/manifests/plugins/djbdns.pp b/manifests/plugins/djbdns.pp
index 37d8ed6..c0a5163 100644
--- a/manifests/plugins/djbdns.pp
+++ b/manifests/plugins/djbdns.pp
@@ -1,3 +1,3 @@
-class munin::plugins::djbdns inherits munin::plugins::base {
+class munin::plugins::djbdns {
munin::plugin::deploy { "tinydns": }
}
diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp
index 3efc6bd..ed4f62c 100644
--- a/manifests/plugins/dom0.pp
+++ b/manifests/plugins/dom0.pp
@@ -1,10 +1,7 @@
-class munin::plugins::dom0 inherits munin::plugins::physical {
-
- 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_mem": config => "user root"}
- munin::plugin::deploy { "xen_vm": config => "user root"}
- munin::plugin::deploy { "xen_vbd": config => "user root"}
- munin::plugin::deploy { "xen_traffic_all": config => "user root"}
+class munin::plugins::dom0 {
+ munin::plugin::deploy {
+ [ 'xen', 'xen-cpu', 'xen_memory', 'xen_mem',
+ 'xen_vm', 'xen_vbd', 'xen_traffic_all' ]:
+ config => 'user root';
+ }
}
diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp
index 6d02a24..25c1626 100644
--- a/manifests/plugins/gentoo.pp
+++ b/manifests/plugins/gentoo.pp
@@ -1,5 +1,5 @@
-class munin::plugins::gentoo inherits munin::plugins::base {
-
- 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::gentoo {
+ munin::plugin::deploy { 'gentoo_lastupdated':
+ config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"
+ }
}
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
index 03ed0e7..18a713b 100644
--- a/manifests/plugins/interfaces.pp
+++ b/manifests/plugins/interfaces.pp
@@ -1,19 +1,19 @@
# handle if_ and if_err_ plugins
-class munin::plugins::interfaces inherits munin::plugins::base {
-
- $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1")
-
- munin::plugin { $ifs: ensure => "if_"; }
-
+class munin::plugins::interfaces {
+
+ $ifs = regsubst(split($interfaces, " |,"), "(.+)", "if_\\1")
+ munin::plugin {
+ $ifs: ensure => "if_";
+ }
case $operatingsystem {
openbsd: {
- $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1")
+ $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1")
munin::plugin{
$if_errs: ensure => "if_errcoll_";
}
}
default: {
- $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1")
+ $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_err_\\1")
munin::plugin{
$if_errs: ensure => "if_err_";
}
diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp
index 5c6afe9..30e0af6 100644
--- a/manifests/plugins/linux.pp
+++ b/manifests/plugins/linux.pp
@@ -1,12 +1,8 @@
-class munin::plugins::linux inherits munin::plugins::base {
-
+class munin::plugins::linux {
munin::plugin {
[ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]:
ensure => present;
acpi:
ensure => $acpi_available;
}
-
- include munin::plugins::interfaces
-
}
diff --git a/manifests/plugins/muninhost.pp b/manifests/plugins/muninhost.pp
index 2af4897..e4fb87d 100644
--- a/manifests/plugins/muninhost.pp
+++ b/manifests/plugins/muninhost.pp
@@ -1,4 +1,3 @@
-class munin::plugins::muninhost inherits munin::plugins::base {
- munin::plugin { munin_update: }
- munin::plugin { munin_graph: }
+class munin::plugins::muninhost {
+ munin::plugin { ['munin_update', 'munin_graph']: }
}
diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp
index feb71fb..b549994 100644
--- a/manifests/plugins/openbsd.pp
+++ b/manifests/plugins/openbsd.pp
@@ -1,9 +1,6 @@
-class munin::plugins::openbsd inherits munin::plugins::base {
-
+class munin::plugins::openbsd {
munin::plugin {
- [ df, cpu, interrupts, load, memory, netstat, open_files,
- processes, swap, users, vmstat, memory_pools, memory_types ]:
- ensure => present,
+ [ memory_pools, memory_types ]:
+ ensure => present,
}
-
}
diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp
index 1bf1465..ac050a5 100644
--- a/manifests/plugins/physical.pp
+++ b/manifests/plugins/physical.pp
@@ -1,7 +1,5 @@
-class munin::plugins::physical inherits munin::plugins::base {
-
+class munin::plugins::physical {
case $kernel {
linux: { munin::plugin { iostat: } }
}
-
}
diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp
index 847f0b9..faf610a 100644
--- a/manifests/plugins/selinux.pp
+++ b/manifests/plugins/selinux.pp
@@ -1,6 +1,3 @@
-class munin::plugins::selinux inherits munin::plugins::base {
-
- munin::plugin::deploy { "selinuxenforced": }
- munin::plugin::deploy { "selinux_avcstats": }
-
+class munin::plugins::selinux {
+ munin::plugin::deploy { [ 'selinuxenforced', 'selinux_avcstats' ]: }
}
diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp
new file mode 100644
index 0000000..c2c5ed3
--- /dev/null
+++ b/manifests/plugins/setup.pp
@@ -0,0 +1,27 @@
+class munin::plugins::setup {
+ file {
+ [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
+ source => "puppet:///modules/common/empty",
+ ignore => [ '.ignore', 'snmp_*' ],
+ ensure => directory, checksum => mtime,
+ recurse => true, purge => true, force => true,
+ mode => 0755, owner => root, group => 0,
+ notify => Service['munin-node'];
+ '/etc/munin/plugin-conf.d/munin-node':
+ ensure => present,
+ mode => 0644, owner => root, group => 0,
+ notify => Service['munin-node'],
+ }
+ case $kernel {
+ openbsd: {
+ File['/etc/munin/plugin-conf.d/munin-node']{
+ before => File['/var/run/munin'],
+ }
+ }
+ default: {
+ File['/etc/munin/plugin-conf.d/munin-node']{
+ before => Package['munin-node'],
+ }
+ }
+ }
+}
diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp
index 42a9bf4..e3eec05 100644
--- a/manifests/plugins/vserver.pp
+++ b/manifests/plugins/vserver.pp
@@ -1,8 +1,7 @@
-class munin::plugins::vserver inherits munin::plugins::base {
-
- munin::plugin {
- [ netstat, processes ]:
- ensure => present;
- }
+class munin::plugins::vserver {
+ munin::plugin {
+ [ netstat, processes ]:
+ ensure => present;
+ }
}
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index c0d9279..0c3ac5c 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -9,7 +9,7 @@ define munin::register::snmp (
$config = [ 'use_node_name no' ]
exec { "munin_register_snmp_${fhost}":
- command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} | sh",
+ command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh",
unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null",
}
diff --git a/manifests/snmp_collector.pp b/manifests/snmp_collector.pp
index 6f3fe34..7bd8bba 100644
--- a/manifests/snmp_collector.pp
+++ b/manifests/snmp_collector.pp
@@ -1,7 +1,7 @@
class munin::snmp_collector{
file {
"/var/lib/puppet/modules/munin/create_snmp_links":
- source => "puppet://$server/modules/munin/create_snmp_links.sh",
+ source => "puppet:///modules/munin/create_snmp_links.sh",
mode => 755, owner => root, group => 0;
}