summaryrefslogtreecommitdiff
path: root/manifests/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/plugins')
-rw-r--r--manifests/plugins/apache.pp6
-rw-r--r--manifests/plugins/base.pp50
-rw-r--r--manifests/plugins/debian.pp4
-rw-r--r--manifests/plugins/djbdns.pp3
-rw-r--r--manifests/plugins/dom0.pp9
-rw-r--r--manifests/plugins/gentoo.pp3
-rw-r--r--manifests/plugins/interfaces.pp22
-rw-r--r--manifests/plugins/linux.pp10
-rw-r--r--manifests/plugins/muninhost.pp4
-rw-r--r--manifests/plugins/nagios.pp20
-rw-r--r--manifests/plugins/openbsd.pp13
-rw-r--r--manifests/plugins/physical.pp5
-rw-r--r--manifests/plugins/selinux.pp4
-rw-r--r--manifests/plugins/vserver.pp7
14 files changed, 160 insertions, 0 deletions
diff --git a/manifests/plugins/apache.pp b/manifests/plugins/apache.pp
new file mode 100644
index 0000000..ee90de8
--- /dev/null
+++ b/manifests/plugins/apache.pp
@@ -0,0 +1,6 @@
+class munin::plugins::apache inherits munin::plugins::base {
+ munin::plugin{ "apache_accesses": }
+ munin::plugin{ "apache_processes": }
+ munin::plugin{ "apache_volume": }
+ munin::plugin::deploy { "apache_activity": }
+}
diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp
new file mode 100644
index 0000000..4658acc
--- /dev/null
+++ b/manifests/plugins/base.pp
@@ -0,0 +1,50 @@
+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'],
+ }
+
+ munin::plugin {
+ [ df, cpu, interrupts, load, memory, netstat, open_files,
+ 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 {
+ linux: {
+ case $vserver {
+ guest: { include munin::plugins::vserver }
+ 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
new file mode 100644
index 0000000..f239989
--- /dev/null
+++ b/manifests/plugins/debian.pp
@@ -0,0 +1,4 @@
+class munin::plugins::debian inherits munin::plugins::base {
+ munin::plugin { apt_all: ensure => present; }
+}
+
diff --git a/manifests/plugins/djbdns.pp b/manifests/plugins/djbdns.pp
new file mode 100644
index 0000000..37d8ed6
--- /dev/null
+++ b/manifests/plugins/djbdns.pp
@@ -0,0 +1,3 @@
+class munin::plugins::djbdns inherits munin::plugins::base {
+ munin::plugin::deploy { "tinydns": }
+}
diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp
new file mode 100644
index 0000000..8d919c3
--- /dev/null
+++ b/manifests/plugins/dom0.pp
@@ -0,0 +1,9 @@
+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"}
+}
diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp
new file mode 100644
index 0000000..81d0e6b
--- /dev/null
+++ b/manifests/plugins/gentoo.pp
@@ -0,0 +1,3 @@
+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"}
+}
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
new file mode 100644
index 0000000..99b85ba
--- /dev/null
+++ b/manifests/plugins/interfaces.pp
@@ -0,0 +1,22 @@
+# 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_";
+ }
+ case $operatingsystem {
+ openbsd: {
+ $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1")
+ munin::plugin{
+ $if_errs: ensure => "if_errcoll_";
+ }
+ }
+ default: {
+ $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1")
+ munin::plugin{
+ $if_errs: ensure => "if_err_";
+ }
+ }
+ }
+}
diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp
new file mode 100644
index 0000000..c7beb59
--- /dev/null
+++ b/manifests/plugins/linux.pp
@@ -0,0 +1,10 @@
+class munin::plugins::linux inherits munin::plugins::base {
+ 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
new file mode 100644
index 0000000..2af4897
--- /dev/null
+++ b/manifests/plugins/muninhost.pp
@@ -0,0 +1,4 @@
+class munin::plugins::muninhost inherits munin::plugins::base {
+ munin::plugin { munin_update: }
+ munin::plugin { munin_graph: }
+}
diff --git a/manifests/plugins/nagios.pp b/manifests/plugins/nagios.pp
new file mode 100644
index 0000000..c07e99d
--- /dev/null
+++ b/manifests/plugins/nagios.pp
@@ -0,0 +1,20 @@
+class munin::plugins::nagios inherits munin::plugins::base {
+
+ munin::plugin::deploy {
+ nagios_hosts: config => 'user root';
+ nagios_svc: config => 'user root';
+ nagios_perf_hosts: ensure => nagios_perf_, config => 'user root';
+ nagios_perf_svc: ensure => nagios_perf_, config => 'user root';
+ }
+
+ exec { 'munin_nagios2stats_link':
+ command => 'ln -s /usr/sbin/nagios2stats /usr/local/sbin/nagiostats',
+ onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios2stats"],
+ }
+
+ exec { 'munin_nagios3stats_link':
+ command => 'ln -s /usr/sbin/nagios3stats /usr/local/sbin/nagiostats',
+ onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios3stats"],
+ }
+
+}
diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp
new file mode 100644
index 0000000..67cf32d
--- /dev/null
+++ b/manifests/plugins/openbsd.pp
@@ -0,0 +1,13 @@
+class munin::plugins::openbsd inherits munin::plugins::base {
+ munin::plugin {
+ [ df, cpu, interrupts, load, memory, netstat, open_files,
+ processes, swap, users, vmstat
+ ]:
+ ensure => present,
+ }
+ munin::plugin {
+ [ memory_pools, memory_types ]:
+ ensure => present,
+ }
+
+}
diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp
new file mode 100644
index 0000000..6706711
--- /dev/null
+++ b/manifests/plugins/physical.pp
@@ -0,0 +1,5 @@
+class munin::plugins::physical inherits munin::plugins::base {
+ case $kernel {
+ linux: { munin::plugin { iostat: } }
+ }
+}
diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp
new file mode 100644
index 0000000..6affc86
--- /dev/null
+++ b/manifests/plugins/selinux.pp
@@ -0,0 +1,4 @@
+class munin::plugins::selinux inherits munin::plugins::base {
+ munin::plugin::deploy { "selinuxenforced": }
+ munin::plugin::deploy { "selinux_avcstats": }
+}
diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp
new file mode 100644
index 0000000..bce28a1
--- /dev/null
+++ b/manifests/plugins/vserver.pp
@@ -0,0 +1,7 @@
+class munin::plugins::vserver inherits munin::plugins::base {
+ munin::plugin {
+ [ netstat, processes ]:
+ ensure => present;
+ }
+}
+