summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------files/config/host/munin.conf.header.Debian.sid1
-rw-r--r--files/config/host/munin.conf.header.Debian.squeeze75
l---------files/config/host/munin.conf.header.Debian.wheezy1
-rw-r--r--manifests/client.pp2
-rw-r--r--manifests/client/base.pp4
-rw-r--r--manifests/client/darwin.pp2
-rw-r--r--manifests/client/debian.pp4
-rw-r--r--manifests/client/openbsd.pp6
-rw-r--r--manifests/host.pp8
-rw-r--r--manifests/host/cgi.pp6
-rw-r--r--manifests/plugin.pp8
-rw-r--r--manifests/plugin/deploy.pp8
-rw-r--r--manifests/plugin/scriptpaths.pp4
-rw-r--r--manifests/plugins/base.pp2
-rw-r--r--manifests/plugins/interfaces.pp2
-rw-r--r--manifests/plugins/physical.pp2
-rw-r--r--manifests/plugins/setup.pp2
-rw-r--r--manifests/register.pp4
-rw-r--r--manifests/register/snmp.pp2
-rw-r--r--templates/client.erb4
20 files changed, 118 insertions, 29 deletions
diff --git a/files/config/host/munin.conf.header.Debian.sid b/files/config/host/munin.conf.header.Debian.sid
new file mode 120000
index 0000000..5fa2037
--- /dev/null
+++ b/files/config/host/munin.conf.header.Debian.sid
@@ -0,0 +1 @@
+munin.conf.header.Debian.squeeze \ No newline at end of file
diff --git a/files/config/host/munin.conf.header.Debian.squeeze b/files/config/host/munin.conf.header.Debian.squeeze
new file mode 100644
index 0000000..771d50d
--- /dev/null
+++ b/files/config/host/munin.conf.header.Debian.squeeze
@@ -0,0 +1,75 @@
+# Example configuration file for Munin, generated by 'make build'
+
+# The next three variables specifies where the location of the RRD
+# databases, the HTML output, and the logs, severally. They all
+# must be writable by the user running munin-cron.
+dbdir /var/lib/munin
+htmldir /var/cache/munin/www
+logdir /var/log/munin
+rundir /var/run/munin
+
+# Where to look for the HTML templates
+tmpldir /etc/munin/templates
+
+# Make graphs show values per minute instead of per second
+#graph_period minute
+
+# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
+# something changes (OK -> WARNING, CRITICAL -> OK, etc)
+#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
+#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
+#
+# For those with Nagios, the following might come in handy. In addition,
+# the services must be defined in the Nagios server as well.
+#contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg
+
+#contacts me
+#contact.me.command mail -s "Munin notification ${var:group} :: ${var:host} :: ${var:graph_title}" root
+#contact.me.always_send warning critical
+
+# a simple host tree
+#[localhost]
+# address 127.0.0.1
+# use_node_name yes
+
+#
+# A more complex example of a host tree
+#
+## First our "normal" host.
+# [fii.foo.com]
+# address foo
+#
+## Then our other host...
+# [fay.foo.com]
+# address fay
+#
+## Then we want totals...
+# [foo.com;Totals] #Force it into the "foo.com"-domain...
+# update no # Turn off data-fetching for this "host".
+#
+# # The graph "load1". We want to see the loads of both machines...
+# # "fii=fii.foo.com:load.load" means "label=machine:graph.field"
+# load1.graph_title Loads side by side
+# load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load
+#
+# # The graph "load2". Now we want them stacked on top of each other.
+# load2.graph_title Loads on top of each other
+# load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load
+# load2.dummy_field.draw AREA # We want area instead the default LINE2.
+# load2.dummy_field.label dummy # This is needed. Silly, really.
+#
+# # The graph "load3". Now we want them summarised into one field
+# load3.graph_title Loads summarised
+# load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load
+# load3.combined_loads.label Combined loads # Must be set, as this is
+# # not a dummy field!
+#
+## ...and on a side note, I want them listen in another order (default is
+## alphabetically)
+#
+# # Since [foo.com] would be interpreted as a host in the domain "com", we
+# # specify that this is a domain by adding a semicolon.
+# [foo.com;]
+# node_order Totals fii.foo.com fay.foo.com
+#
+
diff --git a/files/config/host/munin.conf.header.Debian.wheezy b/files/config/host/munin.conf.header.Debian.wheezy
new file mode 120000
index 0000000..5fa2037
--- /dev/null
+++ b/files/config/host/munin.conf.header.Debian.wheezy
@@ -0,0 +1 @@
+munin.conf.header.Debian.squeeze \ No newline at end of file
diff --git a/manifests/client.pp b/manifests/client.pp
index 99480f1..0ff5b79 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -5,7 +5,7 @@
class munin::client {
- case $operatingsystem {
+ case $::operatingsystem {
openbsd: { include munin::client::openbsd }
darwin: { include munin::client::darwin }
debian,ubuntu: { include munin::client::debian }
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 6b4bef9..0c7a62a 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -12,11 +12,11 @@ class munin::client::base(
mode => 0755, owner => root, group => 0;
}
file {'/etc/munin/munin-node.conf':
- content => template("munin/munin-node.conf.$operatingsystem"),
+ content => template("munin/munin-node.conf.${::operatingsystem}"),
notify => Service['munin-node'],
mode => 0644, owner => root, group => 0,
}
- munin::register { $fqdn:
+ munin::register { $::fqdn:
config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
}
include munin::plugins::base
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
index 92787ec..264263d 100644
--- a/manifests/client/darwin.pp
+++ b/manifests/client/darwin.pp
@@ -18,5 +18,5 @@ class munin::client::darwin {
exec{"/sbin/SystemStarter start SNMP":
noop => false,
}
- munin::register::snmp { $fqdn: }
+ munin::register::snmp { $::fqdn: }
}
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index 97f5fbf..903fb2d 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -4,10 +4,10 @@ class munin::client::debian inherits munin::client::package {
Service["munin-node"]{
# sarge's munin-node init script has no status
- hasstatus => $lsbdistcodename ? { sarge => false, default => true }
+ hasstatus => $::lsbdistcodename ? { sarge => false, default => true }
}
File["/etc/munin/munin-node.conf"]{
- content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"),
+ content => template("munin/munin-node.conf.${::operatingsystem}.${::lsbdistcodename}"),
}
# workaround bug in munin_node_configure
plugin { "postfix_mailvolume": ensure => absent }
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 7012c00..e1742d2 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,7 +1,7 @@
# currently we install munin on openbsd by targz
# :(
class munin::client::openbsd inherits munin::client::base {
- if $operatingsystemrelease == '4.3' {
+ if $::operatingsystemrelease == '4.3' {
file{'/usr/src/munin_openbsd.tar.gz':
source => "puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz",
owner => root, group => 0, mode => 0600;
@@ -32,7 +32,7 @@ class munin::client::openbsd inherits munin::client::base {
owner => root, group => 0, mode => 0755;
}
openbsd::rc_local{'munin-node':
- binary => $operatingsystemrelease ? {
+ binary => $::operatingsystemrelease ? {
'4.3' => '/opt/munin/sbin/munin-node',
default => '/usr/local/sbin/munin-node'
},
@@ -41,7 +41,7 @@ class munin::client::openbsd inherits munin::client::base {
Service['munin-node']{
restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`',
stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`',
- start => $operatingsystemrelease ? {
+ start => $::operatingsystemrelease ? {
'4.3' => '/opt/munin/sbin/munin-node',
default => '/usr/local/sbin/munin-node'
},
diff --git a/manifests/host.pp b/manifests/host.pp
index 22ffbe2..e81f08f 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -10,10 +10,12 @@ class munin::host {
concat::fragment{'munin.conf.header':
target => '/etc/munin/munin.conf',
- source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header",
- "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem",
+ source => [ "puppet:///modules/site-munin/config/host/${::fqdn}/munin.conf.header",
+ "puppet:///modules/site-munin/config/host/munin.conf.header.${::operatingsystem}.${::lsbdistcodename}",
+ "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.${::operatingsystem}.${::lsbdistcodename}",
+ "puppet:///modules/munin/config/host/munin.conf.header.${::operatingsystem}",
"puppet:///modules/munin/config/host/munin.conf.header" ],
order => 05,
}
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 6fd50df..283a243 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -6,10 +6,10 @@ class munin::host::cgi {
}
file{'/etc/logrotate.d/munin':
- source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate",
- "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem",
+ 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.${::operatingsystem}",
"puppet:///modules/munin/config/host/logrotate" ],
owner => root, group => 0, mode => 0644;
}
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 69b7322..9f799aa 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -21,7 +21,7 @@ define munin::plugin (
file { $plugin: ensure => absent, }
}
default: {
- case $kernel {
+ case $::kernel {
openbsd: { $basic_require = File['/var/run/munin'] }
default: { $basic_require = Package['munin-node'] }
}
@@ -35,7 +35,11 @@ define munin::plugin (
require => $real_require,
notify => Service['munin-node'];
}
-
+ if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+ File[$plugin]{
+ seltype => 'munin_etc_t',
+ }
+ }
}
}
case $config {
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index 67cbfb8..5003153 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -15,7 +15,13 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') {
mode => 0755, owner => root, group => 0;
}
- case $kernel {
+ if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+ File["munin_plugin_${name}"]{
+ seltype => 'munin_exec_t',
+ }
+ }
+
+ case $::kernel {
openbsd: { $basic_require = File['/var/run/munin'] }
default: { $basic_require = Package['munin-node'] }
}
diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp
index 164a17e..f4bd39b 100644
--- a/manifests/plugin/scriptpaths.pp
+++ b/manifests/plugin/scriptpaths.pp
@@ -1,9 +1,9 @@
class munin::plugin::scriptpaths {
- case $operatingsystem {
+ case $::operatingsystem {
gentoo: { $script_path = "/usr/libexec/munin/plugins" }
debian: { $script_path = "/usr/share/munin/plugins" }
centos: { $script_path = "/usr/share/munin/plugins" }
- openbsd: { $script_path = $operatingsystemrelease ? {
+ openbsd: { $script_path = $::operatingsystemrelease ? {
'4.3' => '/opt/munin/lib/plugins/',
default => '/usr/local/libexec/munin/plugins/'
} }
diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp
index 007579c..972a674 100644
--- a/manifests/plugins/base.pp
+++ b/manifests/plugins/base.pp
@@ -7,7 +7,7 @@ class munin::plugins::base {
}
include munin::plugins::interfaces
- case $kernel {
+ case $::kernel {
openbsd: { include munin::plugins::openbsd }
linux: {
case $vserver {
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
index 18a713b..b2c448b 100644
--- a/manifests/plugins/interfaces.pp
+++ b/manifests/plugins/interfaces.pp
@@ -5,7 +5,7 @@ class munin::plugins::interfaces {
munin::plugin {
$ifs: ensure => "if_";
}
- case $operatingsystem {
+ case $::operatingsystem {
openbsd: {
$if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1")
munin::plugin{
diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp
index ac050a5..a1c27a7 100644
--- a/manifests/plugins/physical.pp
+++ b/manifests/plugins/physical.pp
@@ -1,5 +1,5 @@
class munin::plugins::physical {
- case $kernel {
+ case $::kernel {
linux: { munin::plugin { iostat: } }
}
}
diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp
index c88f9e0..caf2e28 100644
--- a/manifests/plugins/setup.pp
+++ b/manifests/plugins/setup.pp
@@ -11,7 +11,7 @@ class munin::plugins::setup {
mode => 0644, owner => root, group => 0,
notify => Service['munin-node'],
}
- case $kernel {
+ case $::kernel {
openbsd: {
File['/etc/munin/plugin-conf.d/munin-node']{
before => File['/var/run/munin'],
diff --git a/manifests/register.pp b/manifests/register.pp
index 3c542ff..254eaaf 100644
--- a/manifests/register.pp
+++ b/manifests/register.pp
@@ -16,8 +16,8 @@ define munin::register (
$hiera_munin_host = hiera('munin_host','')
$munin_host_real = $host ? {
'absent' => $hiera_munin_host ? {
- '' => $fqdn,
- 'fqdn' => $fqdn,
+ '' => $::fqdn,
+ 'fqdn' => $::fqdn,
default => $hiera_munin_host
},
default => $host
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index a4d0d88..acd1e03 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -5,7 +5,7 @@ define munin::register::snmp (
)
{
$fhost = $name
- $munin_host_real = $fqdn
+ $munin_host_real = $::fqdn
$client_type = 'snmp'
$config = [ 'use_node_name no' ]
diff --git a/templates/client.erb b/templates/client.erb
index 3e8ab39..8c93cc5 100644
--- a/templates/client.erb
+++ b/templates/client.erb
@@ -1,7 +1,7 @@
<%
# Downcase all information
- dom = domain.downcase
- host = hostname.downcase
+ dom = scope.lookupvar('::domain').downcase
+ host = scope.lookupvar('::hostname').downcase
%>
### Munin client from Puppet template