From 8f958c85e5f2f2cfc5f4b6c4c305bdf377f0cbc6 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 30 Nov 2007 15:28:46 +0000 Subject: munin installation (+ test auf immer1-0) git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@173 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 83 +++++++++++++++++++++ manifests/client.pp | 122 +++++++++++++++++++++++++++++++ manifests/host.pp | 33 +++++++++ manifests/init.pp | 17 +++++ manifests/plugin.pp | 127 +++++++++++++++++++++++++++++++++ plugins/facter/acpi_available.rb | 10 +++ plugins/facter/interfaces.rb | 13 ++++ templates/defaultclient.erb | 14 ++++ templates/munin-node.conf.Debian.etch | 36 ++++++++++ templates/munin-node.conf.Debian.sarge | 1 + templates/munin-node.conf.Debian.sid | 1 + templates/munin-node.conf.Gentoo | 39 ++++++++++ templates/munin-node.conf.Gentoo. | 1 + 13 files changed, 497 insertions(+) create mode 100644 README create mode 100644 manifests/client.pp create mode 100644 manifests/host.pp create mode 100644 manifests/init.pp create mode 100644 manifests/plugin.pp create mode 100644 plugins/facter/acpi_available.rb create mode 100755 plugins/facter/interfaces.rb create mode 100644 templates/defaultclient.erb create mode 100644 templates/munin-node.conf.Debian.etch create mode 120000 templates/munin-node.conf.Debian.sarge create mode 120000 templates/munin-node.conf.Debian.sid create mode 100644 templates/munin-node.conf.Gentoo create mode 120000 templates/munin-node.conf.Gentoo. diff --git a/README b/README new file mode 100644 index 0000000..762a802 --- /dev/null +++ b/README @@ -0,0 +1,83 @@ + +Munin is a performance monitoring system which creates nice RRD graphs and has +a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ + +To use this module, follow these directions: + +1. Install the "common" module -- the munin module depends on functions that are + defined and installed via the common module, see README.common for how to do this + +2. You will need storedconfigs enabled in your puppet setup, to do that you need to + add a line to your puppet.conf in your [puppetmasterd] section which says: + + storeconfigs=true + + You may wish to immediately setup a mysql/pgsql database for your storedconfigs, as + the default method uses sqlite, and is not very efficient, to do that you need lines + such as the following below the storeconfigs=true line (adjust as needed): + + dbadapter=mysql + dbserver=localhost + dbuser=puppet + dbpassword=puppetspasswd + +3. Install the "munin" module: + + a. Your modules directory will need all the files included in this repository placed + under a directory called "munin" + + b. add the following line to your modules.pp: + + import "munin" + + (NOTE: if you have followed the directions in README.common then you will have import + "modules.pp" in your site.pp, if you do not have that, then you will need to add the + import line to your site.pp) + + c. you will also need to create the following empty directories: + + mkdir /etc/puppet/modules/munin/files/empty + mkdir /etc/puppet/modules/munin/files/modules_dir + mkdir -p /etc/puppet/modules/munin/files/nodes/modules_dir + mkdir -p /etc/puppet/modules/munin/files/plugins/modules_dir + + d. Add to the top of your site.pp a variable which indicates what IP should be allowed to + connect to your individual munin-nodes (this is typically your main munin host's IP): + + $munin_allow = '192.168.0.1' + + e. In the node definition in your site.pp for your main munin host, add the following: + + include munin::host + + f. On each node that will gather munin statistics, add this line to that node's entry + in site.pp (you may want to also add this to your main munin host): + + include munin::client + + g. If there are particular munin plugins you want to enable or configure, you define them + in the node definition, like follows: + + # Enable monitoring of disk stats in bytes + munin::plugin { df_abs: } + + # Use a non-standard plugin path to use custom plugins + munin::plugin { "spamassassin": + ensure => "spamassassin", + script_path => "/usr/local/share/munin-plugins", + } + + # Use a special config to pass parameters to the plugin + munin::plugin { + [ "apache_accesses", "apache_processes", "apache_volume" ]: + ensure => present, + config => "env.url http://127.0.0.1:80/server-status?auto" + } + + + h. If you have Linux-Vservers configured, you will likely have multiple munin-node processes + competing for the default port 4949, for those nodes, set an alternate port for munin-node + to run on by putting something similar to the following in the node definition: + + $munin_port = 4948 + diff --git a/manifests/client.pp b/manifests/client.pp new file mode 100644 index 0000000..5b78186 --- /dev/null +++ b/manifests/client.pp @@ -0,0 +1,122 @@ +# client.pp - configure a munin node +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::client { + + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { + include munin::client::debian + include munin::plugins::debian + } + ubuntu: { + info ( "Trying to configure Ubuntu's munin with Debian class" ) + include munin::client::debian + include munin::plugins::debian + } + default: { fail ("Don't know how to handle munin on $operatingsystem") } + } + + case $kernel { + linux: { + case $vserver { + guest: { include munin::plugins::vserver } + default: { + include munin::plugins::linux + case $virtual { + xen0: { include munin::plugins::xen } + } + } + } + } + default: { + err( "Don't know which munin plugins to install for $kernel" ) + } + } + +} + +define munin::register() +{ + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + } + + @@file { "${NODESDIR}/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + } +} + +define munin::register_snmp() +{ + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + } +} + +class munin::client::darwin +{ + file { "/usr/share/snmp/snmpd.conf": + mode => 744, + content => template("munin/darwin_snmpd.conf.erb"), + group => staff, + owner => root, + } + delete_matching_line{"startsnmpdno": + file => "/etc/hostconfig", + pattern => "SNMPSERVER=-NO-", + } + line { "startsnmpdyes": + file => "/etc/hostconfig", + line => "SNMPSERVER=-YES-", + notify => Exec["/sbin/SystemStarter start SNMP"], + } + exec{"/sbin/SystemStarter start SNMP": + noop => false, + } + munin::register_snmp { $fqdn: } +} + +class munin::client::debian +{ + + package { "munin-node": ensure => installed } + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin-node": + ensure => running, + # sarge's munin-node init script has no status + hasstatus => $lsbdistcodename ? { sarge => false, default => true } + } + + munin::register { $fqdn: } + + # workaround bug in munin_node_configure + plugin { "postfix_mailvolume": ensure => absent } +} + diff --git a/manifests/host.pp b/manifests/host.pp new file mode 100644 index 0000000..8a90cc2 --- /dev/null +++ b/manifests/host.pp @@ -0,0 +1,33 @@ +# host.pp - the master host of the munin installation +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::host +{ + package { [ "munin", "nmap"]: ensure => installed, } + + File <<||>> + + concatenated_file { "/etc/munin/munin.conf": + dir => $NODESDIR, + header => "/etc/munin/munin.conf.header", + } + +} + +class munin::snmp_collector +{ + + file { + "/var/lib/puppet/modules/munin/create_snmp_links": + source => "puppet://$servername/munin/create_snmp_links.sh", + mode => 755, owner => root, group => root; + } + + exec { "create_snmp_links": + command => "/var/lib/puppet/modules/munin/create_snmp_links $NODESDIR", + require => File["snmp_links"], + timeout => "2048", + schedule => daily + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..a1ea92c --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,17 @@ +# munin.pp - everything a sitewide munin installation needs +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +# the port is a parameter so vservers can share IP addresses and still be happy + +# Define where the individual nodes' configs are stored +$NODESDIR="/var/lib/puppet/modules/munin/nodes" + +modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } + +import "host.pp" +import "client.pp" +import "plugin.pp" + +include assert_lsbdistcodename + diff --git a/manifests/plugin.pp b/manifests/plugin.pp new file mode 100644 index 0000000..e7e22d1 --- /dev/null +++ b/manifests/plugin.pp @@ -0,0 +1,127 @@ +# plugin.pp - configure a specific munin plugin +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +define munin::plugin ( + $ensure = "present", + $script_path = "/usr/share/munin/plugins", + $config = '') +{ + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + $plugin = "/etc/munin/plugins/$name" + $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" + case $ensure { + "absent": { + debug ( "munin_plugin: suppressing $plugin" ) + file { $plugin: ensure => absent, } + } + default: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } + } + case $config { + '': { + debug("no config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + case $ensure { + absent: { + debug("removing config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + debug("creating $plugin_conf") + file { $plugin_conf: + content => "[${name}]\n$config\n", + mode => 0644, owner => root, group => root, + } + } + } + } + } +} + +define munin::remoteplugin($ensure = "present", $source, $config = '') { + case $ensure { + "absent": { munin::plugin{ $name: ensure => absent } } + default: { + file { + "/var/lib/puppet/modules/munin/plugins/${name}": + source => $source, + mode => 0755, owner => root, group => root; + } + munin::plugin { $name: + ensure => $ensure, + config => $config, + script_path => "/var/lib/puppet/modules/munin/plugins", + } + } + } +} + +class munin::plugins::base { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[munin-node]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[munin-node]; + } + +} + +# handle if_ and if_err_ plugins +class munin::plugins::interfaces inherits munin::plugins::base { + + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + plugin { + $ifs: ensure => "if_"; + $if_errs: ensure => "if_err_"; + } + + +} + +class munin::plugins::linux inherits munin::plugins::base { + + plugin { + [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, + vmstat + ]: + ensure => present; + acpi: + ensure => $acpi_available; + } + + include munin::plugins::interfaces +} + +class munin::plugins::debian inherits munin::plugins::base { + + plugin { apt_all: ensure => present; } + +} + +class munin::plugins::vserver inherits munin::plugins::base { + + plugin { + [ netstat, processes ]: + ensure => present; + } + +} diff --git a/plugins/facter/acpi_available.rb b/plugins/facter/acpi_available.rb new file mode 100644 index 0000000..e3d8dfa --- /dev/null +++ b/plugins/facter/acpi_available.rb @@ -0,0 +1,10 @@ +# return whether acpi is available -- used for deciding whether to install the munin plugin +Facter.add("acpi_available") do + setcode do + if `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? + "absent" + else + "present" + end + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb new file mode 100644 index 0000000..954a0cb --- /dev/null +++ b/templates/defaultclient.erb @@ -0,0 +1,14 @@ +<% + # Downcase all information + dom = domain.downcase + host = hostname.downcase + fhost = name.downcase +%> +### This syntax can be extended, it might get better ... +#+<%= dom %> +#-<%= host %>=<%= fhost %>:load.load +[<%= fhost %>] # linux box + address <%= munin_host_real %> + port <%= munin_port_real %> + use_node_name yes + exim_mailstats.graph_period minute diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch new file mode 100644 index 0000000..0673937 --- /dev/null +++ b/templates/munin-node.conf.Debian.etch @@ -0,0 +1,36 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow <%= munin_allow %> diff --git a/templates/munin-node.conf.Debian.sarge b/templates/munin-node.conf.Debian.sarge new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sarge @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.sid b/templates/munin-node.conf.Debian.sid new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sid @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + diff --git a/templates/munin-node.conf.Gentoo. b/templates/munin-node.conf.Gentoo. new file mode 120000 index 0000000..fd16e50 --- /dev/null +++ b/templates/munin-node.conf.Gentoo. @@ -0,0 +1 @@ +munin-node.conf.Gentoo \ No newline at end of file -- cgit v1.2.3 From f07f6a5fab8964acebb0821094597fa4a597dba2 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 30 Nov 2007 15:28:46 +0000 Subject: munin installation (+ test auf immer1-0) git-svn-id: https://svn/ipuppet/trunk/modules/munin@173 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 83 +++++++++++++++++++++ manifests/client.pp | 122 +++++++++++++++++++++++++++++++ manifests/host.pp | 33 +++++++++ manifests/init.pp | 17 +++++ manifests/plugin.pp | 127 +++++++++++++++++++++++++++++++++ plugins/facter/acpi_available.rb | 10 +++ plugins/facter/interfaces.rb | 13 ++++ templates/defaultclient.erb | 14 ++++ templates/munin-node.conf.Debian.etch | 36 ++++++++++ templates/munin-node.conf.Debian.sarge | 1 + templates/munin-node.conf.Debian.sid | 1 + templates/munin-node.conf.Gentoo | 39 ++++++++++ templates/munin-node.conf.Gentoo. | 1 + 13 files changed, 497 insertions(+) create mode 100644 README create mode 100644 manifests/client.pp create mode 100644 manifests/host.pp create mode 100644 manifests/init.pp create mode 100644 manifests/plugin.pp create mode 100644 plugins/facter/acpi_available.rb create mode 100755 plugins/facter/interfaces.rb create mode 100644 templates/defaultclient.erb create mode 100644 templates/munin-node.conf.Debian.etch create mode 120000 templates/munin-node.conf.Debian.sarge create mode 120000 templates/munin-node.conf.Debian.sid create mode 100644 templates/munin-node.conf.Gentoo create mode 120000 templates/munin-node.conf.Gentoo. diff --git a/README b/README new file mode 100644 index 0000000..762a802 --- /dev/null +++ b/README @@ -0,0 +1,83 @@ + +Munin is a performance monitoring system which creates nice RRD graphs and has +a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ + +To use this module, follow these directions: + +1. Install the "common" module -- the munin module depends on functions that are + defined and installed via the common module, see README.common for how to do this + +2. You will need storedconfigs enabled in your puppet setup, to do that you need to + add a line to your puppet.conf in your [puppetmasterd] section which says: + + storeconfigs=true + + You may wish to immediately setup a mysql/pgsql database for your storedconfigs, as + the default method uses sqlite, and is not very efficient, to do that you need lines + such as the following below the storeconfigs=true line (adjust as needed): + + dbadapter=mysql + dbserver=localhost + dbuser=puppet + dbpassword=puppetspasswd + +3. Install the "munin" module: + + a. Your modules directory will need all the files included in this repository placed + under a directory called "munin" + + b. add the following line to your modules.pp: + + import "munin" + + (NOTE: if you have followed the directions in README.common then you will have import + "modules.pp" in your site.pp, if you do not have that, then you will need to add the + import line to your site.pp) + + c. you will also need to create the following empty directories: + + mkdir /etc/puppet/modules/munin/files/empty + mkdir /etc/puppet/modules/munin/files/modules_dir + mkdir -p /etc/puppet/modules/munin/files/nodes/modules_dir + mkdir -p /etc/puppet/modules/munin/files/plugins/modules_dir + + d. Add to the top of your site.pp a variable which indicates what IP should be allowed to + connect to your individual munin-nodes (this is typically your main munin host's IP): + + $munin_allow = '192.168.0.1' + + e. In the node definition in your site.pp for your main munin host, add the following: + + include munin::host + + f. On each node that will gather munin statistics, add this line to that node's entry + in site.pp (you may want to also add this to your main munin host): + + include munin::client + + g. If there are particular munin plugins you want to enable or configure, you define them + in the node definition, like follows: + + # Enable monitoring of disk stats in bytes + munin::plugin { df_abs: } + + # Use a non-standard plugin path to use custom plugins + munin::plugin { "spamassassin": + ensure => "spamassassin", + script_path => "/usr/local/share/munin-plugins", + } + + # Use a special config to pass parameters to the plugin + munin::plugin { + [ "apache_accesses", "apache_processes", "apache_volume" ]: + ensure => present, + config => "env.url http://127.0.0.1:80/server-status?auto" + } + + + h. If you have Linux-Vservers configured, you will likely have multiple munin-node processes + competing for the default port 4949, for those nodes, set an alternate port for munin-node + to run on by putting something similar to the following in the node definition: + + $munin_port = 4948 + diff --git a/manifests/client.pp b/manifests/client.pp new file mode 100644 index 0000000..5b78186 --- /dev/null +++ b/manifests/client.pp @@ -0,0 +1,122 @@ +# client.pp - configure a munin node +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::client { + + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { + include munin::client::debian + include munin::plugins::debian + } + ubuntu: { + info ( "Trying to configure Ubuntu's munin with Debian class" ) + include munin::client::debian + include munin::plugins::debian + } + default: { fail ("Don't know how to handle munin on $operatingsystem") } + } + + case $kernel { + linux: { + case $vserver { + guest: { include munin::plugins::vserver } + default: { + include munin::plugins::linux + case $virtual { + xen0: { include munin::plugins::xen } + } + } + } + } + default: { + err( "Don't know which munin plugins to install for $kernel" ) + } + } + +} + +define munin::register() +{ + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + } + + @@file { "${NODESDIR}/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + } +} + +define munin::register_snmp() +{ + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + } +} + +class munin::client::darwin +{ + file { "/usr/share/snmp/snmpd.conf": + mode => 744, + content => template("munin/darwin_snmpd.conf.erb"), + group => staff, + owner => root, + } + delete_matching_line{"startsnmpdno": + file => "/etc/hostconfig", + pattern => "SNMPSERVER=-NO-", + } + line { "startsnmpdyes": + file => "/etc/hostconfig", + line => "SNMPSERVER=-YES-", + notify => Exec["/sbin/SystemStarter start SNMP"], + } + exec{"/sbin/SystemStarter start SNMP": + noop => false, + } + munin::register_snmp { $fqdn: } +} + +class munin::client::debian +{ + + package { "munin-node": ensure => installed } + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin-node": + ensure => running, + # sarge's munin-node init script has no status + hasstatus => $lsbdistcodename ? { sarge => false, default => true } + } + + munin::register { $fqdn: } + + # workaround bug in munin_node_configure + plugin { "postfix_mailvolume": ensure => absent } +} + diff --git a/manifests/host.pp b/manifests/host.pp new file mode 100644 index 0000000..8a90cc2 --- /dev/null +++ b/manifests/host.pp @@ -0,0 +1,33 @@ +# host.pp - the master host of the munin installation +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::host +{ + package { [ "munin", "nmap"]: ensure => installed, } + + File <<||>> + + concatenated_file { "/etc/munin/munin.conf": + dir => $NODESDIR, + header => "/etc/munin/munin.conf.header", + } + +} + +class munin::snmp_collector +{ + + file { + "/var/lib/puppet/modules/munin/create_snmp_links": + source => "puppet://$servername/munin/create_snmp_links.sh", + mode => 755, owner => root, group => root; + } + + exec { "create_snmp_links": + command => "/var/lib/puppet/modules/munin/create_snmp_links $NODESDIR", + require => File["snmp_links"], + timeout => "2048", + schedule => daily + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..a1ea92c --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,17 @@ +# munin.pp - everything a sitewide munin installation needs +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +# the port is a parameter so vservers can share IP addresses and still be happy + +# Define where the individual nodes' configs are stored +$NODESDIR="/var/lib/puppet/modules/munin/nodes" + +modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } + +import "host.pp" +import "client.pp" +import "plugin.pp" + +include assert_lsbdistcodename + diff --git a/manifests/plugin.pp b/manifests/plugin.pp new file mode 100644 index 0000000..e7e22d1 --- /dev/null +++ b/manifests/plugin.pp @@ -0,0 +1,127 @@ +# plugin.pp - configure a specific munin plugin +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +define munin::plugin ( + $ensure = "present", + $script_path = "/usr/share/munin/plugins", + $config = '') +{ + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + $plugin = "/etc/munin/plugins/$name" + $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" + case $ensure { + "absent": { + debug ( "munin_plugin: suppressing $plugin" ) + file { $plugin: ensure => absent, } + } + default: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } + } + case $config { + '': { + debug("no config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + case $ensure { + absent: { + debug("removing config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + debug("creating $plugin_conf") + file { $plugin_conf: + content => "[${name}]\n$config\n", + mode => 0644, owner => root, group => root, + } + } + } + } + } +} + +define munin::remoteplugin($ensure = "present", $source, $config = '') { + case $ensure { + "absent": { munin::plugin{ $name: ensure => absent } } + default: { + file { + "/var/lib/puppet/modules/munin/plugins/${name}": + source => $source, + mode => 0755, owner => root, group => root; + } + munin::plugin { $name: + ensure => $ensure, + config => $config, + script_path => "/var/lib/puppet/modules/munin/plugins", + } + } + } +} + +class munin::plugins::base { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[munin-node]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[munin-node]; + } + +} + +# handle if_ and if_err_ plugins +class munin::plugins::interfaces inherits munin::plugins::base { + + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + plugin { + $ifs: ensure => "if_"; + $if_errs: ensure => "if_err_"; + } + + +} + +class munin::plugins::linux inherits munin::plugins::base { + + plugin { + [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, + vmstat + ]: + ensure => present; + acpi: + ensure => $acpi_available; + } + + include munin::plugins::interfaces +} + +class munin::plugins::debian inherits munin::plugins::base { + + plugin { apt_all: ensure => present; } + +} + +class munin::plugins::vserver inherits munin::plugins::base { + + plugin { + [ netstat, processes ]: + ensure => present; + } + +} diff --git a/plugins/facter/acpi_available.rb b/plugins/facter/acpi_available.rb new file mode 100644 index 0000000..e3d8dfa --- /dev/null +++ b/plugins/facter/acpi_available.rb @@ -0,0 +1,10 @@ +# return whether acpi is available -- used for deciding whether to install the munin plugin +Facter.add("acpi_available") do + setcode do + if `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? + "absent" + else + "present" + end + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb new file mode 100644 index 0000000..954a0cb --- /dev/null +++ b/templates/defaultclient.erb @@ -0,0 +1,14 @@ +<% + # Downcase all information + dom = domain.downcase + host = hostname.downcase + fhost = name.downcase +%> +### This syntax can be extended, it might get better ... +#+<%= dom %> +#-<%= host %>=<%= fhost %>:load.load +[<%= fhost %>] # linux box + address <%= munin_host_real %> + port <%= munin_port_real %> + use_node_name yes + exim_mailstats.graph_period minute diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch new file mode 100644 index 0000000..0673937 --- /dev/null +++ b/templates/munin-node.conf.Debian.etch @@ -0,0 +1,36 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow <%= munin_allow %> diff --git a/templates/munin-node.conf.Debian.sarge b/templates/munin-node.conf.Debian.sarge new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sarge @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.sid b/templates/munin-node.conf.Debian.sid new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sid @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + diff --git a/templates/munin-node.conf.Gentoo. b/templates/munin-node.conf.Gentoo. new file mode 120000 index 0000000..fd16e50 --- /dev/null +++ b/templates/munin-node.conf.Gentoo. @@ -0,0 +1 @@ +munin-node.conf.Gentoo \ No newline at end of file -- cgit v1.2.3 From 6f56649e8795ca0fada0ad078dab5093af5e5eed Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 30 Nov 2007 15:28:46 +0000 Subject: munin installation (+ test auf immer1-0) --- README | 83 +++++++++++++++++++++ manifests/client.pp | 122 +++++++++++++++++++++++++++++++ manifests/host.pp | 33 +++++++++ manifests/init.pp | 17 +++++ manifests/plugin.pp | 127 +++++++++++++++++++++++++++++++++ plugins/facter/acpi_available.rb | 10 +++ plugins/facter/interfaces.rb | 13 ++++ templates/defaultclient.erb | 14 ++++ templates/munin-node.conf.Debian.etch | 36 ++++++++++ templates/munin-node.conf.Debian.sarge | 1 + templates/munin-node.conf.Debian.sid | 1 + templates/munin-node.conf.Gentoo | 39 ++++++++++ templates/munin-node.conf.Gentoo. | 1 + 13 files changed, 497 insertions(+) create mode 100644 README create mode 100644 manifests/client.pp create mode 100644 manifests/host.pp create mode 100644 manifests/init.pp create mode 100644 manifests/plugin.pp create mode 100644 plugins/facter/acpi_available.rb create mode 100755 plugins/facter/interfaces.rb create mode 100644 templates/defaultclient.erb create mode 100644 templates/munin-node.conf.Debian.etch create mode 120000 templates/munin-node.conf.Debian.sarge create mode 120000 templates/munin-node.conf.Debian.sid create mode 100644 templates/munin-node.conf.Gentoo create mode 120000 templates/munin-node.conf.Gentoo. diff --git a/README b/README new file mode 100644 index 0000000..762a802 --- /dev/null +++ b/README @@ -0,0 +1,83 @@ + +Munin is a performance monitoring system which creates nice RRD graphs and has +a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ + +To use this module, follow these directions: + +1. Install the "common" module -- the munin module depends on functions that are + defined and installed via the common module, see README.common for how to do this + +2. You will need storedconfigs enabled in your puppet setup, to do that you need to + add a line to your puppet.conf in your [puppetmasterd] section which says: + + storeconfigs=true + + You may wish to immediately setup a mysql/pgsql database for your storedconfigs, as + the default method uses sqlite, and is not very efficient, to do that you need lines + such as the following below the storeconfigs=true line (adjust as needed): + + dbadapter=mysql + dbserver=localhost + dbuser=puppet + dbpassword=puppetspasswd + +3. Install the "munin" module: + + a. Your modules directory will need all the files included in this repository placed + under a directory called "munin" + + b. add the following line to your modules.pp: + + import "munin" + + (NOTE: if you have followed the directions in README.common then you will have import + "modules.pp" in your site.pp, if you do not have that, then you will need to add the + import line to your site.pp) + + c. you will also need to create the following empty directories: + + mkdir /etc/puppet/modules/munin/files/empty + mkdir /etc/puppet/modules/munin/files/modules_dir + mkdir -p /etc/puppet/modules/munin/files/nodes/modules_dir + mkdir -p /etc/puppet/modules/munin/files/plugins/modules_dir + + d. Add to the top of your site.pp a variable which indicates what IP should be allowed to + connect to your individual munin-nodes (this is typically your main munin host's IP): + + $munin_allow = '192.168.0.1' + + e. In the node definition in your site.pp for your main munin host, add the following: + + include munin::host + + f. On each node that will gather munin statistics, add this line to that node's entry + in site.pp (you may want to also add this to your main munin host): + + include munin::client + + g. If there are particular munin plugins you want to enable or configure, you define them + in the node definition, like follows: + + # Enable monitoring of disk stats in bytes + munin::plugin { df_abs: } + + # Use a non-standard plugin path to use custom plugins + munin::plugin { "spamassassin": + ensure => "spamassassin", + script_path => "/usr/local/share/munin-plugins", + } + + # Use a special config to pass parameters to the plugin + munin::plugin { + [ "apache_accesses", "apache_processes", "apache_volume" ]: + ensure => present, + config => "env.url http://127.0.0.1:80/server-status?auto" + } + + + h. If you have Linux-Vservers configured, you will likely have multiple munin-node processes + competing for the default port 4949, for those nodes, set an alternate port for munin-node + to run on by putting something similar to the following in the node definition: + + $munin_port = 4948 + diff --git a/manifests/client.pp b/manifests/client.pp new file mode 100644 index 0000000..5b78186 --- /dev/null +++ b/manifests/client.pp @@ -0,0 +1,122 @@ +# client.pp - configure a munin node +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::client { + + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { + include munin::client::debian + include munin::plugins::debian + } + ubuntu: { + info ( "Trying to configure Ubuntu's munin with Debian class" ) + include munin::client::debian + include munin::plugins::debian + } + default: { fail ("Don't know how to handle munin on $operatingsystem") } + } + + case $kernel { + linux: { + case $vserver { + guest: { include munin::plugins::vserver } + default: { + include munin::plugins::linux + case $virtual { + xen0: { include munin::plugins::xen } + } + } + } + } + default: { + err( "Don't know which munin plugins to install for $kernel" ) + } + } + +} + +define munin::register() +{ + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + } + + @@file { "${NODESDIR}/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + } +} + +define munin::register_snmp() +{ + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + } +} + +class munin::client::darwin +{ + file { "/usr/share/snmp/snmpd.conf": + mode => 744, + content => template("munin/darwin_snmpd.conf.erb"), + group => staff, + owner => root, + } + delete_matching_line{"startsnmpdno": + file => "/etc/hostconfig", + pattern => "SNMPSERVER=-NO-", + } + line { "startsnmpdyes": + file => "/etc/hostconfig", + line => "SNMPSERVER=-YES-", + notify => Exec["/sbin/SystemStarter start SNMP"], + } + exec{"/sbin/SystemStarter start SNMP": + noop => false, + } + munin::register_snmp { $fqdn: } +} + +class munin::client::debian +{ + + package { "munin-node": ensure => installed } + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin-node": + ensure => running, + # sarge's munin-node init script has no status + hasstatus => $lsbdistcodename ? { sarge => false, default => true } + } + + munin::register { $fqdn: } + + # workaround bug in munin_node_configure + plugin { "postfix_mailvolume": ensure => absent } +} + diff --git a/manifests/host.pp b/manifests/host.pp new file mode 100644 index 0000000..8a90cc2 --- /dev/null +++ b/manifests/host.pp @@ -0,0 +1,33 @@ +# host.pp - the master host of the munin installation +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +class munin::host +{ + package { [ "munin", "nmap"]: ensure => installed, } + + File <<||>> + + concatenated_file { "/etc/munin/munin.conf": + dir => $NODESDIR, + header => "/etc/munin/munin.conf.header", + } + +} + +class munin::snmp_collector +{ + + file { + "/var/lib/puppet/modules/munin/create_snmp_links": + source => "puppet://$servername/munin/create_snmp_links.sh", + mode => 755, owner => root, group => root; + } + + exec { "create_snmp_links": + command => "/var/lib/puppet/modules/munin/create_snmp_links $NODESDIR", + require => File["snmp_links"], + timeout => "2048", + schedule => daily + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..a1ea92c --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,17 @@ +# munin.pp - everything a sitewide munin installation needs +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +# the port is a parameter so vservers can share IP addresses and still be happy + +# Define where the individual nodes' configs are stored +$NODESDIR="/var/lib/puppet/modules/munin/nodes" + +modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } + +import "host.pp" +import "client.pp" +import "plugin.pp" + +include assert_lsbdistcodename + diff --git a/manifests/plugin.pp b/manifests/plugin.pp new file mode 100644 index 0000000..e7e22d1 --- /dev/null +++ b/manifests/plugin.pp @@ -0,0 +1,127 @@ +# plugin.pp - configure a specific munin plugin +# Copyright (C) 2007 David Schmitt +# See LICENSE for the full license granted to you. + +define munin::plugin ( + $ensure = "present", + $script_path = "/usr/share/munin/plugins", + $config = '') +{ + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + $plugin = "/etc/munin/plugins/$name" + $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" + case $ensure { + "absent": { + debug ( "munin_plugin: suppressing $plugin" ) + file { $plugin: ensure => absent, } + } + default: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } + } + case $config { + '': { + debug("no config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + case $ensure { + absent: { + debug("removing config for $name") + file { $plugin_conf: ensure => absent } + } + default: { + debug("creating $plugin_conf") + file { $plugin_conf: + content => "[${name}]\n$config\n", + mode => 0644, owner => root, group => root, + } + } + } + } + } +} + +define munin::remoteplugin($ensure = "present", $source, $config = '') { + case $ensure { + "absent": { munin::plugin{ $name: ensure => absent } } + default: { + file { + "/var/lib/puppet/modules/munin/plugins/${name}": + source => $source, + mode => 0755, owner => root, group => root; + } + munin::plugin { $name: + ensure => $ensure, + config => $config, + script_path => "/var/lib/puppet/modules/munin/plugins", + } + } + } +} + +class munin::plugins::base { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[munin-node]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[munin-node]; + } + +} + +# handle if_ and if_err_ plugins +class munin::plugins::interfaces inherits munin::plugins::base { + + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + plugin { + $ifs: ensure => "if_"; + $if_errs: ensure => "if_err_"; + } + + +} + +class munin::plugins::linux inherits munin::plugins::base { + + plugin { + [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, + vmstat + ]: + ensure => present; + acpi: + ensure => $acpi_available; + } + + include munin::plugins::interfaces +} + +class munin::plugins::debian inherits munin::plugins::base { + + plugin { apt_all: ensure => present; } + +} + +class munin::plugins::vserver inherits munin::plugins::base { + + plugin { + [ netstat, processes ]: + ensure => present; + } + +} diff --git a/plugins/facter/acpi_available.rb b/plugins/facter/acpi_available.rb new file mode 100644 index 0000000..e3d8dfa --- /dev/null +++ b/plugins/facter/acpi_available.rb @@ -0,0 +1,10 @@ +# return whether acpi is available -- used for deciding whether to install the munin plugin +Facter.add("acpi_available") do + setcode do + if `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? + "absent" + else + "present" + end + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb new file mode 100644 index 0000000..954a0cb --- /dev/null +++ b/templates/defaultclient.erb @@ -0,0 +1,14 @@ +<% + # Downcase all information + dom = domain.downcase + host = hostname.downcase + fhost = name.downcase +%> +### This syntax can be extended, it might get better ... +#+<%= dom %> +#-<%= host %>=<%= fhost %>:load.load +[<%= fhost %>] # linux box + address <%= munin_host_real %> + port <%= munin_port_real %> + use_node_name yes + exim_mailstats.graph_period minute diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch new file mode 100644 index 0000000..0673937 --- /dev/null +++ b/templates/munin-node.conf.Debian.etch @@ -0,0 +1,36 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow <%= munin_allow %> diff --git a/templates/munin-node.conf.Debian.sarge b/templates/munin-node.conf.Debian.sarge new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sarge @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.sid b/templates/munin-node.conf.Debian.sid new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.sid @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + diff --git a/templates/munin-node.conf.Gentoo. b/templates/munin-node.conf.Gentoo. new file mode 120000 index 0000000..fd16e50 --- /dev/null +++ b/templates/munin-node.conf.Gentoo. @@ -0,0 +1 @@ +munin-node.conf.Gentoo \ No newline at end of file -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 55ba5a72c349ebc7f1d0ab25ee4611124f83dc29 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 09:08:38 +0000 Subject: added gentoo to munin module git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@182 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 37 +++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 7 +++++++ 2 files changed, 44 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 5b78186..f5caaec 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -22,6 +22,11 @@ class munin::client { include munin::client::debian include munin::plugins::debian } + gentoo: { + include munin::client::gentoo + include munin::plugins::gentoo + + } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -120,3 +125,35 @@ class munin::client::debian plugin { "postfix_mailvolume": ensure => absent } } +class munin::client::gentoo +{ + package { 'munin': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.Gentoo."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7e22d1..f07b5fa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -125,3 +125,10 @@ class munin::plugins::vserver inherits munin::plugins::base { } } + +class munin::plugins::gentoo inherits munin::plugins::base { + plugin { + [ netstat, processes ]: + ensure => present; + } +} -- cgit v1.2.3 From be9ce325e83e2521628a70a11b644e373c017839 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 09:08:38 +0000 Subject: added gentoo to munin module git-svn-id: https://svn/ipuppet/trunk/modules/munin@182 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 37 +++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 7 +++++++ 2 files changed, 44 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 5b78186..f5caaec 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -22,6 +22,11 @@ class munin::client { include munin::client::debian include munin::plugins::debian } + gentoo: { + include munin::client::gentoo + include munin::plugins::gentoo + + } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -120,3 +125,35 @@ class munin::client::debian plugin { "postfix_mailvolume": ensure => absent } } +class munin::client::gentoo +{ + package { 'munin': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.Gentoo."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7e22d1..f07b5fa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -125,3 +125,10 @@ class munin::plugins::vserver inherits munin::plugins::base { } } + +class munin::plugins::gentoo inherits munin::plugins::base { + plugin { + [ netstat, processes ]: + ensure => present; + } +} -- cgit v1.2.3 From ce3ceb5f653f6cbd1eca2f7bc08a3103b352214f Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 09:08:38 +0000 Subject: added gentoo to munin module --- manifests/client.pp | 37 +++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 7 +++++++ 2 files changed, 44 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 5b78186..f5caaec 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -22,6 +22,11 @@ class munin::client { include munin::client::debian include munin::plugins::debian } + gentoo: { + include munin::client::gentoo + include munin::plugins::gentoo + + } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -120,3 +125,35 @@ class munin::client::debian plugin { "postfix_mailvolume": ensure => absent } } +class munin::client::gentoo +{ + package { 'munin': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.Gentoo."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + notify => Service["munin-node"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7e22d1..f07b5fa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -125,3 +125,10 @@ class munin::plugins::vserver inherits munin::plugins::base { } } + +class munin::plugins::gentoo inherits munin::plugins::base { + plugin { + [ netstat, processes ]: + ensure => present; + } +} -- cgit v1.2.3 From 29108124bbf95052f0d4570a28d44889ed1b7151 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 10:12:27 +0000 Subject: nochmals das lsb problem ... + import munin (test) git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@184 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f07b5fa..815c3c5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -127,6 +127,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + plugin { [ netstat, processes ]: ensure => present; -- cgit v1.2.3 From 83262e9f34f805fc02b6e242f6a70aa2965f9f09 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 10:12:27 +0000 Subject: nochmals das lsb problem ... + import munin (test) git-svn-id: https://svn/ipuppet/trunk/modules/munin@184 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f07b5fa..815c3c5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -127,6 +127,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + plugin { [ netstat, processes ]: ensure => present; -- cgit v1.2.3 From 92b97318a462e1152340c0dad8fadfc6d97c71ac Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 10:12:27 +0000 Subject: nochmals das lsb problem ... + import munin (test) --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f07b5fa..815c3c5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -127,6 +127,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + plugin { [ netstat, processes ]: ensure => present; -- cgit v1.2.3 From e0df3ba4f8418e1f69ec3c501d80fb51e07e8020 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 13:34:29 +0000 Subject: error 2 mal definiertes processes git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@185 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 815c3c5..c107f41 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,8 +128,4 @@ class munin::plugins::vserver inherits munin::plugins::base { class munin::plugins::gentoo inherits munin::plugins::base { - plugin { - [ netstat, processes ]: - ensure => present; - } } -- cgit v1.2.3 From e3980c637e756fda0b8fd1e3f4522efcb270af85 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 13:34:29 +0000 Subject: error 2 mal definiertes processes git-svn-id: https://svn/ipuppet/trunk/modules/munin@185 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 815c3c5..c107f41 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,8 +128,4 @@ class munin::plugins::vserver inherits munin::plugins::base { class munin::plugins::gentoo inherits munin::plugins::base { - plugin { - [ netstat, processes ]: - ensure => present; - } } -- cgit v1.2.3 From bae3e1e87d1e2e73bfbaf6684ea89efa67c370d3 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 13:34:29 +0000 Subject: error 2 mal definiertes processes --- manifests/plugin.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 815c3c5..c107f41 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,8 +128,4 @@ class munin::plugins::vserver inherits munin::plugins::base { class munin::plugins::gentoo inherits munin::plugins::base { - plugin { - [ netstat, processes ]: - ensure => present; - } } -- cgit v1.2.3 From d5f84a55dbac6499ce057bbb5768733e37e039a9 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 16:51:56 +0000 Subject: munin-node only on debian/etc... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@186 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c107f41..81d8ed4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -16,12 +16,16 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], + case $operatingsystem { + debian: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } } } } -- cgit v1.2.3 From 3f8bc12721953212d2e3b0d9142a3e45d9c80c70 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 16:51:56 +0000 Subject: munin-node only on debian/etc... git-svn-id: https://svn/ipuppet/trunk/modules/munin@186 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c107f41..81d8ed4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -16,12 +16,16 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], + case $operatingsystem { + debian: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } } } } -- cgit v1.2.3 From 5303631ee3cb0c2ee7ddaa6c4471ccdcf886cd7e Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 16:51:56 +0000 Subject: munin-node only on debian/etc... --- manifests/plugin.pp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c107f41..81d8ed4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -16,12 +16,16 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], + case $operatingsystem { + debian: { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package["munin-node"], + notify => Service["munin-node"], + } + } } } } -- cgit v1.2.3 From 39a94258414c2c1870701c557e7c45d4fa4625ab Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:18:35 +0000 Subject: munin-node in gentoo is munin git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@188 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index f5caaec..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From 4d9eb3d04b2ed3efba52d45e2a24cf7ed7965151 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:18:35 +0000 Subject: munin-node in gentoo is munin git-svn-id: https://svn/ipuppet/trunk/modules/munin@188 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index f5caaec..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From 1fced1bd007e0f3b72b46890d9d4b138f75a118d Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 17:18:35 +0000 Subject: munin-node in gentoo is munin --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index f5caaec..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From 6789e46c13548f93897c135f6c0392a32def6a0b Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:24:33 +0000 Subject: =?UTF-8?q?variable=20f=C3=BCr=20munin-node-service=20(einmal=20mu?= =?UTF-8?q?nin-node,=20das=20andere=20mal=20munin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@189 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 54 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81d8ed4..1420260 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,6 +7,15 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins", $config = '') { + case $operatingsystem { + debian: { + $munin-node-service = "munin-node"; + } + gentoo: { + $munin-node-service = "munin"; + } + } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -16,16 +25,12 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - case $operatingsystem { - debian: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], - } - } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin-node-service], + notify => Service[$munin-node-service], } } } @@ -70,21 +75,20 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base { - - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, - notify => Service[munin-node]; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => root, - notify => Service[munin-node]; - } - +class munin::plugins::base-debian { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[$munin-node-service]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[$munin-node-service]; + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 5300e9e26cfa65f0c182719b240a08f79ae76094 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:24:33 +0000 Subject: =?UTF-8?q?variable=20f=C3=BCr=20munin-node-service=20(einmal=20mu?= =?UTF-8?q?nin-node,=20das=20andere=20mal=20munin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@189 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 54 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81d8ed4..1420260 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,6 +7,15 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins", $config = '') { + case $operatingsystem { + debian: { + $munin-node-service = "munin-node"; + } + gentoo: { + $munin-node-service = "munin"; + } + } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -16,16 +25,12 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - case $operatingsystem { - debian: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], - } - } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin-node-service], + notify => Service[$munin-node-service], } } } @@ -70,21 +75,20 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base { - - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, - notify => Service[munin-node]; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => root, - notify => Service[munin-node]; - } - +class munin::plugins::base-debian { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[$munin-node-service]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[$munin-node-service]; + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 2511215df9ef3c68b274a49cb05f1e93772d3861 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 17:24:33 +0000 Subject: =?UTF-8?q?variable=20f=C3=BCr=20munin-node-service=20(einmal=20mu?= =?UTF-8?q?nin-node,=20das=20andere=20mal=20munin)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 54 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81d8ed4..1420260 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,6 +7,15 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins", $config = '') { + case $operatingsystem { + debian: { + $munin-node-service = "munin-node"; + } + gentoo: { + $munin-node-service = "munin"; + } + } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -16,16 +25,12 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - case $operatingsystem { - debian: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], - } - } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin-node-service], + notify => Service[$munin-node-service], } } } @@ -70,21 +75,20 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base { - - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, - notify => Service[munin-node]; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => root, - notify => Service[munin-node]; - } - +class munin::plugins::base-debian { + + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root, + notify => Service[$munin-node-service]; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root, + notify => Service[$munin-node-service]; + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From f5010834bb75b92a7acb17a3ffdf4803d6f3a92f Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:26:28 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@190 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1420260..e7a6b2a 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,10 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin-node-service = "munin-node"; + $munin-node-service = "$operatingsystem/munin-node"; } gentoo: { - $munin-node-service = "munin"; + $munin-node-service = "$operatingsystem/munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From 26e0ec6e73487fa6ab6f0000ee19906ad27caeaf Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:26:28 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@190 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1420260..e7a6b2a 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,10 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin-node-service = "munin-node"; + $munin-node-service = "$operatingsystem/munin-node"; } gentoo: { - $munin-node-service = "munin"; + $munin-node-service = "$operatingsystem/munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From d5b769c448fa2d2c3b107c08898f43ed3f17555f Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 17:26:28 +0000 Subject: test --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1420260..e7a6b2a 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,10 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin-node-service = "munin-node"; + $munin-node-service = "$operatingsystem/munin-node"; } gentoo: { - $munin-node-service = "munin"; + $munin-node-service = "$operatingsystem/munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From ad95734ebc5fb9a8645194f70805a713bc9b2d1f Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:29:17 +0000 Subject: an beide orte ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@191 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7a6b2a..6a84bc6 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,14 +8,10 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { - $munin-node-service = "$operatingsystem/munin-node"; - } - gentoo: { - $munin-node-service = "$operatingsystem/munin"; - } + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } } - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -77,6 +73,10 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { + case $operatingsystem { + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } + } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", -- cgit v1.2.3 From d362c7c3f555d620b35e0021781b6f0e894105fc Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:29:17 +0000 Subject: an beide orte ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@191 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7a6b2a..6a84bc6 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,14 +8,10 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { - $munin-node-service = "$operatingsystem/munin-node"; - } - gentoo: { - $munin-node-service = "$operatingsystem/munin"; - } + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } } - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -77,6 +73,10 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { + case $operatingsystem { + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } + } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", -- cgit v1.2.3 From 23299fbb8ad10633d17aae964709f17cf1b5d758 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 17:29:17 +0000 Subject: an beide orte ... --- manifests/plugin.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e7a6b2a..6a84bc6 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,14 +8,10 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { - $munin-node-service = "$operatingsystem/munin-node"; - } - gentoo: { - $munin-node-service = "$operatingsystem/munin"; - } + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } } - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" @@ -77,6 +73,10 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { + case $operatingsystem { + debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin-node-service = "munin"; } + } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", -- cgit v1.2.3 From 10f4eb53858723669808867de08cefa601cba0a7 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:32:18 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@192 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a84bc6..f72875b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } gentoo: { $munin-node-service = "munin"; } + debian: { $munin-node-service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,11 +83,13 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin-node-service]; + #notify => Service[$munin-node-service]; + notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, - notify => Service[$munin-node-service]; + # notify => Service[$munin-node-service]; + notify => Service[munin]; } } -- cgit v1.2.3 From 34e693dab7cb5193cc9661c05e7e13b92814cedf Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 17:32:18 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@192 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a84bc6..f72875b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } gentoo: { $munin-node-service = "munin"; } + debian: { $munin-node-service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,11 +83,13 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin-node-service]; + #notify => Service[$munin-node-service]; + notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, - notify => Service[$munin-node-service]; + # notify => Service[$munin-node-service]; + notify => Service[munin]; } } -- cgit v1.2.3 From c1c855c88dde8d24a2de36c0cab997cb4a58011b Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 17:32:18 +0000 Subject: test --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a84bc6..f72875b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } gentoo: { $munin-node-service = "munin"; } + debian: { $munin-node-service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,11 +83,13 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin-node-service]; + #notify => Service[$munin-node-service]; + notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, - notify => Service[$munin-node-service]; + # notify => Service[$munin-node-service]; + notify => Service[munin]; } } -- cgit v1.2.3 From 2a76b879fb1f4d29308077dce7c5b76eec495224 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 18:49:37 +0000 Subject: strange... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@193 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..47df43d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], - notify => Service["munin"], + #before => Package["munin"], + #notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f72875b..5b1bfc3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,7 +26,7 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin-node-service], - notify => Service[$munin-node-service], + #notify => Service[$munin-node-service], } } } @@ -82,14 +82,14 @@ class munin::plugins::base-debian { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => root; #notify => Service[$munin-node-service]; - notify => Service[munin]; + #notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => root; # notify => Service[$munin-node-service]; - notify => Service[munin]; + # notify => Service[munin]; } } @@ -102,8 +102,6 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } - - } class munin::plugins::linux inherits munin::plugins::base { -- cgit v1.2.3 From 3e232c2c8387fb5531796994d748fe1e99bac065 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 18:49:37 +0000 Subject: strange... git-svn-id: https://svn/ipuppet/trunk/modules/munin@193 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..47df43d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], - notify => Service["munin"], + #before => Package["munin"], + #notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f72875b..5b1bfc3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,7 +26,7 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin-node-service], - notify => Service[$munin-node-service], + #notify => Service[$munin-node-service], } } } @@ -82,14 +82,14 @@ class munin::plugins::base-debian { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => root; #notify => Service[$munin-node-service]; - notify => Service[munin]; + #notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => root; # notify => Service[$munin-node-service]; - notify => Service[munin]; + # notify => Service[munin]; } } @@ -102,8 +102,6 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } - - } class munin::plugins::linux inherits munin::plugins::base { -- cgit v1.2.3 From 49cfd72187458b35bec123b0e98a203ba01cd647 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 18:49:37 +0000 Subject: strange... --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..47df43d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], - notify => Service["munin"], + #before => Package["munin"], + #notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f72875b..5b1bfc3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,7 +26,7 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin-node-service], - notify => Service[$munin-node-service], + #notify => Service[$munin-node-service], } } } @@ -82,14 +82,14 @@ class munin::plugins::base-debian { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => root; #notify => Service[$munin-node-service]; - notify => Service[munin]; + #notify => Service[munin]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => root; # notify => Service[$munin-node-service]; - notify => Service[munin]; + # notify => Service[munin]; } } @@ -102,8 +102,6 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } - - } class munin::plugins::linux inherits munin::plugins::base { -- cgit v1.2.3 From b2c87f3bc9b3a9da4e69e1003aa7938b8613a904 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 18:55:43 +0000 Subject: war ein anderer fehler ... shit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@194 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 47df43d..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - #before => Package["munin"], - #notify => Service["munin"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5b1bfc3..e361d69 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } - gentoo: { $munin-node-service = "munin"; } + debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin-node_service = "munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -25,8 +25,8 @@ define munin::plugin ( debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin-node-service], - #notify => Service[$munin-node-service], + require => Package[$munin_node_service], + notify => Service[$munin_node_service], } } } @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin-node-service = "munin"; } - debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin_node_service = "munin"; } + debian: { $munin_node_service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,13 +83,11 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root; - #notify => Service[$munin-node-service]; - #notify => Service[munin]; + notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root; - # notify => Service[$munin-node-service]; - # notify => Service[munin]; + notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From dcdadb9a99917ab7214fcb57c64cab2047cd8fe3 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 18:55:43 +0000 Subject: war ein anderer fehler ... shit git-svn-id: https://svn/ipuppet/trunk/modules/munin@194 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 47df43d..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - #before => Package["munin"], - #notify => Service["munin"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5b1bfc3..e361d69 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } - gentoo: { $munin-node-service = "munin"; } + debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin-node_service = "munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -25,8 +25,8 @@ define munin::plugin ( debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin-node-service], - #notify => Service[$munin-node-service], + require => Package[$munin_node_service], + notify => Service[$munin_node_service], } } } @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin-node-service = "munin"; } - debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin_node_service = "munin"; } + debian: { $munin_node_service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,13 +83,11 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root; - #notify => Service[$munin-node-service]; - #notify => Service[munin]; + notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root; - # notify => Service[$munin-node-service]; - # notify => Service[munin]; + notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From e3a2c2d16260bb939d22e5a3ed022c2d8d7c615b Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 18:55:43 +0000 Subject: war ein anderer fehler ... shit --- manifests/client.pp | 4 ++-- manifests/plugin.pp | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 47df43d..639d133 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -145,8 +145,8 @@ class munin::client::gentoo mode => 0644, owner => root, group => root, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - #before => Package["munin"], - #notify => Service["munin"], + before => Package["munin"], + notify => Service["munin"], } service { "munin": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5b1bfc3..e361d69 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin-node-service = "munin-node"; } - gentoo: { $munin-node-service = "munin"; } + debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin-node_service = "munin"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -25,8 +25,8 @@ define munin::plugin ( debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin-node-service], - #notify => Service[$munin-node-service], + require => Package[$munin_node_service], + notify => Service[$munin_node_service], } } } @@ -74,8 +74,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin-node-service = "munin"; } - debian: { $munin-node-service = "munin-node"; } + gentoo: { $munin_node_service = "munin"; } + debian: { $munin_node_service = "munin-node"; } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -83,13 +83,11 @@ class munin::plugins::base-debian { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root; - #notify => Service[$munin-node-service]; - #notify => Service[munin]; + notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root; - # notify => Service[$munin-node-service]; - # notify => Service[munin]; + notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From fc87325c0c1898caf7cc7a6157bb53da1e63b815 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 19:41:28 +0000 Subject: lokale installtion des puppetmasters, korrektur der probleme git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@195 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e361d69..ea31b32 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node"; } - gentoo: { $munin-node_service = "munin"; } + debian: { $munin_node_service = "munin-node" } + gentoo: { $munin_node_service = "munin" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -74,19 +74,19 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin_node_service = "munin"; } - debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin_node_service = "munin" } + debian: { $munin_node_service = "munin-node" } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => root, notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From a39eec70917c79ad36101390cac03c111235a454 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 19:41:28 +0000 Subject: lokale installtion des puppetmasters, korrektur der probleme git-svn-id: https://svn/ipuppet/trunk/modules/munin@195 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e361d69..ea31b32 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node"; } - gentoo: { $munin-node_service = "munin"; } + debian: { $munin_node_service = "munin-node" } + gentoo: { $munin_node_service = "munin" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -74,19 +74,19 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin_node_service = "munin"; } - debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin_node_service = "munin" } + debian: { $munin_node_service = "munin-node" } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => root, notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From 93744a7414ae71b6fd987c19162c183371b85179 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 19:41:28 +0000 Subject: lokale installtion des puppetmasters, korrektur der probleme --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e361d69..ea31b32 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,8 +8,8 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node"; } - gentoo: { $munin-node_service = "munin"; } + debian: { $munin_node_service = "munin-node" } + gentoo: { $munin_node_service = "munin" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -74,19 +74,19 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base-debian { case $operatingsystem { - gentoo: { $munin_node_service = "munin"; } - debian: { $munin_node_service = "munin-node"; } + gentoo: { $munin_node_service = "munin" } + debian: { $munin_node_service = "munin-node" } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => root, notify => Service[$munin_node_service]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From df21a0152a95ef65c8c8b6822323be4b5a641473 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 19:50:40 +0000 Subject: falscher name git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@196 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ea31b32..8aee8ad 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base-debian { +class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_service = "munin" } -- cgit v1.2.3 From fbc577ecabbd034ec615744208eb8a27859503c4 Mon Sep 17 00:00:00 2001 From: am Date: Tue, 4 Dec 2007 19:50:40 +0000 Subject: falscher name git-svn-id: https://svn/ipuppet/trunk/modules/munin@196 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ea31b32..8aee8ad 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base-debian { +class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_service = "munin" } -- cgit v1.2.3 From 0f26f9a8570a510601fac4ba8fd8505a88247ffc Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 4 Dec 2007 19:50:40 +0000 Subject: falscher name --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ea31b32..8aee8ad 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } -class munin::plugins::base-debian { +class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_service = "munin" } -- cgit v1.2.3 From 4f11c470b9aa05d6f46351490a978996acddf539 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 13:51:54 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@197 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8aee8ad..40591b8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin_node_service]; + notify => Service["$munin_node_service-$operatingsystem"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From f69907de9be312048d2dc74e010bda410a5b3d37 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 13:51:54 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@197 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8aee8ad..40591b8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin_node_service]; + notify => Service["$munin_node_service-$operatingsystem"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From 4f49518d3737375fa1015a01049531a6ae6e2be5 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 13:51:54 +0000 Subject: test --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8aee8ad..40591b8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service[$munin_node_service]; + notify => Service["$munin_node_service-$operatingsystem"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From bcf50cd8d12af00474217dbf0b76753691dedf47 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 13:56:23 +0000 Subject: uebersehener error git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@198 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 40591b8..81a17b9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -21,7 +21,7 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", -- cgit v1.2.3 From 6d7f8ca83b1f7ca06f56a012b340a7e42f37c1b1 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 13:56:23 +0000 Subject: uebersehener error git-svn-id: https://svn/ipuppet/trunk/modules/munin@198 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 40591b8..81a17b9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -21,7 +21,7 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", -- cgit v1.2.3 From 156f5f392dd5e917a251cdeaf340649ce5f91827 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 13:56:23 +0000 Subject: uebersehener error --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 40591b8..81a17b9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -21,7 +21,7 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", -- cgit v1.2.3 From 10f3c9bdbdf9b13ce10b1e54681863c25685ab56 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:01:12 +0000 Subject: test erfolgreich ... rueckgaengig machen.. git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@199 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81a17b9..8b03765 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service["$munin_node_service-$operatingsystem"]; + notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From cbd5da982afdd44558f4f8b6fbf3e9ae45c324ae Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:01:12 +0000 Subject: test erfolgreich ... rueckgaengig machen.. git-svn-id: https://svn/ipuppet/trunk/modules/munin@199 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81a17b9..8b03765 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service["$munin_node_service-$operatingsystem"]; + notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From 4b3fc27af6fb2c3f1b1dee33d800bb50fa589b13 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:01:12 +0000 Subject: test erfolgreich ... rueckgaengig machen.. --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81a17b9..8b03765 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -83,7 +83,7 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => root, - notify => Service["$munin_node_service-$operatingsystem"]; + notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => root, -- cgit v1.2.3 From d18d9ad1e56c39fc60f636ce4af4be97f48181e0 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:12:29 +0000 Subject: gentoo has another script path git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@200 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8b03765..f97abf0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,7 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { $munin_node_service = "munin-node" } - gentoo: { $munin_node_service = "munin" } + Gentoo: { + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins", + } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From 1fe2c5e4ec21ae9d49bc24a3583b55cda8f216be Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:12:29 +0000 Subject: gentoo has another script path git-svn-id: https://svn/ipuppet/trunk/modules/munin@200 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8b03765..f97abf0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,7 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { $munin_node_service = "munin-node" } - gentoo: { $munin_node_service = "munin" } + Gentoo: { + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins", + } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From ee8026feb3afbbacee19aaac7e71c388581d7f43 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:12:29 +0000 Subject: gentoo has another script path --- manifests/plugin.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8b03765..f97abf0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,7 +9,10 @@ define munin::plugin ( { case $operatingsystem { debian: { $munin_node_service = "munin-node" } - gentoo: { $munin_node_service = "munin" } + Gentoo: { + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins", + } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From d7a864b11e8c322a97727f2ef558f0b71833412f Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:14:06 +0000 Subject: , fehler git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@201 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f97abf0..2494203 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,10 +8,12 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node" } + debian: { + $munin_node_service = "munin-node"; + } Gentoo: { - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins", + $munin_node_service = "munin", + $script_path = "/usr/libexec/munin/plugins"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From e2b8485b231352cecc15d094a36360cf7b7f9eb4 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:14:06 +0000 Subject: , fehler git-svn-id: https://svn/ipuppet/trunk/modules/munin@201 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f97abf0..2494203 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,10 +8,12 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node" } + debian: { + $munin_node_service = "munin-node"; + } Gentoo: { - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins", + $munin_node_service = "munin", + $script_path = "/usr/libexec/munin/plugins"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From c49d4f3a6a39c42e0031e840de209d0c5d0e3e22 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:14:06 +0000 Subject: , fehler --- manifests/plugin.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f97abf0..2494203 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,10 +8,12 @@ define munin::plugin ( $config = '') { case $operatingsystem { - debian: { $munin_node_service = "munin-node" } + debian: { + $munin_node_service = "munin-node"; + } Gentoo: { - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins", + $munin_node_service = "munin", + $script_path = "/usr/libexec/munin/plugins"; } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From 6550712ff357e6d76232d2724cac531357a8f4de Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:18:15 +0000 Subject: in case gibts keine kommas ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@202 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2494203..09489dd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,11 +9,11 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin_node_service = "munin-node"; + $munin_node_service = "munin-node" } Gentoo: { - $munin_node_service = "munin", - $script_path = "/usr/libexec/munin/plugins"; + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From 8c99a8604ca0e1fe0cbb0d94317064f45d1b41ab Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:18:15 +0000 Subject: in case gibts keine kommas ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@202 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2494203..09489dd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,11 +9,11 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin_node_service = "munin-node"; + $munin_node_service = "munin-node" } Gentoo: { - $munin_node_service = "munin", - $script_path = "/usr/libexec/munin/plugins"; + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From 42c5a781be940a47f60d8a25d0c8f1c2248069cd Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:18:15 +0000 Subject: in case gibts keine kommas ... --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2494203..09489dd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,11 +9,11 @@ define munin::plugin ( { case $operatingsystem { debian: { - $munin_node_service = "munin-node"; + $munin_node_service = "munin-node" } Gentoo: { - $munin_node_service = "munin", - $script_path = "/usr/libexec/munin/plugins"; + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" } } $plugin_src = $ensure ? { "present" => $name, default => $ensure } -- cgit v1.2.3 From 3444412814ca147bc6a51abea947bf2ad36a4a28 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:29:03 +0000 Subject: added script path differently test.. git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@203 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 09489dd..2b14857 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,7 +11,7 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" } - Gentoo: { + gentoo: { $munin_node_service = "munin" $script_path = "/usr/libexec/munin/plugins" } -- cgit v1.2.3 From 98ef8807b7ade3162c4ca2e14450641a29b1b4a1 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:29:03 +0000 Subject: added script path differently test.. git-svn-id: https://svn/ipuppet/trunk/modules/munin@203 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 09489dd..2b14857 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,7 +11,7 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" } - Gentoo: { + gentoo: { $munin_node_service = "munin" $script_path = "/usr/libexec/munin/plugins" } -- cgit v1.2.3 From e6d50c7d3eb1795ae1e285985f0799549095d520 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:29:03 +0000 Subject: added script path differently test.. --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 09489dd..2b14857 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,7 +11,7 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" } - Gentoo: { + gentoo: { $munin_node_service = "munin" $script_path = "/usr/libexec/munin/plugins" } -- cgit v1.2.3 From e8782d1d657dcd2ac5f22b9d996004fecd8529e4 Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:38:01 +0000 Subject: script path correction git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@204 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b14857..b9a1456 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,20 +4,24 @@ define munin::plugin ( $ensure = "present", - $script_path = "/usr/share/munin/plugins", + $script_path, $config = '') { + $script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } gentoo: { $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" + $script_path_default = "/usr/libexec/munin/plugins" } } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -29,7 +33,7 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "$script_path_correct/${plugin_src}", require => Package[$munin_node_service], notify => Service[$munin_node_service], } -- cgit v1.2.3 From 748e8d68a5f1624f9f41bfd870476fcf4e51d6dc Mon Sep 17 00:00:00 2001 From: am Date: Wed, 5 Dec 2007 14:38:01 +0000 Subject: script path correction git-svn-id: https://svn/ipuppet/trunk/modules/munin@204 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b14857..b9a1456 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,20 +4,24 @@ define munin::plugin ( $ensure = "present", - $script_path = "/usr/share/munin/plugins", + $script_path, $config = '') { + $script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } gentoo: { $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" + $script_path_default = "/usr/libexec/munin/plugins" } } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -29,7 +33,7 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "$script_path_correct/${plugin_src}", require => Package[$munin_node_service], notify => Service[$munin_node_service], } -- cgit v1.2.3 From 4d6bc8018c0edb91964ecd6f7fd1bfc713f9a646 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 5 Dec 2007 14:38:01 +0000 Subject: script path correction --- manifests/plugin.pp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b14857..b9a1456 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,20 +4,24 @@ define munin::plugin ( $ensure = "present", - $script_path = "/usr/share/munin/plugins", + $script_path, $config = '') { + $script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } gentoo: { $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" + $script_path_default = "/usr/libexec/munin/plugins" } } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -29,7 +33,7 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "$script_path_correct/${plugin_src}", require => Package[$munin_node_service], notify => Service[$munin_node_service], } -- cgit v1.2.3 From 180297487cd5ac2f6448e87b43e81a4f9420af89 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:03:57 +0000 Subject: * lsb_ ... immer noch unzufrieden * script path test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@206 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b9a1456..7a6e6af 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path, + $script_path = '', $config = '') { $script_path_default = "/usr/share/munin/plugins" -- cgit v1.2.3 From 58c7e6d506030bc3dcdaf4e4aaaf931c7b40a341 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:03:57 +0000 Subject: * lsb_ ... immer noch unzufrieden * script path test git-svn-id: https://svn/ipuppet/trunk/modules/munin@206 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b9a1456..7a6e6af 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path, + $script_path = '', $config = '') { $script_path_default = "/usr/share/munin/plugins" -- cgit v1.2.3 From 85a0fbe78632307e3ca580d4477a02973fc40752 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 6 Dec 2007 09:03:57 +0000 Subject: * lsb_ ... immer noch unzufrieden * script path test --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b9a1456..7a6e6af 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path, + $script_path = '', $config = '') { $script_path_default = "/usr/share/munin/plugins" -- cgit v1.2.3 From e9afde9dbbed737db184d4315d0f29a264c3e1ed Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:14:08 +0000 Subject: cannot reassign ... correction git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@207 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 7a6e6af..f35bf8f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,7 +7,7 @@ define munin::plugin ( $script_path = '', $config = '') { - $script_path_default = "/usr/share/munin/plugins" + #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" @@ -17,6 +17,10 @@ define munin::plugin ( $munin_node_service = "munin" $script_path_default = "/usr/libexec/munin/plugins" } + default: { + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } } $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } -- cgit v1.2.3 From 01caf8e855c93161bef56ab1da3455bf936dc7b1 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:14:08 +0000 Subject: cannot reassign ... correction git-svn-id: https://svn/ipuppet/trunk/modules/munin@207 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 7a6e6af..f35bf8f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,7 +7,7 @@ define munin::plugin ( $script_path = '', $config = '') { - $script_path_default = "/usr/share/munin/plugins" + #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" @@ -17,6 +17,10 @@ define munin::plugin ( $munin_node_service = "munin" $script_path_default = "/usr/libexec/munin/plugins" } + default: { + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } } $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } -- cgit v1.2.3 From 515b8d2ad32199cf622ef761a3c5759b7e064e93 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 6 Dec 2007 09:14:08 +0000 Subject: cannot reassign ... correction --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 7a6e6af..f35bf8f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -7,7 +7,7 @@ define munin::plugin ( $script_path = '', $config = '') { - $script_path_default = "/usr/share/munin/plugins" + #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" @@ -17,6 +17,10 @@ define munin::plugin ( $munin_node_service = "munin" $script_path_default = "/usr/libexec/munin/plugins" } + default: { + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } } $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } -- cgit v1.2.3 From 904c17f3c4339ef8a5ac1d8e1111b3eb36d44a7f Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:53:51 +0000 Subject: strange, warum setzt er die variable nicht ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@208 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f35bf8f..de8f0a3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -22,7 +22,7 @@ define munin::plugin ( $script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) -- cgit v1.2.3 From ab7b943e792cbea075c10c118c81144ebb21b5f4 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 09:53:51 +0000 Subject: strange, warum setzt er die variable nicht ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@208 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f35bf8f..de8f0a3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -22,7 +22,7 @@ define munin::plugin ( $script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) -- cgit v1.2.3 From 7f0ef5985e7803878b2ef37193215d88685cf276 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 6 Dec 2007 09:53:51 +0000 Subject: strange, warum setzt er die variable nicht ... --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f35bf8f..de8f0a3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -22,7 +22,7 @@ define munin::plugin ( $script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) -- cgit v1.2.3 From 7367f55b8d535a38183062a49513e66574c33406 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 10:07:42 +0000 Subject: haette ich schon lange an nen anderen ort tun sollen ... korrektur Service bei gentoo heisst munin-node git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@209 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index de8f0a3..724e9a4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,28 +4,30 @@ define munin::plugin ( $ensure = "present", - $script_path = '', + $script_path = $script_path_default, $config = '') { - #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $munin_node_package = "munin-node" + #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } + #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -37,8 +39,8 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path_correct/${plugin_src}", - require => Package[$munin_node_service], + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], notify => Service[$munin_node_service], } } @@ -87,8 +89,14 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base { case $operatingsystem { - gentoo: { $munin_node_service = "munin" } - debian: { $munin_node_service = "munin-node" } + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin-node" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: -- cgit v1.2.3 From fa3b0c563327deb29405eeacdf6ba7dd14d01869 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 10:07:42 +0000 Subject: haette ich schon lange an nen anderen ort tun sollen ... korrektur Service bei gentoo heisst munin-node git-svn-id: https://svn/ipuppet/trunk/modules/munin@209 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index de8f0a3..724e9a4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,28 +4,30 @@ define munin::plugin ( $ensure = "present", - $script_path = '', + $script_path = $script_path_default, $config = '') { - #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $munin_node_package = "munin-node" + #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } + #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -37,8 +39,8 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path_correct/${plugin_src}", - require => Package[$munin_node_service], + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], notify => Service[$munin_node_service], } } @@ -87,8 +89,14 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base { case $operatingsystem { - gentoo: { $munin_node_service = "munin" } - debian: { $munin_node_service = "munin-node" } + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin-node" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: -- cgit v1.2.3 From 027c0f237fa355500d2430b8bf49561998c0aaa1 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 6 Dec 2007 10:07:42 +0000 Subject: haette ich schon lange an nen anderen ort tun sollen ... korrektur Service bei gentoo heisst munin-node --- manifests/plugin.pp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index de8f0a3..724e9a4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,28 +4,30 @@ define munin::plugin ( $ensure = "present", - $script_path = '', + $script_path = $script_path_default, $config = '') { - #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $munin_node_package = "munin-node" + #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } + #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -37,8 +39,8 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path_correct/${plugin_src}", - require => Package[$munin_node_service], + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], notify => Service[$munin_node_service], } } @@ -87,8 +89,14 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base { case $operatingsystem { - gentoo: { $munin_node_service = "munin" } - debian: { $munin_node_service = "munin-node" } + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin-node" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: -- cgit v1.2.3 From f79f655cc8da250ab5c2df6609319bc9c90ffa30 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 08:47:20 +0000 Subject: * Could not retrieve dependency 'Service[munin-node]' at /var/lib/puppet/modules/munin/manifests/plugin.pp:45 git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@211 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 724e9a4..2ae20d2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -14,12 +14,13 @@ define munin::plugin ( #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin-node" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } @@ -91,7 +92,7 @@ class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-node" + $munin_node_service = "munin" } debian: { $munin_node_service = "munin-node" -- cgit v1.2.3 From bf7c4c00e8ba853c217a4cd6cea39a44d6f231c3 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 08:47:20 +0000 Subject: * Could not retrieve dependency 'Service[munin-node]' at /var/lib/puppet/modules/munin/manifests/plugin.pp:45 git-svn-id: https://svn/ipuppet/trunk/modules/munin@211 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 724e9a4..2ae20d2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -14,12 +14,13 @@ define munin::plugin ( #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin-node" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } @@ -91,7 +92,7 @@ class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-node" + $munin_node_service = "munin" } debian: { $munin_node_service = "munin-node" -- cgit v1.2.3 From c9b142e7c171b6823d017d7c801b11d9076ce4f1 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 08:47:20 +0000 Subject: * Could not retrieve dependency 'Service[munin-node]' at /var/lib/puppet/modules/munin/manifests/plugin.pp:45 --- manifests/plugin.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 724e9a4..2ae20d2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -14,12 +14,13 @@ define munin::plugin ( #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin-node" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" #$script_path_default = "/usr/libexec/munin/plugins" } @@ -91,7 +92,7 @@ class munin::plugins::base { case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-node" + $munin_node_service = "munin" } debian: { $munin_node_service = "munin-node" -- cgit v1.2.3 From 01996fe5d5c46435dbf40cb0177e5bbc3ac40085 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 10:52:18 +0000 Subject: templates neu git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@212 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.CentOS | 1 + templates/munin-node.conf.CentOS. | 1 + templates/munin-node.conf.CentOS.5 | 1 + templates/munin-node.conf.default | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 120000 templates/munin-node.conf.CentOS create mode 120000 templates/munin-node.conf.CentOS. create mode 120000 templates/munin-node.conf.CentOS.5 create mode 100644 templates/munin-node.conf.default diff --git a/templates/munin-node.conf.CentOS b/templates/munin-node.conf.CentOS new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS. b/templates/munin-node.conf.CentOS. new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS. @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS.5 b/templates/munin-node.conf.CentOS.5 new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS.5 @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.default @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + -- cgit v1.2.3 From e6917f083233475fd0a68539df97b7ffd74cc5b6 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 10:52:18 +0000 Subject: templates neu git-svn-id: https://svn/ipuppet/trunk/modules/munin@212 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.CentOS | 1 + templates/munin-node.conf.CentOS. | 1 + templates/munin-node.conf.CentOS.5 | 1 + templates/munin-node.conf.default | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 120000 templates/munin-node.conf.CentOS create mode 120000 templates/munin-node.conf.CentOS. create mode 120000 templates/munin-node.conf.CentOS.5 create mode 100644 templates/munin-node.conf.default diff --git a/templates/munin-node.conf.CentOS b/templates/munin-node.conf.CentOS new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS. b/templates/munin-node.conf.CentOS. new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS. @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS.5 b/templates/munin-node.conf.CentOS.5 new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS.5 @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.default @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + -- cgit v1.2.3 From 255ea623b2444ea46e10d36303a8de47c98a8b55 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 10:52:18 +0000 Subject: templates neu --- templates/munin-node.conf.CentOS | 1 + templates/munin-node.conf.CentOS. | 1 + templates/munin-node.conf.CentOS.5 | 1 + templates/munin-node.conf.default | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 120000 templates/munin-node.conf.CentOS create mode 120000 templates/munin-node.conf.CentOS. create mode 120000 templates/munin-node.conf.CentOS.5 create mode 100644 templates/munin-node.conf.default diff --git a/templates/munin-node.conf.CentOS b/templates/munin-node.conf.CentOS new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS. b/templates/munin-node.conf.CentOS. new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS. @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.CentOS.5 b/templates/munin-node.conf.CentOS.5 new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.CentOS.5 @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default new file mode 100644 index 0000000..f10349e --- /dev/null +++ b/templates/munin-node.conf.default @@ -0,0 +1,39 @@ +########## +########## Managed by puppet +########## + +log_level 4 +log_file /var/log/munin/munin-node.log +pid_file /var/run/munin/munin-node.pid +background 1 +setseid 1 + +# Which host/port to bind to; +host <%= munin_host_real %> +port <%= munin_port_real %> +user root +group root +setsid yes + +# Regexps for files to ignore + +ignore_file ~$ +ignore_file \.bak$ +ignore_file %$ +ignore_file \.dpkg-(tmp|new|old|dist)$ +ignore_file \.rpm(save|new)$ + +# Set this if the client doesn't report the correct hostname when +# telnetting to localhost, port 4949 +# +#host_name localhost.localdomain +host_name <%= fqdn %> + +# A list of addresses that are allowed to connect. This must be a +# regular expression, due to brain damage in Net::Server, which +# doesn't understand CIDR-style network notation. You may repeat +# the allow line as many times as you'd like +allow ^127\.0\.0\.1$ +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> + -- cgit v1.2.3 From 8e3a4aa5c688e493966a65c46db3aaea202f165e Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 11:05:18 +0000 Subject: gentoo ist eigntlich auch default ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@213 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Gentoo | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) mode change 100644 => 120000 templates/munin-node.conf.Gentoo diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo deleted file mode 100644 index f10349e..0000000 --- a/templates/munin-node.conf.Gentoo +++ /dev/null @@ -1,39 +0,0 @@ -########## -########## Managed by puppet -########## - -log_level 4 -log_file /var/log/munin/munin-node.log -pid_file /var/run/munin/munin-node.pid -background 1 -setseid 1 - -# Which host/port to bind to; -host <%= munin_host_real %> -port <%= munin_port_real %> -user root -group root -setsid yes - -# Regexps for files to ignore - -ignore_file ~$ -ignore_file \.bak$ -ignore_file %$ -ignore_file \.dpkg-(tmp|new|old|dist)$ -ignore_file \.rpm(save|new)$ - -# Set this if the client doesn't report the correct hostname when -# telnetting to localhost, port 4949 -# -#host_name localhost.localdomain -host_name <%= fqdn %> - -# A list of addresses that are allowed to connect. This must be a -# regular expression, due to brain damage in Net::Server, which -# doesn't understand CIDR-style network notation. You may repeat -# the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file -- cgit v1.2.3 From a34896a0987b993a5826b87da4151b348f7b2d42 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 11:05:18 +0000 Subject: gentoo ist eigntlich auch default ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@213 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Gentoo | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) mode change 100644 => 120000 templates/munin-node.conf.Gentoo diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo deleted file mode 100644 index f10349e..0000000 --- a/templates/munin-node.conf.Gentoo +++ /dev/null @@ -1,39 +0,0 @@ -########## -########## Managed by puppet -########## - -log_level 4 -log_file /var/log/munin/munin-node.log -pid_file /var/run/munin/munin-node.pid -background 1 -setseid 1 - -# Which host/port to bind to; -host <%= munin_host_real %> -port <%= munin_port_real %> -user root -group root -setsid yes - -# Regexps for files to ignore - -ignore_file ~$ -ignore_file \.bak$ -ignore_file %$ -ignore_file \.dpkg-(tmp|new|old|dist)$ -ignore_file \.rpm(save|new)$ - -# Set this if the client doesn't report the correct hostname when -# telnetting to localhost, port 4949 -# -#host_name localhost.localdomain -host_name <%= fqdn %> - -# A list of addresses that are allowed to connect. This must be a -# regular expression, due to brain damage in Net::Server, which -# doesn't understand CIDR-style network notation. You may repeat -# the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file -- cgit v1.2.3 From 7d2be1e998792cc1267dfc44e6967a9dc526d71c Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 11:05:18 +0000 Subject: gentoo ist eigntlich auch default ... --- templates/munin-node.conf.Gentoo | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) mode change 100644 => 120000 templates/munin-node.conf.Gentoo diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo deleted file mode 100644 index f10349e..0000000 --- a/templates/munin-node.conf.Gentoo +++ /dev/null @@ -1,39 +0,0 @@ -########## -########## Managed by puppet -########## - -log_level 4 -log_file /var/log/munin/munin-node.log -pid_file /var/run/munin/munin-node.pid -background 1 -setseid 1 - -# Which host/port to bind to; -host <%= munin_host_real %> -port <%= munin_port_real %> -user root -group root -setsid yes - -# Regexps for files to ignore - -ignore_file ~$ -ignore_file \.bak$ -ignore_file %$ -ignore_file \.dpkg-(tmp|new|old|dist)$ -ignore_file \.rpm(save|new)$ - -# Set this if the client doesn't report the correct hostname when -# telnetting to localhost, port 4949 -# -#host_name localhost.localdomain -host_name <%= fqdn %> - -# A list of addresses that are allowed to connect. This must be a -# regular expression, due to brain damage in Net::Server, which -# doesn't understand CIDR-style network notation. You may repeat -# the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - diff --git a/templates/munin-node.conf.Gentoo b/templates/munin-node.conf.Gentoo new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.Gentoo @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file -- cgit v1.2.3 From f678dc2ce9f2b20f9f6cc1b40e4c6c98227b299f Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 11:07:31 +0000 Subject: * added centos to the munin module * little corrections in shorewall-local stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@214 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 37 ++++++++++++++++++++++++++++++++++++- manifests/plugin.pp | 24 +++++++++++++++++------- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..18a4043 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -25,7 +25,10 @@ class munin::client { gentoo: { include munin::client::gentoo include munin::plugins::gentoo - + } + centos: { + include munin::client::centos + include munin::plugins::centos } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -157,3 +160,35 @@ class munin::client::gentoo } +class munin::client::centos +{ + package { 'munin-node': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.CentOS."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin"], + notify => Service["munin"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2ae20d2..579e2f9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,21 +11,21 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - #$script_path_default = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } gentoo: { #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } } - #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -37,7 +37,6 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", @@ -98,6 +97,14 @@ class munin::plugins::base { $munin_node_service = "munin-node" $munin_node_package = "munin-node" } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -155,5 +162,8 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { +} +class munin::plugins::centos inherits munin::plugins::base { } + -- cgit v1.2.3 From 01273ad5699ff5791416892fb25f84b1ba227d05 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 11:07:31 +0000 Subject: * added centos to the munin module * little corrections in shorewall-local stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@214 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 37 ++++++++++++++++++++++++++++++++++++- manifests/plugin.pp | 24 +++++++++++++++++------- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..18a4043 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -25,7 +25,10 @@ class munin::client { gentoo: { include munin::client::gentoo include munin::plugins::gentoo - + } + centos: { + include munin::client::centos + include munin::plugins::centos } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -157,3 +160,35 @@ class munin::client::gentoo } +class munin::client::centos +{ + package { 'munin-node': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.CentOS."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin"], + notify => Service["munin"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2ae20d2..579e2f9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,21 +11,21 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - #$script_path_default = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } gentoo: { #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } } - #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -37,7 +37,6 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", @@ -98,6 +97,14 @@ class munin::plugins::base { $munin_node_service = "munin-node" $munin_node_package = "munin-node" } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -155,5 +162,8 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { +} +class munin::plugins::centos inherits munin::plugins::base { } + -- cgit v1.2.3 From 4527d6f81e4da2ec2dcbd00ea04f6a0ba6c680c5 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 11:07:31 +0000 Subject: * added centos to the munin module * little corrections in shorewall-local stuff --- manifests/client.pp | 37 ++++++++++++++++++++++++++++++++++++- manifests/plugin.pp | 24 +++++++++++++++++------- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 639d133..18a4043 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -25,7 +25,10 @@ class munin::client { gentoo: { include munin::client::gentoo include munin::plugins::gentoo - + } + centos: { + include munin::client::centos + include munin::plugins::centos } default: { fail ("Don't know how to handle munin on $operatingsystem") } } @@ -157,3 +160,35 @@ class munin::client::gentoo } +class munin::client::centos +{ + package { 'munin-node': + ensure => present, + category => $operatingsystem ? { + gentoo => 'net-analyzer', + default => '', + }, + } + + + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.CentOS."), + mode => 0644, owner => root, group => root, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin"], + notify => Service["munin"], + } + + service { "munin": + ensure => running, + } + + munin::register { $fqdn: } + +} + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2ae20d2..579e2f9 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -11,21 +11,21 @@ define munin::plugin ( debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - #$script_path_default = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } gentoo: { #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $munin_node_package = "munin" - #$script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" } } - #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -37,7 +37,6 @@ define munin::plugin ( file { $plugin: ensure => absent, } } default: { - #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: ensure => "$script_path/${plugin_src}", @@ -98,6 +97,14 @@ class munin::plugins::base { $munin_node_service = "munin-node" $munin_node_package = "munin-node" } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -155,5 +162,8 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { +} +class munin::plugins::centos inherits munin::plugins::base { } + -- cgit v1.2.3 From dafee0e2988f7975e3a97985ef9c1339d503469f Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:15:55 +0000 Subject: =?UTF-8?q?f=C3=BCr=20centos=20nicht=20...=20f=C3=BCr=20den=20mome?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@215 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 579e2f9..5649b29 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -41,7 +41,14 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package], - notify => Service[$munin_node_service], + case $operatingsystem { + centos: { + # do nothing + } + default: { + notify => Service[$munin_node_service], + } + } } } } -- cgit v1.2.3 From e88e44ca8b8732abdd922562f7ed87aaa5ee860c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:15:55 +0000 Subject: =?UTF-8?q?f=C3=BCr=20centos=20nicht=20...=20f=C3=BCr=20den=20mome?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@215 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 579e2f9..5649b29 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -41,7 +41,14 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package], - notify => Service[$munin_node_service], + case $operatingsystem { + centos: { + # do nothing + } + default: { + notify => Service[$munin_node_service], + } + } } } } -- cgit v1.2.3 From 3d06fbf56e3f1acff944363b2e2b052fe3d4b9e5 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 12:15:55 +0000 Subject: =?UTF-8?q?f=C3=BCr=20centos=20nicht=20...=20f=C3=BCr=20den=20mome?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 579e2f9..5649b29 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -41,7 +41,14 @@ define munin::plugin ( file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package], - notify => Service[$munin_node_service], + case $operatingsystem { + centos: { + # do nothing + } + default: { + notify => Service[$munin_node_service], + } + } } } } -- cgit v1.2.3 From 6ec3603b64bf7f054fc079a4457100174448d5ac Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:19:20 +0000 Subject: case durfte dort nicht stehen git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@216 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5649b29..971f076 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -38,15 +38,18 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - case $operatingsystem { - centos: { - # do nothing + case $operatingsystem { + centos: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package]; } - default: { - notify => Service[$munin_node_service], + } + default: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], + notify => Service[$munin_node_service]; } } } -- cgit v1.2.3 From 6b05503cb59df561423995787a8f31b3ea75b5e8 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:19:20 +0000 Subject: case durfte dort nicht stehen git-svn-id: https://svn/ipuppet/trunk/modules/munin@216 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5649b29..971f076 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -38,15 +38,18 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - case $operatingsystem { - centos: { - # do nothing + case $operatingsystem { + centos: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package]; } - default: { - notify => Service[$munin_node_service], + } + default: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], + notify => Service[$munin_node_service]; } } } -- cgit v1.2.3 From 5f56be8e3cbab53f8ee71bbb7b16d6127006b049 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 12:19:20 +0000 Subject: case durfte dort nicht stehen --- manifests/plugin.pp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5649b29..971f076 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -38,15 +38,18 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - case $operatingsystem { - centos: { - # do nothing + case $operatingsystem { + centos: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package]; } - default: { - notify => Service[$munin_node_service], + } + default: { + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], + notify => Service[$munin_node_service]; } } } -- cgit v1.2.3 From 9c43c63f57d51d274a9771bcc6a4653fd3d26733 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:27:50 +0000 Subject: =?UTF-8?q?scheint=20einigermassen=20ne=20l=C3=B6sung=20zu=20sein?= =?UTF-8?q?=20...=20ausser=20dem=20was=20er=20dann=20nicht=20macht=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@217 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 971f076..1e5a78f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -116,7 +116,21 @@ class munin::plugins::base { $munin_node_package = "munin-node" } } - file { + case $operatingsystem { + centos: { + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root; + } + } + default: { + file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, @@ -127,6 +141,7 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; + } } } -- cgit v1.2.3 From 1b30f55f5ae7ea19d80e59672b95b63ba647de62 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:27:50 +0000 Subject: =?UTF-8?q?scheint=20einigermassen=20ne=20l=C3=B6sung=20zu=20sein?= =?UTF-8?q?=20...=20ausser=20dem=20was=20er=20dann=20nicht=20macht=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@217 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 971f076..1e5a78f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -116,7 +116,21 @@ class munin::plugins::base { $munin_node_package = "munin-node" } } - file { + case $operatingsystem { + centos: { + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root; + } + } + default: { + file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, @@ -127,6 +141,7 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; + } } } -- cgit v1.2.3 From f313146495b104442d1c60333e9f7dfd326d58da Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 12:27:50 +0000 Subject: =?UTF-8?q?scheint=20einigermassen=20ne=20l=C3=B6sung=20zu=20sein?= =?UTF-8?q?=20...=20ausser=20dem=20was=20er=20dann=20nicht=20macht=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 971f076..1e5a78f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -116,7 +116,21 @@ class munin::plugins::base { $munin_node_package = "munin-node" } } - file { + case $operatingsystem { + centos: { + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$servername/munin/empty", + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => root; + "/etc/munin/plugin-conf.d/munin-node": + ensure => present, + mode => 0644, owner => root, group => root; + } + } + default: { + file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, @@ -127,6 +141,7 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root, notify => Service[$munin_node_service]; + } } } -- cgit v1.2.3 From 1e3aa12afd9d7dce4126f11c7e73247287b582f5 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:29:40 +0000 Subject: tippfehler git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@218 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1e5a78f..15049f2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,7 +128,8 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root; } - } + } + default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -143,6 +144,7 @@ class munin::plugins::base { notify => Service[$munin_node_service]; } } + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 907173d99e26513fd280b7e0a137afa825d855d7 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 7 Dec 2007 12:29:40 +0000 Subject: tippfehler git-svn-id: https://svn/ipuppet/trunk/modules/munin@218 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1e5a78f..15049f2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,7 +128,8 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root; } - } + } + default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -143,6 +144,7 @@ class munin::plugins::base { notify => Service[$munin_node_service]; } } + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From cab60409102705d0f013f7a2e28d2ff75b0a29dd Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 7 Dec 2007 12:29:40 +0000 Subject: tippfehler --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1e5a78f..15049f2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -128,7 +128,8 @@ class munin::plugins::base { ensure => present, mode => 0644, owner => root, group => root; } - } + } + default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: @@ -143,6 +144,7 @@ class munin::plugins::base { notify => Service[$munin_node_service]; } } + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From cd802dc08bd3d141d35eee8efe8392ce958b5b18 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Jan 2008 20:16:12 +0000 Subject: fixed group stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@350 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 14 +++++++------- manifests/host.pp | 2 +- manifests/plugin.pp | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 18a4043..2e8f018 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -80,7 +80,7 @@ class munin::client::darwin file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), - group => staff, + group => 0, owner => root, } delete_matching_line{"startsnmpdno": @@ -106,10 +106,10 @@ class munin::client::debian file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], @@ -142,10 +142,10 @@ class munin::client::gentoo file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], @@ -174,10 +174,10 @@ class munin::client::centos file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group =>0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], diff --git a/manifests/host.pp b/manifests/host.pp index 8a90cc2..844698d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -21,7 +21,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": source => "puppet://$servername/munin/create_snmp_links.sh", - mode => 755, owner => root, group => root; + mode => 755, owner => root, group => 0; } exec { "create_snmp_links": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 15049f2..f21098e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ define munin::plugin ( debug("creating $plugin_conf") file { $plugin_conf: content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, } } } @@ -85,7 +85,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { file { "/var/lib/puppet/modules/munin/plugins/${name}": source => $source, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; } munin::plugin { $name: ensure => $ensure, @@ -123,10 +123,10 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => 0; } } @@ -136,11 +136,11 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => 0, notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From aad7d1cb8c499af0ebe5f8a1ab0c55b9017b7ea2 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Jan 2008 20:16:12 +0000 Subject: fixed group stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@350 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 14 +++++++------- manifests/host.pp | 2 +- manifests/plugin.pp | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 18a4043..2e8f018 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -80,7 +80,7 @@ class munin::client::darwin file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), - group => staff, + group => 0, owner => root, } delete_matching_line{"startsnmpdno": @@ -106,10 +106,10 @@ class munin::client::debian file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], @@ -142,10 +142,10 @@ class munin::client::gentoo file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], @@ -174,10 +174,10 @@ class munin::client::centos file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group =>0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], diff --git a/manifests/host.pp b/manifests/host.pp index 8a90cc2..844698d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -21,7 +21,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": source => "puppet://$servername/munin/create_snmp_links.sh", - mode => 755, owner => root, group => root; + mode => 755, owner => root, group => 0; } exec { "create_snmp_links": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 15049f2..f21098e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ define munin::plugin ( debug("creating $plugin_conf") file { $plugin_conf: content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, } } } @@ -85,7 +85,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { file { "/var/lib/puppet/modules/munin/plugins/${name}": source => $source, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; } munin::plugin { $name: ensure => $ensure, @@ -123,10 +123,10 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => 0; } } @@ -136,11 +136,11 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => 0, notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From 67c51ff64235a6e4df9acdd9d7aa7c28fa547354 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Jan 2008 20:16:12 +0000 Subject: fixed group stuff --- manifests/client.pp | 14 +++++++------- manifests/host.pp | 2 +- manifests/plugin.pp | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 18a4043..2e8f018 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -80,7 +80,7 @@ class munin::client::darwin file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), - group => staff, + group => 0, owner => root, } delete_matching_line{"startsnmpdno": @@ -106,10 +106,10 @@ class munin::client::debian file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], @@ -142,10 +142,10 @@ class munin::client::gentoo file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], @@ -174,10 +174,10 @@ class munin::client::centos file { "/etc/munin/": ensure => directory, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group =>0; "/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], diff --git a/manifests/host.pp b/manifests/host.pp index 8a90cc2..844698d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -21,7 +21,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": source => "puppet://$servername/munin/create_snmp_links.sh", - mode => 755, owner => root, group => root; + mode => 755, owner => root, group => 0; } exec { "create_snmp_links": diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 15049f2..f21098e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ define munin::plugin ( debug("creating $plugin_conf") file { $plugin_conf: content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, } } } @@ -85,7 +85,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { file { "/var/lib/puppet/modules/munin/plugins/${name}": source => $source, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; } munin::plugin { $name: ensure => $ensure, @@ -123,10 +123,10 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => 0; } } @@ -136,11 +136,11 @@ class munin::plugins::base { source => "puppet://$servername/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, + mode => 0755, owner => root, group => 0, notify => Service["$munin_node_service"]; "/etc/munin/plugin-conf.d/munin-node": ensure => present, - mode => 0644, owner => root, group => root, + mode => 0644, owner => root, group => 0, notify => Service[$munin_node_service]; } } -- cgit v1.2.3 From cca9a4f95b3351ea8ad429f512a8cb0b91a0dc81 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 30 Jan 2008 21:37:34 +0000 Subject: rearranged some stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@607 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/gentoo_lastupdated | 71 ++++++++++++++++++++++ files/plugins/selinux_avcstats | 111 ++++++++++++++++++++++++++++++++++ files/plugins/selinuxenforced | 32 ++++++++++ files/plugins/xen | 52 ++++++++++++++++ files/plugins/xen-cpu | 125 +++++++++++++++++++++++++++++++++++++++ files/plugins/xen_memory | 63 ++++++++++++++++++++ files/plugins/xen_vbd | 109 ++++++++++++++++++++++++++++++++++ manifests/client.pp | 15 +++-- manifests/plugin.pp | 48 +++++++++++++++ 9 files changed, 620 insertions(+), 6 deletions(-) create mode 100755 files/plugins/gentoo_lastupdated create mode 100755 files/plugins/selinux_avcstats create mode 100755 files/plugins/selinuxenforced create mode 100755 files/plugins/xen create mode 100755 files/plugins/xen-cpu create mode 100755 files/plugins/xen_memory create mode 100755 files/plugins/xen_vbd diff --git a/files/plugins/gentoo_lastupdated b/files/plugins/gentoo_lastupdated new file mode 100755 index 0000000..42fd362 --- /dev/null +++ b/files/plugins/gentoo_lastupdated @@ -0,0 +1,71 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# (C) 2007 immerda project +# +# Plugin to monitor the last update of the gentoo +# +# Parameters: +# +# config +# autoconf +# +# $Id: users.in 1212 2006-10-29 20:11:58Z janl $ +# +#%# family=auto +#%# capabilities=autoconf + +# update /etc/munin/plugin-conf.d/munin-node with: +# [gentoo_*] +# user root +# env.logfile /var/log/emerge.log +# env.tail /usr/bin/tail +# env.grep /bin/grep + +my $logfile = $ENV{'logfile'} || '/var/log/emerge.log'; +my $grep = $ENV{'grep'} || `which grep`; +my $date = $ENV{'date'} || `which date`; +my $tail = $ENV{'tail'} || `which tail`; +chomp($grep); +chomp($date); +chomp($tail); + +if ( defined($ARGV[0])) { + if ($ARGV[0] eq 'autoconf') { + print "yes\n"; + exit 0; + } + + if ( $ARGV[0] eq "config" ) { + print "graph_title Gentoo: Last update X days ago\n"; + #print "graph_args --base 1000 -l 0\n"; + print "graph_vlabel days\n"; + print "graph_scale no\n"; + print "graph_category system\n"; + #print "graph_printf %.1lf\n"; + print "lastupdated.label last updated [d ago]\n"; + print "lastupdated.type GAUGE\n"; + #print "tty.draw AREASTACK\n"; + #print "tty.colour 00FF00\n"; + exit 0; + } +} + +$days = 0; +$last = 0; +$now = 0; + +$l=`$grep "emerge" $logfile | $grep world | $grep -v fetchonly | tail -1`; + +($last,$rest) = split /:/,$l; +$now = `$date +%s`; +if($last eq "" or $last == 0 or $now == 0 or $date eq ""){ + $days = ""; +}else{ + $days=($now-$last)/60/60/24; # in tagen +} + +print "lastupdated.value $days\n"; + +# vim:syntax=perl + diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats new file mode 100755 index 0000000..9687be0 --- /dev/null +++ b/files/plugins/selinux_avcstats @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Plugin to monitor SELinux's Access Vector Cache (AVC). +# +# config (required) +# autoconf (optional - used by munin-config) +# +# Lars Strand, 2007 +# +# +# Magic markers (used by munin-config and some installation scripts (i.e. +# optional)): +#%# family=auto +#%# capabilities=autoconf + + +AVCSTATS="/selinux/avc/cache_stats" + +if [ "$1" = "autoconf" ]; then + if [ -r $AVCSTATS ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + +if [ "$1" = "config" ]; then + + echo "graph_title SELinux's Access Vector Cache" + echo 'graph_args -l 0 --base 1000' + echo 'graph_vlabel AVC operations' + echo 'graph_category system' + + echo 'lookups.label lookups' + echo 'lookups.type DERIVE' + echo 'lookups.min 0' + echo 'lookups.max 1000000000' + echo 'lookups.draw AREA' + echo 'lookups.colour ff0000' # Red + echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.' + + echo 'hits.label hits' + echo 'hits.type DERIVE' + echo 'hits.min 0' + echo 'hits.max 1000000000' + echo 'hits.draw STACK' + echo 'hits.colour 0022ff' # Blue + echo 'hits.info Number of access vector hits.' + + echo 'misses.label misses' + echo 'misses.type DERIVE' + echo 'misses.min 0' + echo 'misses.max 1000000000' + echo 'misses.draw STACK' + echo 'misses.colour 990000' # Darker red + echo 'misses.info Number of cache misses.' + + echo 'allocations.label allocations' + echo 'allocations.type DERIVE' + echo 'allocations.min 0' + echo 'allocations.max 100000000' + echo 'allocations.draw STACK' + echo 'allocations.colour ffa500' # Orange + echo 'allocations.info Number of AVC entries allocated.' + + echo 'reclaims.label reclaims' + echo 'reclaims.type DERIVE' + echo 'reclaims.min 0' + echo 'reclaims.max 1000000000' + echo 'reclaims.draw STACK' + echo 'reclaims.colour 00aaaa' # Darker turquoise + echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).' + + echo 'frees.label frees' + echo 'frees.type DERIVE' + echo 'frees.min 0' + echo 'frees.max 1000000000' + echo 'frees.draw STACK' + echo 'frees.colour 00ff7f' # Spring green + echo 'frees.info Number of free AVC entries.' + + exit 0 +fi + +if [ -r $AVCSTATS ]; then + awk ' NR > 1 { + lookups += $1; + hits += $2; + misses += $3; + allocations += $4; + reclaims += $5; + frees += $6; + } END { + print "lookups.value " lookups; + print "hits.value " hits; + print "misses.value " misses; + print "allocations.value " allocations; + print "reclaims.value " reclaims; + print "frees.value " frees; + } ' < $AVCSTATS +else + echo "lookups.value U" + echo "hits.value U" + echo "misses.value U" + echo "allocations.value U" + echo "reclaims.value U" + echo "frees.value U" +fi + diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced new file mode 100755 index 0000000..2f88b9b --- /dev/null +++ b/files/plugins/selinuxenforced @@ -0,0 +1,32 @@ +#!/bin/sh +# -*- sh -*- +# +# Plugin to count the daily amount of Virii (qmailscan) +# +# Contributed by David Obando (david@cryptix.de) - 03.12.2005 +# + +# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: +#LOG0=/var/spool/qmailscan/quarantine.log +#LOG1=/var/spool/qmailscan/quarantine.log.1 + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title enforced amount' + echo 'graph_args --upper-limit 1 -l 0 ' + echo 'graph_vlabel Is the system selinux enforced?' + echo 'graph_scale no\n'; + echo 'graph_category selinux' + echo 'enforced.label IsEnforced' + #echo 'enforced.draw AREA' + echo 'enforced.draw LINE2' + + exit 0 +fi + +echo -n "enforced.value " && cat /selinux/enforce + diff --git a/files/plugins/xen b/files/plugins/xen new file mode 100755 index 0000000..575cd3b --- /dev/null +++ b/files/plugins/xen @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Script to monitor CPU usage of Xen domains +# +# Parameters understood: +# +# conifg (required) +# autoconf (optinal - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Domain Utilerisation' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel mS' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + /usr/sbin/xm list | grep -v "^Name .* Console$" | \ + while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + echo "$name.label $name" + echo "$name.type COUNTER" +# if [ "$name" = "Domain_0" ]; then +# echo "$name.draw AREA" +# else +# echo "$name.draw STACK" +# fi + echo "$name.min 0" + echo "$name.info Wall clock time spend for $name" + done + exit 0 +fi + +/usr/sbin/xm list | grep -v "^Name" | grep -v "^Name .* Console$" | \ +while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + time=`echo $time | sed -e "s/\.//"` + echo "$name.value $time" +done + diff --git a/files/plugins/xen-cpu b/files/plugins/xen-cpu new file mode 100755 index 0000000..0ef301e --- /dev/null +++ b/files/plugins/xen-cpu @@ -0,0 +1,125 @@ +#!/usr/bin/perl -wT +# +# Script to minitor the cpu usage of Xen domains +# +# Author: Adam Crews shroom com> +# +# License: GPL +# Based on the origional xen script from Matthias Pfafferodt, syntron at web.de +# +# Note: Your munin config must run this as root. +# +# Parameters +# config (required) +# autoconf (optional - used by munin-config) +# +#%# family=auto +#%# capabilities=autoconf + +# Define where to find xm tools +my $XM = '/usr/sbin/xm'; +my $XMTOP = '/usr/sbin/xentop'; + +############## +# You should not need to edit anything below here +# + +use strict; + +$ENV{PATH} = '/bin:/usr/bin:/usr/sbin'; + +my $arg; undef($arg); +if (defined($ARGV[0])) { + $arg = 'config' if ($ARGV[0] eq 'config'); + $arg = 'autoconf' if ($ARGV[0] eq 'autoconf'); + + if ( "$arg" eq 'autoconf') { + if ( -e $XM && -e $XMTOP ) { + print "yes\n"; + exit 0; + } else { + print "no ($XM and/or $XMTOP not found\n"; + exit 1; + } + } + + if ( "$arg" eq 'config') { + my %cnf; undef(%cnf); + %cnf = ( + 'graph_title' => 'Xen Domain CPU Usage', + 'graph_args' => '--base 1000 -l 0 --upper-limit 100 --rigid', + 'graph_vlabel' => 'Percent (%)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the % of CPU Usage for each domain', + ); + + my @domains = `$XM list`; + shift(@domains); # we dont need the header line + my $cnt = "0"; + foreach my $domain ( @domains ) { + my ($dom,undef) = split(/\s/, $domain, 2); + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $dom =~ s/[-.]/_/g; + + $cnf{ "$dom" . '.label' } = "$dom"; + $cnf{ "$dom" . '.draw' } = 'STACK'; + $cnf{ "$dom" . '.min' } = '0'; + $cnf{ "$dom" . '.max' } = '100'; + $cnf{ "$dom" . '.info' } = '% CPU used for ' . "$dom"; + + if ( "$cnt" == "0") { $cnf{$dom.'.draw'} = 'AREA'; } + $cnt++; + } + + foreach my $key (sort(keys(%cnf))) { + print "$key $cnf{$key}\n"; + } + exit 0; + } +} + +# Nothing was passed as an argument, so let's just return the proper values + +my @chunks; undef(@chunks); + +{ + # run the xentop command a few times because the first reading is not always accurate + local $/ = undef; + @chunks = split(/^xentop - .*$/m, `$XMTOP -b -i2 -d2`); +} + +# Take only the last run of xentop +my @stats = split (/\n/,pop(@chunks)); + +# remove the first 4 items that are junk that we don't need. +shift(@stats); +shift(@stats); +shift(@stats); +shift(@stats); + +my %vals; undef(%vals); + +foreach my $domain (@stats) { + # trim the leading whitespace + $domain =~ s/^\s+//; + my @v_tmp = split(/\s+/, $domain); + + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $v_tmp[0] =~ s/[-.]/_/g; + + $vals{$v_tmp[0]}{'cpu_percent'} = $v_tmp[3]; + $vals{$v_tmp[0]}{'vcpu'} = $v_tmp[8]; + if ( $vals{$v_tmp[0]}{'vcpu'} =~ m/n\/a/ ) { + my $cpu = `grep -c "processor" < /proc/cpuinfo`; + if ( $cpu =~ m/^(\d+)$/ ) { + $vals{$v_tmp[0]}{'vcpu'} = $1; + } + } +} + +foreach my $key (sort(keys(%vals))) { + print "$key.value " . ($vals{$key}{'cpu_percent'}/$vals{'Domain_0'}{'vcpu'}), "\n"; +} + diff --git a/files/plugins/xen_memory b/files/plugins/xen_memory new file mode 100755 index 0000000..90bc705 --- /dev/null +++ b/files/plugins/xen_memory @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Script to monitor memory status of the xen host +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Memory' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel MB' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + # xm info | while read name bla value; do echo "$name $value"; done + /usr/sbin/xm info | while read name bla value; do + #total_memory 2047 + #free_memory 1476 + name=`echo $name | sed -e"s/-/_/"` + + if [ "$name" = "total_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.min 0" + echo "$name.info total memory" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.draw AREA" +# echo "$name.draw STACK" + echo "$name.min 0" + echo "$name.info free memory" + fi + done + exit 0 +fi + +/usr/sbin/xm info | while read name bla value; do + name=`echo $name | sed -e"s/-/_/"` + if [ "$name" = "total_memory" ]; then + echo "$name.value $value" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.value $value" + fi +done + diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd new file mode 100755 index 0000000..238bf08 --- /dev/null +++ b/files/plugins/xen_vbd @@ -0,0 +1,109 @@ +#!/usr/bin/perl +# +# 2007-06-01 Zoltan HERPAI +# +# Credits goes for: +# Adam Crews for his xen_cpu plugin +# Mario Manno for his xen_traffic_all plugin +# +# Script to monitor the I/O usage of Xen domains +# Version 0.1 +# +#%# family=auto +#%# capabilities=autoconf + +# Location of xm tools +$XM = '/usr/sbin/xm'; +$XMTOP = '/usr/sbin/xentop'; + +# ah, parameters coming in +if ( defined($ARGV[0])) +{ + if ($ARGV[0] eq 'config') { $arg = 'config'; } + if ($ARGV[0] eq 'autoconf') { $arg = 'autoconf'; } + + if ( $arg eq 'autoconf' ) + { + if ( -e $XM && -e $XMTOP ) + { + print "yes\n"; + exit 0; + } + else + { + print "no ($XM and/or $XMTOP not found\n"; + exit 0; + } + } + + if ( $arg eq 'config' ) + { + %cnf = ( + 'graph_title' => 'Xen Domain I/O usage', + 'graph_args' => '--base 1024 -l 0', + 'graph_vlabel' => 'read (-), write (+)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the I/O operations for each domain', + ); + + @domains = `$XM list`; + shift(@domains); # we don't need the header line + + foreach $domain ( @domains ) + { + ($dom, undef) = split(/\s/, $domain); + $dom =~ s/[-.]/_/g; + + $cnf{ $dom.'RD' . '.label' } = 'read'; + $cnf{ $dom.'RD' . '.type' } = 'COUNTER'; + $cnf{ $dom.'RD' . '.graph' } = 'no'; + $cnf{ $dom.'RD' . '.cdef' } = $dom.'RD,8,*'; + + $cnf{ $dom.'WR' . '.label' } = $dom; + $cnf{ $dom.'WR' . '.type' } = 'COUNTER'; + $cnf{ $dom.'WR' . '.negative' } = $dom.'RD'; + $cnf{ $dom.'WR' . '.cdef' } = $dom.'WR,8,*'; + + if ( "$cnt" == "0" ) + { + $cnf { "$dom" . '.draw' } = 'AREA'; + } + $cnt++; + } + + foreach $key ( sort(keys(%cnf)) ) + { + print "$key $cnf{$key}\n"; + } + exit 0; + + } +} + + +# No args, get rolling +# NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID +$tmpfile = "/tmp/munin_xen_vbd_tmp"; + +system("$XMTOP -b -i1 > $tmpfile"); +open(I,"$tmpfile"); +while(){ + chomp; + s/^\s*//g; + @tmp=split(/\s+/, $_); + next if $tmp[0] eq "NAME"; + + $domname = $tmp[0]; + $domname =~ s/[-.]/_/g; + $vbdrd = $tmp[14]; + $vbdwr = $tmp[15]; + + $vals{$domname."RD"}{'value'} = $vbdrd; + $vals{$domname."WR"}{'value'} = $vbdwr; +} + +foreach $key ( sort(keys(%vals)) ) +{ + print "$key.value " . ($vals{$key}{'value'}) . "\n"; +} + diff --git a/manifests/client.pp b/manifests/client.pp index 2e8f018..1aa0e88 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -40,7 +40,7 @@ class munin::client { default: { include munin::plugins::linux case $virtual { - xen0: { include munin::plugins::xen } + xen0: { include munin::plugins::dom0 } } } } @@ -100,6 +100,7 @@ class munin::client::darwin class munin::client::debian { + $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } @@ -130,13 +131,15 @@ class munin::client::debian class munin::client::gentoo { - package { 'munin': + $script_path_default = "/usr/libexec/munin/plugins" + $acpi_available = "absent" + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { @@ -157,18 +160,18 @@ class munin::client::gentoo } munin::register { $fqdn: } - } class munin::client::centos { - package { 'munin-node': + $script_path_default = "/usr/share/munin/plugins" + package { 'munin-node': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f21098e..f5919e1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -145,6 +145,11 @@ class munin::plugins::base { } } } + + case $operatingsystem { + gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } + default: { $script_path_default = "/usr/share/munin/plugins" } + } } # handle if_ and if_err_ plugins @@ -189,8 +194,51 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + file { "$script_path_default/gentoo_lastupdated": + source => "puppet://$servername/munin/plugins/gentoo_lastupdated", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"gentoo_lastupdated": ensure => present;} } class munin::plugins::centos inherits munin::plugins::base { } +class munin::plugins::selinux inherits munin::plugins::base { + file { "$script_path_default/selinuxenforced": + source => "puppet://$servername/munin/plugins/selinuxenforced", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"selinuxenforced": ensure => present;} +} + +class munin::plugins::dom0 inherits munin::plugins::base { + file { + [ "$script_path_default/xen" ]: + source => "puppet://$servername/munin/plugins/xen", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen-cpu" ]: + source => "puppet://$servername/munin/plugins/xen-cpu", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_memory" ]: + source => "puppet://$servername/munin/plugins/xen_memory", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_vbd" ]: + source => "puppet://$servername/munin/plugins/xen_vbd", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin { + [ xen, xen-cpu, xen_memory, xen_vbd ]: + ensure => present; + } +} + -- cgit v1.2.3 From f637dc37d96a1715634734c5ef9d7d5ecd13a447 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 30 Jan 2008 21:37:34 +0000 Subject: rearranged some stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@607 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/gentoo_lastupdated | 71 ++++++++++++++++++++++ files/plugins/selinux_avcstats | 111 ++++++++++++++++++++++++++++++++++ files/plugins/selinuxenforced | 32 ++++++++++ files/plugins/xen | 52 ++++++++++++++++ files/plugins/xen-cpu | 125 +++++++++++++++++++++++++++++++++++++++ files/plugins/xen_memory | 63 ++++++++++++++++++++ files/plugins/xen_vbd | 109 ++++++++++++++++++++++++++++++++++ manifests/client.pp | 15 +++-- manifests/plugin.pp | 48 +++++++++++++++ 9 files changed, 620 insertions(+), 6 deletions(-) create mode 100755 files/plugins/gentoo_lastupdated create mode 100755 files/plugins/selinux_avcstats create mode 100755 files/plugins/selinuxenforced create mode 100755 files/plugins/xen create mode 100755 files/plugins/xen-cpu create mode 100755 files/plugins/xen_memory create mode 100755 files/plugins/xen_vbd diff --git a/files/plugins/gentoo_lastupdated b/files/plugins/gentoo_lastupdated new file mode 100755 index 0000000..42fd362 --- /dev/null +++ b/files/plugins/gentoo_lastupdated @@ -0,0 +1,71 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# (C) 2007 immerda project +# +# Plugin to monitor the last update of the gentoo +# +# Parameters: +# +# config +# autoconf +# +# $Id: users.in 1212 2006-10-29 20:11:58Z janl $ +# +#%# family=auto +#%# capabilities=autoconf + +# update /etc/munin/plugin-conf.d/munin-node with: +# [gentoo_*] +# user root +# env.logfile /var/log/emerge.log +# env.tail /usr/bin/tail +# env.grep /bin/grep + +my $logfile = $ENV{'logfile'} || '/var/log/emerge.log'; +my $grep = $ENV{'grep'} || `which grep`; +my $date = $ENV{'date'} || `which date`; +my $tail = $ENV{'tail'} || `which tail`; +chomp($grep); +chomp($date); +chomp($tail); + +if ( defined($ARGV[0])) { + if ($ARGV[0] eq 'autoconf') { + print "yes\n"; + exit 0; + } + + if ( $ARGV[0] eq "config" ) { + print "graph_title Gentoo: Last update X days ago\n"; + #print "graph_args --base 1000 -l 0\n"; + print "graph_vlabel days\n"; + print "graph_scale no\n"; + print "graph_category system\n"; + #print "graph_printf %.1lf\n"; + print "lastupdated.label last updated [d ago]\n"; + print "lastupdated.type GAUGE\n"; + #print "tty.draw AREASTACK\n"; + #print "tty.colour 00FF00\n"; + exit 0; + } +} + +$days = 0; +$last = 0; +$now = 0; + +$l=`$grep "emerge" $logfile | $grep world | $grep -v fetchonly | tail -1`; + +($last,$rest) = split /:/,$l; +$now = `$date +%s`; +if($last eq "" or $last == 0 or $now == 0 or $date eq ""){ + $days = ""; +}else{ + $days=($now-$last)/60/60/24; # in tagen +} + +print "lastupdated.value $days\n"; + +# vim:syntax=perl + diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats new file mode 100755 index 0000000..9687be0 --- /dev/null +++ b/files/plugins/selinux_avcstats @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Plugin to monitor SELinux's Access Vector Cache (AVC). +# +# config (required) +# autoconf (optional - used by munin-config) +# +# Lars Strand, 2007 +# +# +# Magic markers (used by munin-config and some installation scripts (i.e. +# optional)): +#%# family=auto +#%# capabilities=autoconf + + +AVCSTATS="/selinux/avc/cache_stats" + +if [ "$1" = "autoconf" ]; then + if [ -r $AVCSTATS ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + +if [ "$1" = "config" ]; then + + echo "graph_title SELinux's Access Vector Cache" + echo 'graph_args -l 0 --base 1000' + echo 'graph_vlabel AVC operations' + echo 'graph_category system' + + echo 'lookups.label lookups' + echo 'lookups.type DERIVE' + echo 'lookups.min 0' + echo 'lookups.max 1000000000' + echo 'lookups.draw AREA' + echo 'lookups.colour ff0000' # Red + echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.' + + echo 'hits.label hits' + echo 'hits.type DERIVE' + echo 'hits.min 0' + echo 'hits.max 1000000000' + echo 'hits.draw STACK' + echo 'hits.colour 0022ff' # Blue + echo 'hits.info Number of access vector hits.' + + echo 'misses.label misses' + echo 'misses.type DERIVE' + echo 'misses.min 0' + echo 'misses.max 1000000000' + echo 'misses.draw STACK' + echo 'misses.colour 990000' # Darker red + echo 'misses.info Number of cache misses.' + + echo 'allocations.label allocations' + echo 'allocations.type DERIVE' + echo 'allocations.min 0' + echo 'allocations.max 100000000' + echo 'allocations.draw STACK' + echo 'allocations.colour ffa500' # Orange + echo 'allocations.info Number of AVC entries allocated.' + + echo 'reclaims.label reclaims' + echo 'reclaims.type DERIVE' + echo 'reclaims.min 0' + echo 'reclaims.max 1000000000' + echo 'reclaims.draw STACK' + echo 'reclaims.colour 00aaaa' # Darker turquoise + echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).' + + echo 'frees.label frees' + echo 'frees.type DERIVE' + echo 'frees.min 0' + echo 'frees.max 1000000000' + echo 'frees.draw STACK' + echo 'frees.colour 00ff7f' # Spring green + echo 'frees.info Number of free AVC entries.' + + exit 0 +fi + +if [ -r $AVCSTATS ]; then + awk ' NR > 1 { + lookups += $1; + hits += $2; + misses += $3; + allocations += $4; + reclaims += $5; + frees += $6; + } END { + print "lookups.value " lookups; + print "hits.value " hits; + print "misses.value " misses; + print "allocations.value " allocations; + print "reclaims.value " reclaims; + print "frees.value " frees; + } ' < $AVCSTATS +else + echo "lookups.value U" + echo "hits.value U" + echo "misses.value U" + echo "allocations.value U" + echo "reclaims.value U" + echo "frees.value U" +fi + diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced new file mode 100755 index 0000000..2f88b9b --- /dev/null +++ b/files/plugins/selinuxenforced @@ -0,0 +1,32 @@ +#!/bin/sh +# -*- sh -*- +# +# Plugin to count the daily amount of Virii (qmailscan) +# +# Contributed by David Obando (david@cryptix.de) - 03.12.2005 +# + +# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: +#LOG0=/var/spool/qmailscan/quarantine.log +#LOG1=/var/spool/qmailscan/quarantine.log.1 + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title enforced amount' + echo 'graph_args --upper-limit 1 -l 0 ' + echo 'graph_vlabel Is the system selinux enforced?' + echo 'graph_scale no\n'; + echo 'graph_category selinux' + echo 'enforced.label IsEnforced' + #echo 'enforced.draw AREA' + echo 'enforced.draw LINE2' + + exit 0 +fi + +echo -n "enforced.value " && cat /selinux/enforce + diff --git a/files/plugins/xen b/files/plugins/xen new file mode 100755 index 0000000..575cd3b --- /dev/null +++ b/files/plugins/xen @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Script to monitor CPU usage of Xen domains +# +# Parameters understood: +# +# conifg (required) +# autoconf (optinal - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Domain Utilerisation' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel mS' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + /usr/sbin/xm list | grep -v "^Name .* Console$" | \ + while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + echo "$name.label $name" + echo "$name.type COUNTER" +# if [ "$name" = "Domain_0" ]; then +# echo "$name.draw AREA" +# else +# echo "$name.draw STACK" +# fi + echo "$name.min 0" + echo "$name.info Wall clock time spend for $name" + done + exit 0 +fi + +/usr/sbin/xm list | grep -v "^Name" | grep -v "^Name .* Console$" | \ +while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + time=`echo $time | sed -e "s/\.//"` + echo "$name.value $time" +done + diff --git a/files/plugins/xen-cpu b/files/plugins/xen-cpu new file mode 100755 index 0000000..0ef301e --- /dev/null +++ b/files/plugins/xen-cpu @@ -0,0 +1,125 @@ +#!/usr/bin/perl -wT +# +# Script to minitor the cpu usage of Xen domains +# +# Author: Adam Crews shroom com> +# +# License: GPL +# Based on the origional xen script from Matthias Pfafferodt, syntron at web.de +# +# Note: Your munin config must run this as root. +# +# Parameters +# config (required) +# autoconf (optional - used by munin-config) +# +#%# family=auto +#%# capabilities=autoconf + +# Define where to find xm tools +my $XM = '/usr/sbin/xm'; +my $XMTOP = '/usr/sbin/xentop'; + +############## +# You should not need to edit anything below here +# + +use strict; + +$ENV{PATH} = '/bin:/usr/bin:/usr/sbin'; + +my $arg; undef($arg); +if (defined($ARGV[0])) { + $arg = 'config' if ($ARGV[0] eq 'config'); + $arg = 'autoconf' if ($ARGV[0] eq 'autoconf'); + + if ( "$arg" eq 'autoconf') { + if ( -e $XM && -e $XMTOP ) { + print "yes\n"; + exit 0; + } else { + print "no ($XM and/or $XMTOP not found\n"; + exit 1; + } + } + + if ( "$arg" eq 'config') { + my %cnf; undef(%cnf); + %cnf = ( + 'graph_title' => 'Xen Domain CPU Usage', + 'graph_args' => '--base 1000 -l 0 --upper-limit 100 --rigid', + 'graph_vlabel' => 'Percent (%)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the % of CPU Usage for each domain', + ); + + my @domains = `$XM list`; + shift(@domains); # we dont need the header line + my $cnt = "0"; + foreach my $domain ( @domains ) { + my ($dom,undef) = split(/\s/, $domain, 2); + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $dom =~ s/[-.]/_/g; + + $cnf{ "$dom" . '.label' } = "$dom"; + $cnf{ "$dom" . '.draw' } = 'STACK'; + $cnf{ "$dom" . '.min' } = '0'; + $cnf{ "$dom" . '.max' } = '100'; + $cnf{ "$dom" . '.info' } = '% CPU used for ' . "$dom"; + + if ( "$cnt" == "0") { $cnf{$dom.'.draw'} = 'AREA'; } + $cnt++; + } + + foreach my $key (sort(keys(%cnf))) { + print "$key $cnf{$key}\n"; + } + exit 0; + } +} + +# Nothing was passed as an argument, so let's just return the proper values + +my @chunks; undef(@chunks); + +{ + # run the xentop command a few times because the first reading is not always accurate + local $/ = undef; + @chunks = split(/^xentop - .*$/m, `$XMTOP -b -i2 -d2`); +} + +# Take only the last run of xentop +my @stats = split (/\n/,pop(@chunks)); + +# remove the first 4 items that are junk that we don't need. +shift(@stats); +shift(@stats); +shift(@stats); +shift(@stats); + +my %vals; undef(%vals); + +foreach my $domain (@stats) { + # trim the leading whitespace + $domain =~ s/^\s+//; + my @v_tmp = split(/\s+/, $domain); + + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $v_tmp[0] =~ s/[-.]/_/g; + + $vals{$v_tmp[0]}{'cpu_percent'} = $v_tmp[3]; + $vals{$v_tmp[0]}{'vcpu'} = $v_tmp[8]; + if ( $vals{$v_tmp[0]}{'vcpu'} =~ m/n\/a/ ) { + my $cpu = `grep -c "processor" < /proc/cpuinfo`; + if ( $cpu =~ m/^(\d+)$/ ) { + $vals{$v_tmp[0]}{'vcpu'} = $1; + } + } +} + +foreach my $key (sort(keys(%vals))) { + print "$key.value " . ($vals{$key}{'cpu_percent'}/$vals{'Domain_0'}{'vcpu'}), "\n"; +} + diff --git a/files/plugins/xen_memory b/files/plugins/xen_memory new file mode 100755 index 0000000..90bc705 --- /dev/null +++ b/files/plugins/xen_memory @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Script to monitor memory status of the xen host +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Memory' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel MB' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + # xm info | while read name bla value; do echo "$name $value"; done + /usr/sbin/xm info | while read name bla value; do + #total_memory 2047 + #free_memory 1476 + name=`echo $name | sed -e"s/-/_/"` + + if [ "$name" = "total_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.min 0" + echo "$name.info total memory" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.draw AREA" +# echo "$name.draw STACK" + echo "$name.min 0" + echo "$name.info free memory" + fi + done + exit 0 +fi + +/usr/sbin/xm info | while read name bla value; do + name=`echo $name | sed -e"s/-/_/"` + if [ "$name" = "total_memory" ]; then + echo "$name.value $value" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.value $value" + fi +done + diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd new file mode 100755 index 0000000..238bf08 --- /dev/null +++ b/files/plugins/xen_vbd @@ -0,0 +1,109 @@ +#!/usr/bin/perl +# +# 2007-06-01 Zoltan HERPAI +# +# Credits goes for: +# Adam Crews for his xen_cpu plugin +# Mario Manno for his xen_traffic_all plugin +# +# Script to monitor the I/O usage of Xen domains +# Version 0.1 +# +#%# family=auto +#%# capabilities=autoconf + +# Location of xm tools +$XM = '/usr/sbin/xm'; +$XMTOP = '/usr/sbin/xentop'; + +# ah, parameters coming in +if ( defined($ARGV[0])) +{ + if ($ARGV[0] eq 'config') { $arg = 'config'; } + if ($ARGV[0] eq 'autoconf') { $arg = 'autoconf'; } + + if ( $arg eq 'autoconf' ) + { + if ( -e $XM && -e $XMTOP ) + { + print "yes\n"; + exit 0; + } + else + { + print "no ($XM and/or $XMTOP not found\n"; + exit 0; + } + } + + if ( $arg eq 'config' ) + { + %cnf = ( + 'graph_title' => 'Xen Domain I/O usage', + 'graph_args' => '--base 1024 -l 0', + 'graph_vlabel' => 'read (-), write (+)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the I/O operations for each domain', + ); + + @domains = `$XM list`; + shift(@domains); # we don't need the header line + + foreach $domain ( @domains ) + { + ($dom, undef) = split(/\s/, $domain); + $dom =~ s/[-.]/_/g; + + $cnf{ $dom.'RD' . '.label' } = 'read'; + $cnf{ $dom.'RD' . '.type' } = 'COUNTER'; + $cnf{ $dom.'RD' . '.graph' } = 'no'; + $cnf{ $dom.'RD' . '.cdef' } = $dom.'RD,8,*'; + + $cnf{ $dom.'WR' . '.label' } = $dom; + $cnf{ $dom.'WR' . '.type' } = 'COUNTER'; + $cnf{ $dom.'WR' . '.negative' } = $dom.'RD'; + $cnf{ $dom.'WR' . '.cdef' } = $dom.'WR,8,*'; + + if ( "$cnt" == "0" ) + { + $cnf { "$dom" . '.draw' } = 'AREA'; + } + $cnt++; + } + + foreach $key ( sort(keys(%cnf)) ) + { + print "$key $cnf{$key}\n"; + } + exit 0; + + } +} + + +# No args, get rolling +# NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID +$tmpfile = "/tmp/munin_xen_vbd_tmp"; + +system("$XMTOP -b -i1 > $tmpfile"); +open(I,"$tmpfile"); +while(){ + chomp; + s/^\s*//g; + @tmp=split(/\s+/, $_); + next if $tmp[0] eq "NAME"; + + $domname = $tmp[0]; + $domname =~ s/[-.]/_/g; + $vbdrd = $tmp[14]; + $vbdwr = $tmp[15]; + + $vals{$domname."RD"}{'value'} = $vbdrd; + $vals{$domname."WR"}{'value'} = $vbdwr; +} + +foreach $key ( sort(keys(%vals)) ) +{ + print "$key.value " . ($vals{$key}{'value'}) . "\n"; +} + diff --git a/manifests/client.pp b/manifests/client.pp index 2e8f018..1aa0e88 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -40,7 +40,7 @@ class munin::client { default: { include munin::plugins::linux case $virtual { - xen0: { include munin::plugins::xen } + xen0: { include munin::plugins::dom0 } } } } @@ -100,6 +100,7 @@ class munin::client::darwin class munin::client::debian { + $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } @@ -130,13 +131,15 @@ class munin::client::debian class munin::client::gentoo { - package { 'munin': + $script_path_default = "/usr/libexec/munin/plugins" + $acpi_available = "absent" + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { @@ -157,18 +160,18 @@ class munin::client::gentoo } munin::register { $fqdn: } - } class munin::client::centos { - package { 'munin-node': + $script_path_default = "/usr/share/munin/plugins" + package { 'munin-node': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f21098e..f5919e1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -145,6 +145,11 @@ class munin::plugins::base { } } } + + case $operatingsystem { + gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } + default: { $script_path_default = "/usr/share/munin/plugins" } + } } # handle if_ and if_err_ plugins @@ -189,8 +194,51 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + file { "$script_path_default/gentoo_lastupdated": + source => "puppet://$servername/munin/plugins/gentoo_lastupdated", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"gentoo_lastupdated": ensure => present;} } class munin::plugins::centos inherits munin::plugins::base { } +class munin::plugins::selinux inherits munin::plugins::base { + file { "$script_path_default/selinuxenforced": + source => "puppet://$servername/munin/plugins/selinuxenforced", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"selinuxenforced": ensure => present;} +} + +class munin::plugins::dom0 inherits munin::plugins::base { + file { + [ "$script_path_default/xen" ]: + source => "puppet://$servername/munin/plugins/xen", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen-cpu" ]: + source => "puppet://$servername/munin/plugins/xen-cpu", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_memory" ]: + source => "puppet://$servername/munin/plugins/xen_memory", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_vbd" ]: + source => "puppet://$servername/munin/plugins/xen_vbd", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin { + [ xen, xen-cpu, xen_memory, xen_vbd ]: + ensure => present; + } +} + -- cgit v1.2.3 From 9082862f719e3fe9eac5192114893e4281a6d1fb Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 30 Jan 2008 21:37:34 +0000 Subject: rearranged some stuff --- files/plugins/gentoo_lastupdated | 71 ++++++++++++++++++++++ files/plugins/selinux_avcstats | 111 ++++++++++++++++++++++++++++++++++ files/plugins/selinuxenforced | 32 ++++++++++ files/plugins/xen | 52 ++++++++++++++++ files/plugins/xen-cpu | 125 +++++++++++++++++++++++++++++++++++++++ files/plugins/xen_memory | 63 ++++++++++++++++++++ files/plugins/xen_vbd | 109 ++++++++++++++++++++++++++++++++++ manifests/client.pp | 15 +++-- manifests/plugin.pp | 48 +++++++++++++++ 9 files changed, 620 insertions(+), 6 deletions(-) create mode 100755 files/plugins/gentoo_lastupdated create mode 100755 files/plugins/selinux_avcstats create mode 100755 files/plugins/selinuxenforced create mode 100755 files/plugins/xen create mode 100755 files/plugins/xen-cpu create mode 100755 files/plugins/xen_memory create mode 100755 files/plugins/xen_vbd diff --git a/files/plugins/gentoo_lastupdated b/files/plugins/gentoo_lastupdated new file mode 100755 index 0000000..42fd362 --- /dev/null +++ b/files/plugins/gentoo_lastupdated @@ -0,0 +1,71 @@ +#!/usr/bin/perl +# -*- perl -*- +# +# (C) 2007 immerda project +# +# Plugin to monitor the last update of the gentoo +# +# Parameters: +# +# config +# autoconf +# +# $Id: users.in 1212 2006-10-29 20:11:58Z janl $ +# +#%# family=auto +#%# capabilities=autoconf + +# update /etc/munin/plugin-conf.d/munin-node with: +# [gentoo_*] +# user root +# env.logfile /var/log/emerge.log +# env.tail /usr/bin/tail +# env.grep /bin/grep + +my $logfile = $ENV{'logfile'} || '/var/log/emerge.log'; +my $grep = $ENV{'grep'} || `which grep`; +my $date = $ENV{'date'} || `which date`; +my $tail = $ENV{'tail'} || `which tail`; +chomp($grep); +chomp($date); +chomp($tail); + +if ( defined($ARGV[0])) { + if ($ARGV[0] eq 'autoconf') { + print "yes\n"; + exit 0; + } + + if ( $ARGV[0] eq "config" ) { + print "graph_title Gentoo: Last update X days ago\n"; + #print "graph_args --base 1000 -l 0\n"; + print "graph_vlabel days\n"; + print "graph_scale no\n"; + print "graph_category system\n"; + #print "graph_printf %.1lf\n"; + print "lastupdated.label last updated [d ago]\n"; + print "lastupdated.type GAUGE\n"; + #print "tty.draw AREASTACK\n"; + #print "tty.colour 00FF00\n"; + exit 0; + } +} + +$days = 0; +$last = 0; +$now = 0; + +$l=`$grep "emerge" $logfile | $grep world | $grep -v fetchonly | tail -1`; + +($last,$rest) = split /:/,$l; +$now = `$date +%s`; +if($last eq "" or $last == 0 or $now == 0 or $date eq ""){ + $days = ""; +}else{ + $days=($now-$last)/60/60/24; # in tagen +} + +print "lastupdated.value $days\n"; + +# vim:syntax=perl + diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats new file mode 100755 index 0000000..9687be0 --- /dev/null +++ b/files/plugins/selinux_avcstats @@ -0,0 +1,111 @@ +#!/bin/sh +# +# Plugin to monitor SELinux's Access Vector Cache (AVC). +# +# config (required) +# autoconf (optional - used by munin-config) +# +# Lars Strand, 2007 +# +# +# Magic markers (used by munin-config and some installation scripts (i.e. +# optional)): +#%# family=auto +#%# capabilities=autoconf + + +AVCSTATS="/selinux/avc/cache_stats" + +if [ "$1" = "autoconf" ]; then + if [ -r $AVCSTATS ]; then + echo yes + exit 0 + else + echo no + exit 1 + fi +fi + +if [ "$1" = "config" ]; then + + echo "graph_title SELinux's Access Vector Cache" + echo 'graph_args -l 0 --base 1000' + echo 'graph_vlabel AVC operations' + echo 'graph_category system' + + echo 'lookups.label lookups' + echo 'lookups.type DERIVE' + echo 'lookups.min 0' + echo 'lookups.max 1000000000' + echo 'lookups.draw AREA' + echo 'lookups.colour ff0000' # Red + echo 'lookups.info Number of access vector lookups. This number is a good indicator of the load beeing placed on the AVC.' + + echo 'hits.label hits' + echo 'hits.type DERIVE' + echo 'hits.min 0' + echo 'hits.max 1000000000' + echo 'hits.draw STACK' + echo 'hits.colour 0022ff' # Blue + echo 'hits.info Number of access vector hits.' + + echo 'misses.label misses' + echo 'misses.type DERIVE' + echo 'misses.min 0' + echo 'misses.max 1000000000' + echo 'misses.draw STACK' + echo 'misses.colour 990000' # Darker red + echo 'misses.info Number of cache misses.' + + echo 'allocations.label allocations' + echo 'allocations.type DERIVE' + echo 'allocations.min 0' + echo 'allocations.max 100000000' + echo 'allocations.draw STACK' + echo 'allocations.colour ffa500' # Orange + echo 'allocations.info Number of AVC entries allocated.' + + echo 'reclaims.label reclaims' + echo 'reclaims.type DERIVE' + echo 'reclaims.min 0' + echo 'reclaims.max 1000000000' + echo 'reclaims.draw STACK' + echo 'reclaims.colour 00aaaa' # Darker turquoise + echo 'reclaims.info Number of current total reclaimed AVC entries. If this keeps changing, you may need to increase the cache size (/selinux/avc/cache_threshold).' + + echo 'frees.label frees' + echo 'frees.type DERIVE' + echo 'frees.min 0' + echo 'frees.max 1000000000' + echo 'frees.draw STACK' + echo 'frees.colour 00ff7f' # Spring green + echo 'frees.info Number of free AVC entries.' + + exit 0 +fi + +if [ -r $AVCSTATS ]; then + awk ' NR > 1 { + lookups += $1; + hits += $2; + misses += $3; + allocations += $4; + reclaims += $5; + frees += $6; + } END { + print "lookups.value " lookups; + print "hits.value " hits; + print "misses.value " misses; + print "allocations.value " allocations; + print "reclaims.value " reclaims; + print "frees.value " frees; + } ' < $AVCSTATS +else + echo "lookups.value U" + echo "hits.value U" + echo "misses.value U" + echo "allocations.value U" + echo "reclaims.value U" + echo "frees.value U" +fi + diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced new file mode 100755 index 0000000..2f88b9b --- /dev/null +++ b/files/plugins/selinuxenforced @@ -0,0 +1,32 @@ +#!/bin/sh +# -*- sh -*- +# +# Plugin to count the daily amount of Virii (qmailscan) +# +# Contributed by David Obando (david@cryptix.de) - 03.12.2005 +# + +# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: +#LOG0=/var/spool/qmailscan/quarantine.log +#LOG1=/var/spool/qmailscan/quarantine.log.1 + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title enforced amount' + echo 'graph_args --upper-limit 1 -l 0 ' + echo 'graph_vlabel Is the system selinux enforced?' + echo 'graph_scale no\n'; + echo 'graph_category selinux' + echo 'enforced.label IsEnforced' + #echo 'enforced.draw AREA' + echo 'enforced.draw LINE2' + + exit 0 +fi + +echo -n "enforced.value " && cat /selinux/enforce + diff --git a/files/plugins/xen b/files/plugins/xen new file mode 100755 index 0000000..575cd3b --- /dev/null +++ b/files/plugins/xen @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Script to monitor CPU usage of Xen domains +# +# Parameters understood: +# +# conifg (required) +# autoconf (optinal - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Domain Utilerisation' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel mS' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + /usr/sbin/xm list | grep -v "^Name .* Console$" | \ + while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + echo "$name.label $name" + echo "$name.type COUNTER" +# if [ "$name" = "Domain_0" ]; then +# echo "$name.draw AREA" +# else +# echo "$name.draw STACK" +# fi + echo "$name.min 0" + echo "$name.info Wall clock time spend for $name" + done + exit 0 +fi + +/usr/sbin/xm list | grep -v "^Name" | grep -v "^Name .* Console$" | \ +while read name domid mem cpu state time console; do + name=`echo $name | sed -e"s/-/_/"` + time=`echo $time | sed -e "s/\.//"` + echo "$name.value $time" +done + diff --git a/files/plugins/xen-cpu b/files/plugins/xen-cpu new file mode 100755 index 0000000..0ef301e --- /dev/null +++ b/files/plugins/xen-cpu @@ -0,0 +1,125 @@ +#!/usr/bin/perl -wT +# +# Script to minitor the cpu usage of Xen domains +# +# Author: Adam Crews shroom com> +# +# License: GPL +# Based on the origional xen script from Matthias Pfafferodt, syntron at web.de +# +# Note: Your munin config must run this as root. +# +# Parameters +# config (required) +# autoconf (optional - used by munin-config) +# +#%# family=auto +#%# capabilities=autoconf + +# Define where to find xm tools +my $XM = '/usr/sbin/xm'; +my $XMTOP = '/usr/sbin/xentop'; + +############## +# You should not need to edit anything below here +# + +use strict; + +$ENV{PATH} = '/bin:/usr/bin:/usr/sbin'; + +my $arg; undef($arg); +if (defined($ARGV[0])) { + $arg = 'config' if ($ARGV[0] eq 'config'); + $arg = 'autoconf' if ($ARGV[0] eq 'autoconf'); + + if ( "$arg" eq 'autoconf') { + if ( -e $XM && -e $XMTOP ) { + print "yes\n"; + exit 0; + } else { + print "no ($XM and/or $XMTOP not found\n"; + exit 1; + } + } + + if ( "$arg" eq 'config') { + my %cnf; undef(%cnf); + %cnf = ( + 'graph_title' => 'Xen Domain CPU Usage', + 'graph_args' => '--base 1000 -l 0 --upper-limit 100 --rigid', + 'graph_vlabel' => 'Percent (%)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the % of CPU Usage for each domain', + ); + + my @domains = `$XM list`; + shift(@domains); # we dont need the header line + my $cnt = "0"; + foreach my $domain ( @domains ) { + my ($dom,undef) = split(/\s/, $domain, 2); + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $dom =~ s/[-.]/_/g; + + $cnf{ "$dom" . '.label' } = "$dom"; + $cnf{ "$dom" . '.draw' } = 'STACK'; + $cnf{ "$dom" . '.min' } = '0'; + $cnf{ "$dom" . '.max' } = '100'; + $cnf{ "$dom" . '.info' } = '% CPU used for ' . "$dom"; + + if ( "$cnt" == "0") { $cnf{$dom.'.draw'} = 'AREA'; } + $cnt++; + } + + foreach my $key (sort(keys(%cnf))) { + print "$key $cnf{$key}\n"; + } + exit 0; + } +} + +# Nothing was passed as an argument, so let's just return the proper values + +my @chunks; undef(@chunks); + +{ + # run the xentop command a few times because the first reading is not always accurate + local $/ = undef; + @chunks = split(/^xentop - .*$/m, `$XMTOP -b -i2 -d2`); +} + +# Take only the last run of xentop +my @stats = split (/\n/,pop(@chunks)); + +# remove the first 4 items that are junk that we don't need. +shift(@stats); +shift(@stats); +shift(@stats); +shift(@stats); + +my %vals; undef(%vals); + +foreach my $domain (@stats) { + # trim the leading whitespace + $domain =~ s/^\s+//; + my @v_tmp = split(/\s+/, $domain); + + # we need to change - and . to _ or things get weird with the graphs + # some decent quoting would probably fix this, but this works for now + $v_tmp[0] =~ s/[-.]/_/g; + + $vals{$v_tmp[0]}{'cpu_percent'} = $v_tmp[3]; + $vals{$v_tmp[0]}{'vcpu'} = $v_tmp[8]; + if ( $vals{$v_tmp[0]}{'vcpu'} =~ m/n\/a/ ) { + my $cpu = `grep -c "processor" < /proc/cpuinfo`; + if ( $cpu =~ m/^(\d+)$/ ) { + $vals{$v_tmp[0]}{'vcpu'} = $1; + } + } +} + +foreach my $key (sort(keys(%vals))) { + print "$key.value " . ($vals{$key}{'cpu_percent'}/$vals{'Domain_0'}{'vcpu'}), "\n"; +} + diff --git a/files/plugins/xen_memory b/files/plugins/xen_memory new file mode 100755 index 0000000..90bc705 --- /dev/null +++ b/files/plugins/xen_memory @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Script to monitor memory status of the xen host +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# + +MAXDOMAINS=16 + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + exit 0 + fi + echo "no (xm not found)" + exit 1 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Memory' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel MB' + echo 'graph_category xen' + echo 'graph_info This graph shows of many mS wall time where used by a domain' + # xm info | while read name bla value; do echo "$name $value"; done + /usr/sbin/xm info | while read name bla value; do + #total_memory 2047 + #free_memory 1476 + name=`echo $name | sed -e"s/-/_/"` + + if [ "$name" = "total_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.min 0" + echo "$name.info total memory" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.label $name" + echo "$name.type GAUGE" + echo "$name.draw AREA" +# echo "$name.draw STACK" + echo "$name.min 0" + echo "$name.info free memory" + fi + done + exit 0 +fi + +/usr/sbin/xm info | while read name bla value; do + name=`echo $name | sed -e"s/-/_/"` + if [ "$name" = "total_memory" ]; then + echo "$name.value $value" + fi + if [ "$name" = "free_memory" ]; then + echo "$name.value $value" + fi +done + diff --git a/files/plugins/xen_vbd b/files/plugins/xen_vbd new file mode 100755 index 0000000..238bf08 --- /dev/null +++ b/files/plugins/xen_vbd @@ -0,0 +1,109 @@ +#!/usr/bin/perl +# +# 2007-06-01 Zoltan HERPAI +# +# Credits goes for: +# Adam Crews for his xen_cpu plugin +# Mario Manno for his xen_traffic_all plugin +# +# Script to monitor the I/O usage of Xen domains +# Version 0.1 +# +#%# family=auto +#%# capabilities=autoconf + +# Location of xm tools +$XM = '/usr/sbin/xm'; +$XMTOP = '/usr/sbin/xentop'; + +# ah, parameters coming in +if ( defined($ARGV[0])) +{ + if ($ARGV[0] eq 'config') { $arg = 'config'; } + if ($ARGV[0] eq 'autoconf') { $arg = 'autoconf'; } + + if ( $arg eq 'autoconf' ) + { + if ( -e $XM && -e $XMTOP ) + { + print "yes\n"; + exit 0; + } + else + { + print "no ($XM and/or $XMTOP not found\n"; + exit 0; + } + } + + if ( $arg eq 'config' ) + { + %cnf = ( + 'graph_title' => 'Xen Domain I/O usage', + 'graph_args' => '--base 1024 -l 0', + 'graph_vlabel' => 'read (-), write (+)', + 'graph_category' => 'xen', + 'graph_info' => 'Display the I/O operations for each domain', + ); + + @domains = `$XM list`; + shift(@domains); # we don't need the header line + + foreach $domain ( @domains ) + { + ($dom, undef) = split(/\s/, $domain); + $dom =~ s/[-.]/_/g; + + $cnf{ $dom.'RD' . '.label' } = 'read'; + $cnf{ $dom.'RD' . '.type' } = 'COUNTER'; + $cnf{ $dom.'RD' . '.graph' } = 'no'; + $cnf{ $dom.'RD' . '.cdef' } = $dom.'RD,8,*'; + + $cnf{ $dom.'WR' . '.label' } = $dom; + $cnf{ $dom.'WR' . '.type' } = 'COUNTER'; + $cnf{ $dom.'WR' . '.negative' } = $dom.'RD'; + $cnf{ $dom.'WR' . '.cdef' } = $dom.'WR,8,*'; + + if ( "$cnt" == "0" ) + { + $cnf { "$dom" . '.draw' } = 'AREA'; + } + $cnt++; + } + + foreach $key ( sort(keys(%cnf)) ) + { + print "$key $cnf{$key}\n"; + } + exit 0; + + } +} + + +# No args, get rolling +# NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR SSID +$tmpfile = "/tmp/munin_xen_vbd_tmp"; + +system("$XMTOP -b -i1 > $tmpfile"); +open(I,"$tmpfile"); +while(){ + chomp; + s/^\s*//g; + @tmp=split(/\s+/, $_); + next if $tmp[0] eq "NAME"; + + $domname = $tmp[0]; + $domname =~ s/[-.]/_/g; + $vbdrd = $tmp[14]; + $vbdwr = $tmp[15]; + + $vals{$domname."RD"}{'value'} = $vbdrd; + $vals{$domname."WR"}{'value'} = $vbdwr; +} + +foreach $key ( sort(keys(%vals)) ) +{ + print "$key.value " . ($vals{$key}{'value'}) . "\n"; +} + diff --git a/manifests/client.pp b/manifests/client.pp index 2e8f018..1aa0e88 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -40,7 +40,7 @@ class munin::client { default: { include munin::plugins::linux case $virtual { - xen0: { include munin::plugins::xen } + xen0: { include munin::plugins::dom0 } } } } @@ -100,6 +100,7 @@ class munin::client::darwin class munin::client::debian { + $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } @@ -130,13 +131,15 @@ class munin::client::debian class munin::client::gentoo { - package { 'munin': + $script_path_default = "/usr/libexec/munin/plugins" + $acpi_available = "absent" + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { @@ -157,18 +160,18 @@ class munin::client::gentoo } munin::register { $fqdn: } - } class munin::client::centos { - package { 'munin-node': + $script_path_default = "/usr/share/munin/plugins" + package { 'munin-node': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', default => '', }, - } + } file { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f21098e..f5919e1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -145,6 +145,11 @@ class munin::plugins::base { } } } + + case $operatingsystem { + gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } + default: { $script_path_default = "/usr/share/munin/plugins" } + } } # handle if_ and if_err_ plugins @@ -189,8 +194,51 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { + file { "$script_path_default/gentoo_lastupdated": + source => "puppet://$servername/munin/plugins/gentoo_lastupdated", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"gentoo_lastupdated": ensure => present;} } class munin::plugins::centos inherits munin::plugins::base { } +class munin::plugins::selinux inherits munin::plugins::base { + file { "$script_path_default/selinuxenforced": + source => "puppet://$servername/munin/plugins/selinuxenforced", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{"selinuxenforced": ensure => present;} +} + +class munin::plugins::dom0 inherits munin::plugins::base { + file { + [ "$script_path_default/xen" ]: + source => "puppet://$servername/munin/plugins/xen", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen-cpu" ]: + source => "puppet://$servername/munin/plugins/xen-cpu", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_memory" ]: + source => "puppet://$servername/munin/plugins/xen_memory", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/xen_vbd" ]: + source => "puppet://$servername/munin/plugins/xen_vbd", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin { + [ xen, xen-cpu, xen_memory, xen_vbd ]: + ensure => present; + } +} + -- cgit v1.2.3 From bcfaf038060db93bc73c3aa616a8701bba457b35 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 16:18:21 +0000 Subject: =?UTF-8?q?tinydns=20munin=20modul=20f=C3=BCr=20immer1-4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@635 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/tinydns | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 13 ++++ 2 files changed, 185 insertions(+) create mode 100755 files/plugins/tinydns diff --git a/files/plugins/tinydns b/files/plugins/tinydns new file mode 100755 index 0000000..0fb78ff --- /dev/null +++ b/files/plugins/tinydns @@ -0,0 +1,172 @@ +#!/usr/bin/perl -T + +# tinydns-munin-plugin + +# Copyright (C) 2007 admin at immerda.ch +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# with the HELP of +# tinygraph -- a RRDtool frontend for tinydns statistics +# Copyright (C) 2005 Ulrich Zehl + +#use strict; # to activate .... + + +#use Time::TAI64 qw(tai2unix); + +$A = 0; +$NS = 0; +$CNAME = 0; +$SOA = 0; +$PTR = 0; +$HINFO = 0; +$MX = 0; +$TXT = 0; +$RP = 0; +$SIG = 0; +$KEY = 0; +$AAAA = 0; +$A6 = 0; +$IXFR = 0; +$AXFR = 0; +$ANY = 0; + +$logfile = $ENV{logdir} || "/var/tinydns/log/main/current"; + +if ( $ARGV[0] and $ARGV[0] eq "config" ) +{ + print "host_name $ENV{FQDN}\n"; + print "graph_title tinydns\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category DNS\n"; + print "a.type COUNTER\n"; + print "mx.type COUNTER\n"; + + print "a.label A\n"; + print "ns.label NS\n"; + print "cname.label CNAME\n"; + print "soa.label SOA\n"; + print "ptr.label PTR\n"; + print "mx.label MX\n"; + print "aaaa.label AAAA\n"; + print "any.label ANY\n"; + print "hinfo.label HINFO\n"; + print "txt.label TXT\n"; + print "rp.label RP\n"; + print "sig.label SIG\n"; + print "key.label KEY\n"; + print "a6.label A6\n"; + print "ixfr.label IXFR\n"; + print "axfr.label AXFR\n"; + + print "a.type COUNTER\n"; + print "ns.type COUNTER\n"; + print "cname.type COUNTER\n"; + print "soa.type COUNTER\n"; + print "ptr.type COUNTER\n"; + print "mx.type COUNTER\n"; + print "aaaa.type COUNTER\n"; + print "any.type COUNTER\n"; + print "hinfo.type COUNTER\n"; + print "txt.type COUNTER\n"; + print "rp.type COUNTER\n"; + print "sig.type COUNTER\n"; + print "key.type COUNTER\n"; + print "a6.type COUNTER\n"; + print "ixfr.type COUNTER\n"; + print "axfr.type COUNTER\n"; + exit 0; +} + +my %querytypes = ( + '0001' => 'A', + '0002' => 'NS', + '0005' => 'CNAME', + '0006' => 'SOA', + '000c' => 'PTR', + '000d' => 'HINFO', + '000f' => 'MX', + '0010' => 'TXT', + '0011' => 'RP', + '0018' => 'SIG', + '0019' => 'KEY', + '001c' => 'AAAA', + '0026' => 'A6', + '00fb' => 'IXFR', + '00fc' => 'AXFR', + '00ff' => 'ANY', +); + +my %sum = ( + (map {$_ => 0} values %querytypes), +); + +sub process_line($) +{ + my $line = shift; + if ($line =~ /^(@[a-f0-9]{24}) ([a-f0-9]{8}):[a-f0-9]{4}:[a-f0-9]{4} ([\+\-IC\/]) ([a-f0-9]{4}) (.+)$/) + { + #my $time = tai2unix($1); + my $ip = join(".", unpack("C*", pack("H8", $2))); + my $rtype = $3; + my $qtype = $querytypes{$4}; + #my $qstring = $5; # currently unused + + if ($rtype eq '+') + { + if ($qtype eq 'A'){$A++;}; + if ($qtype eq 'NS'){$NS++;}; + if ($qtype eq 'CNAME'){$CNAME++;}; + if ($qtype eq 'SOA'){$SOA++;}; + if ($qtype eq 'PTR'){$PTR++;}; + if ($qtype eq 'HINFO'){$HINFO++;}; + if ($qtype eq 'MX'){$MX++;}; + if ($qtype eq 'TXT'){$TXT++;}; + if ($qtype eq 'RP'){$RP++;}; + if ($qtype eq 'SIG'){$SIG++;}; + if ($qtype eq 'KEY'){$KEY++;}; + if ($qtype eq 'AAAA'){$AAAA++;}; + if ($qtype eq 'A6'){$A6++;}; + if ($qtype eq 'IXFR'){$IXFR++;}; + if ($qtype eq 'AXFR'){$AXFR++;}; + if ($qtype eq 'ANY'){$ANY++;}; + } + } +} + +open(LOG, "<$logfile") or die "Error opening $logfile: $!"; + +while () +{ + process_line($_); +} + +print "a.value $A\n"; +print "ns.value $NS\n"; +print "cname.value $CNAME\n"; +print "soa.value $SOA\n"; +print "ptr.value $PTR\n"; +print "mx.value $MX\n"; +print "aaaa.value $AAAA\n"; +print "any.value $ANY\n"; +print "hinfo.value $HINFO\n"; +print "txt.value $TXT\n"; +print "rp.value $RP\n"; +print "sig.value $SIG\n"; +print "key.value $KEY\n"; +print "a6.value $A6\n"; +print "ixfr.value $IXFR\n"; +print "axfr.value $AXFR\n"; + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f5919e1..b8a28aa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,3 +242,16 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::djbdns inherits munin::plugins::base { + file { + [ "$script_path_default/tinydns" ]: + source => "puppet://$servername/munin/plugins/tinydns", + ensure => file, + mode => 0755, owner => root, group => 0; + } + plugin { + [ tinydns ]: + ensure => present; + } +} + -- cgit v1.2.3 From 62f6d972b6ca769bf7b75e78615bc0f3ffbbb081 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 16:18:21 +0000 Subject: =?UTF-8?q?tinydns=20munin=20modul=20f=C3=BCr=20immer1-4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@635 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/tinydns | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 13 ++++ 2 files changed, 185 insertions(+) create mode 100755 files/plugins/tinydns diff --git a/files/plugins/tinydns b/files/plugins/tinydns new file mode 100755 index 0000000..0fb78ff --- /dev/null +++ b/files/plugins/tinydns @@ -0,0 +1,172 @@ +#!/usr/bin/perl -T + +# tinydns-munin-plugin + +# Copyright (C) 2007 admin at immerda.ch +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# with the HELP of +# tinygraph -- a RRDtool frontend for tinydns statistics +# Copyright (C) 2005 Ulrich Zehl + +#use strict; # to activate .... + + +#use Time::TAI64 qw(tai2unix); + +$A = 0; +$NS = 0; +$CNAME = 0; +$SOA = 0; +$PTR = 0; +$HINFO = 0; +$MX = 0; +$TXT = 0; +$RP = 0; +$SIG = 0; +$KEY = 0; +$AAAA = 0; +$A6 = 0; +$IXFR = 0; +$AXFR = 0; +$ANY = 0; + +$logfile = $ENV{logdir} || "/var/tinydns/log/main/current"; + +if ( $ARGV[0] and $ARGV[0] eq "config" ) +{ + print "host_name $ENV{FQDN}\n"; + print "graph_title tinydns\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category DNS\n"; + print "a.type COUNTER\n"; + print "mx.type COUNTER\n"; + + print "a.label A\n"; + print "ns.label NS\n"; + print "cname.label CNAME\n"; + print "soa.label SOA\n"; + print "ptr.label PTR\n"; + print "mx.label MX\n"; + print "aaaa.label AAAA\n"; + print "any.label ANY\n"; + print "hinfo.label HINFO\n"; + print "txt.label TXT\n"; + print "rp.label RP\n"; + print "sig.label SIG\n"; + print "key.label KEY\n"; + print "a6.label A6\n"; + print "ixfr.label IXFR\n"; + print "axfr.label AXFR\n"; + + print "a.type COUNTER\n"; + print "ns.type COUNTER\n"; + print "cname.type COUNTER\n"; + print "soa.type COUNTER\n"; + print "ptr.type COUNTER\n"; + print "mx.type COUNTER\n"; + print "aaaa.type COUNTER\n"; + print "any.type COUNTER\n"; + print "hinfo.type COUNTER\n"; + print "txt.type COUNTER\n"; + print "rp.type COUNTER\n"; + print "sig.type COUNTER\n"; + print "key.type COUNTER\n"; + print "a6.type COUNTER\n"; + print "ixfr.type COUNTER\n"; + print "axfr.type COUNTER\n"; + exit 0; +} + +my %querytypes = ( + '0001' => 'A', + '0002' => 'NS', + '0005' => 'CNAME', + '0006' => 'SOA', + '000c' => 'PTR', + '000d' => 'HINFO', + '000f' => 'MX', + '0010' => 'TXT', + '0011' => 'RP', + '0018' => 'SIG', + '0019' => 'KEY', + '001c' => 'AAAA', + '0026' => 'A6', + '00fb' => 'IXFR', + '00fc' => 'AXFR', + '00ff' => 'ANY', +); + +my %sum = ( + (map {$_ => 0} values %querytypes), +); + +sub process_line($) +{ + my $line = shift; + if ($line =~ /^(@[a-f0-9]{24}) ([a-f0-9]{8}):[a-f0-9]{4}:[a-f0-9]{4} ([\+\-IC\/]) ([a-f0-9]{4}) (.+)$/) + { + #my $time = tai2unix($1); + my $ip = join(".", unpack("C*", pack("H8", $2))); + my $rtype = $3; + my $qtype = $querytypes{$4}; + #my $qstring = $5; # currently unused + + if ($rtype eq '+') + { + if ($qtype eq 'A'){$A++;}; + if ($qtype eq 'NS'){$NS++;}; + if ($qtype eq 'CNAME'){$CNAME++;}; + if ($qtype eq 'SOA'){$SOA++;}; + if ($qtype eq 'PTR'){$PTR++;}; + if ($qtype eq 'HINFO'){$HINFO++;}; + if ($qtype eq 'MX'){$MX++;}; + if ($qtype eq 'TXT'){$TXT++;}; + if ($qtype eq 'RP'){$RP++;}; + if ($qtype eq 'SIG'){$SIG++;}; + if ($qtype eq 'KEY'){$KEY++;}; + if ($qtype eq 'AAAA'){$AAAA++;}; + if ($qtype eq 'A6'){$A6++;}; + if ($qtype eq 'IXFR'){$IXFR++;}; + if ($qtype eq 'AXFR'){$AXFR++;}; + if ($qtype eq 'ANY'){$ANY++;}; + } + } +} + +open(LOG, "<$logfile") or die "Error opening $logfile: $!"; + +while () +{ + process_line($_); +} + +print "a.value $A\n"; +print "ns.value $NS\n"; +print "cname.value $CNAME\n"; +print "soa.value $SOA\n"; +print "ptr.value $PTR\n"; +print "mx.value $MX\n"; +print "aaaa.value $AAAA\n"; +print "any.value $ANY\n"; +print "hinfo.value $HINFO\n"; +print "txt.value $TXT\n"; +print "rp.value $RP\n"; +print "sig.value $SIG\n"; +print "key.value $KEY\n"; +print "a6.value $A6\n"; +print "ixfr.value $IXFR\n"; +print "axfr.value $AXFR\n"; + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f5919e1..b8a28aa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,3 +242,16 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::djbdns inherits munin::plugins::base { + file { + [ "$script_path_default/tinydns" ]: + source => "puppet://$servername/munin/plugins/tinydns", + ensure => file, + mode => 0755, owner => root, group => 0; + } + plugin { + [ tinydns ]: + ensure => present; + } +} + -- cgit v1.2.3 From 08e80baa5fa793c9f712edd7d0eb7e760a3e5e5a Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 16:18:21 +0000 Subject: =?UTF-8?q?tinydns=20munin=20modul=20f=C3=BCr=20immer1-4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/plugins/tinydns | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 13 ++++ 2 files changed, 185 insertions(+) create mode 100755 files/plugins/tinydns diff --git a/files/plugins/tinydns b/files/plugins/tinydns new file mode 100755 index 0000000..0fb78ff --- /dev/null +++ b/files/plugins/tinydns @@ -0,0 +1,172 @@ +#!/usr/bin/perl -T + +# tinydns-munin-plugin + +# Copyright (C) 2007 admin at immerda.ch +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# with the HELP of +# tinygraph -- a RRDtool frontend for tinydns statistics +# Copyright (C) 2005 Ulrich Zehl + +#use strict; # to activate .... + + +#use Time::TAI64 qw(tai2unix); + +$A = 0; +$NS = 0; +$CNAME = 0; +$SOA = 0; +$PTR = 0; +$HINFO = 0; +$MX = 0; +$TXT = 0; +$RP = 0; +$SIG = 0; +$KEY = 0; +$AAAA = 0; +$A6 = 0; +$IXFR = 0; +$AXFR = 0; +$ANY = 0; + +$logfile = $ENV{logdir} || "/var/tinydns/log/main/current"; + +if ( $ARGV[0] and $ARGV[0] eq "config" ) +{ + print "host_name $ENV{FQDN}\n"; + print "graph_title tinydns\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category DNS\n"; + print "a.type COUNTER\n"; + print "mx.type COUNTER\n"; + + print "a.label A\n"; + print "ns.label NS\n"; + print "cname.label CNAME\n"; + print "soa.label SOA\n"; + print "ptr.label PTR\n"; + print "mx.label MX\n"; + print "aaaa.label AAAA\n"; + print "any.label ANY\n"; + print "hinfo.label HINFO\n"; + print "txt.label TXT\n"; + print "rp.label RP\n"; + print "sig.label SIG\n"; + print "key.label KEY\n"; + print "a6.label A6\n"; + print "ixfr.label IXFR\n"; + print "axfr.label AXFR\n"; + + print "a.type COUNTER\n"; + print "ns.type COUNTER\n"; + print "cname.type COUNTER\n"; + print "soa.type COUNTER\n"; + print "ptr.type COUNTER\n"; + print "mx.type COUNTER\n"; + print "aaaa.type COUNTER\n"; + print "any.type COUNTER\n"; + print "hinfo.type COUNTER\n"; + print "txt.type COUNTER\n"; + print "rp.type COUNTER\n"; + print "sig.type COUNTER\n"; + print "key.type COUNTER\n"; + print "a6.type COUNTER\n"; + print "ixfr.type COUNTER\n"; + print "axfr.type COUNTER\n"; + exit 0; +} + +my %querytypes = ( + '0001' => 'A', + '0002' => 'NS', + '0005' => 'CNAME', + '0006' => 'SOA', + '000c' => 'PTR', + '000d' => 'HINFO', + '000f' => 'MX', + '0010' => 'TXT', + '0011' => 'RP', + '0018' => 'SIG', + '0019' => 'KEY', + '001c' => 'AAAA', + '0026' => 'A6', + '00fb' => 'IXFR', + '00fc' => 'AXFR', + '00ff' => 'ANY', +); + +my %sum = ( + (map {$_ => 0} values %querytypes), +); + +sub process_line($) +{ + my $line = shift; + if ($line =~ /^(@[a-f0-9]{24}) ([a-f0-9]{8}):[a-f0-9]{4}:[a-f0-9]{4} ([\+\-IC\/]) ([a-f0-9]{4}) (.+)$/) + { + #my $time = tai2unix($1); + my $ip = join(".", unpack("C*", pack("H8", $2))); + my $rtype = $3; + my $qtype = $querytypes{$4}; + #my $qstring = $5; # currently unused + + if ($rtype eq '+') + { + if ($qtype eq 'A'){$A++;}; + if ($qtype eq 'NS'){$NS++;}; + if ($qtype eq 'CNAME'){$CNAME++;}; + if ($qtype eq 'SOA'){$SOA++;}; + if ($qtype eq 'PTR'){$PTR++;}; + if ($qtype eq 'HINFO'){$HINFO++;}; + if ($qtype eq 'MX'){$MX++;}; + if ($qtype eq 'TXT'){$TXT++;}; + if ($qtype eq 'RP'){$RP++;}; + if ($qtype eq 'SIG'){$SIG++;}; + if ($qtype eq 'KEY'){$KEY++;}; + if ($qtype eq 'AAAA'){$AAAA++;}; + if ($qtype eq 'A6'){$A6++;}; + if ($qtype eq 'IXFR'){$IXFR++;}; + if ($qtype eq 'AXFR'){$AXFR++;}; + if ($qtype eq 'ANY'){$ANY++;}; + } + } +} + +open(LOG, "<$logfile") or die "Error opening $logfile: $!"; + +while () +{ + process_line($_); +} + +print "a.value $A\n"; +print "ns.value $NS\n"; +print "cname.value $CNAME\n"; +print "soa.value $SOA\n"; +print "ptr.value $PTR\n"; +print "mx.value $MX\n"; +print "aaaa.value $AAAA\n"; +print "any.value $ANY\n"; +print "hinfo.value $HINFO\n"; +print "txt.value $TXT\n"; +print "rp.value $RP\n"; +print "sig.value $SIG\n"; +print "key.value $KEY\n"; +print "a6.value $A6\n"; +print "ixfr.value $IXFR\n"; +print "axfr.value $AXFR\n"; + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index f5919e1..b8a28aa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,3 +242,16 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::djbdns inherits munin::plugins::base { + file { + [ "$script_path_default/tinydns" ]: + source => "puppet://$servername/munin/plugins/tinydns", + ensure => file, + mode => 0755, owner => root, group => 0; + } + plugin { + [ tinydns ]: + ensure => present; + } +} + -- cgit v1.2.3 From 0304c2d1897b8e7c848a139e054043c78416e8f2 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 16:49:42 +0000 Subject: =?UTF-8?q?if=5Feth0=20f=C3=BCr=20domU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@639 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b8a28aa..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,6 +242,10 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::domU inherits munin::plugins::base { + plugin { if_eth0: ensure => "if_" } +} + class munin::plugins::djbdns inherits munin::plugins::base { file { [ "$script_path_default/tinydns" ]: -- cgit v1.2.3 From 4bc3b1a7a481a382bd61b284b2ab3888904630bf Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 16:49:42 +0000 Subject: =?UTF-8?q?if=5Feth0=20f=C3=BCr=20domU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@639 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b8a28aa..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,6 +242,10 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::domU inherits munin::plugins::base { + plugin { if_eth0: ensure => "if_" } +} + class munin::plugins::djbdns inherits munin::plugins::base { file { [ "$script_path_default/tinydns" ]: -- cgit v1.2.3 From c2c7dce070856a2ab6da93b023088ba29062e869 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 16:49:42 +0000 Subject: =?UTF-8?q?if=5Feth0=20f=C3=BCr=20domU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b8a28aa..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -242,6 +242,10 @@ class munin::plugins::dom0 inherits munin::plugins::base { } } +class munin::plugins::domU inherits munin::plugins::base { + plugin { if_eth0: ensure => "if_" } +} + class munin::plugins::djbdns inherits munin::plugins::base { file { [ "$script_path_default/tinydns" ]: -- cgit v1.2.3 From e456a220e2830b34f96604ec7bf520293c1c7d38 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 17:15:30 +0000 Subject: facter class with new name, to debug git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@640 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- plugins/facter/interfaces.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..61cf4e2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb index a498d64..4bf10bc 100755 --- a/plugins/facter/interfaces.rb +++ b/plugins/facter/interfaces.rb @@ -1,5 +1,5 @@ # return the set of active interfaces as an array -Facter.add("interfaces") do +Facter.add("facterinterfaces") do setcode do `ip -o link show`.split(/\n/).collect do |line| value = nil -- cgit v1.2.3 From 132098aa8fa7c6ffb7630a1005e2c734b6069c76 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 17:15:30 +0000 Subject: facter class with new name, to debug git-svn-id: https://svn/ipuppet/trunk/modules/munin@640 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- plugins/facter/interfaces.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..61cf4e2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb index a498d64..4bf10bc 100755 --- a/plugins/facter/interfaces.rb +++ b/plugins/facter/interfaces.rb @@ -1,5 +1,5 @@ # return the set of active interfaces as an array -Facter.add("interfaces") do +Facter.add("facterinterfaces") do setcode do `ip -o link show`.split(/\n/).collect do |line| value = nil -- cgit v1.2.3 From 2363e5e52fe26ecd55a74629cfa10ce6bf95f271 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 17:15:30 +0000 Subject: facter class with new name, to debug --- manifests/plugin.pp | 4 ++-- plugins/facter/interfaces.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..61cf4e2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb index a498d64..4bf10bc 100755 --- a/plugins/facter/interfaces.rb +++ b/plugins/facter/interfaces.rb @@ -1,5 +1,5 @@ # return the set of active interfaces as an array -Facter.add("interfaces") do +Facter.add("facterinterfaces") do setcode do `ip -o link show`.split(/\n/).collect do |line| value = nil -- cgit v1.2.3 From 98308a8466a20ed23fa727ab1de8f511c427cd91 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 17:17:48 +0000 Subject: rename git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@641 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/facter/facterinterfaces.rb | 13 +++++++++++++ plugins/facter/interfaces.rb | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100755 plugins/facter/facterinterfaces.rb delete mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb new file mode 100755 index 0000000..4bf10bc --- /dev/null +++ b/plugins/facter/facterinterfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("facterinterfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/interfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end -- cgit v1.2.3 From fe4187be6078076fa34c8d272561554b8f205e8b Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 17:17:48 +0000 Subject: rename git-svn-id: https://svn/ipuppet/trunk/modules/munin@641 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/facter/facterinterfaces.rb | 13 +++++++++++++ plugins/facter/interfaces.rb | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100755 plugins/facter/facterinterfaces.rb delete mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb new file mode 100755 index 0000000..4bf10bc --- /dev/null +++ b/plugins/facter/facterinterfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("facterinterfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/interfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end -- cgit v1.2.3 From 29ad64d276057ecb74dc2b222de2cfeeaa7f3e4e Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 17:17:48 +0000 Subject: rename --- plugins/facter/facterinterfaces.rb | 13 +++++++++++++ plugins/facter/interfaces.rb | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100755 plugins/facter/facterinterfaces.rb delete mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb new file mode 100755 index 0000000..4bf10bc --- /dev/null +++ b/plugins/facter/facterinterfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("facterinterfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/interfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end -- cgit v1.2.3 From 149b7d81f7710421b41873c117e961fe3d724c71 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 18:05:28 +0000 Subject: reverted namechange git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@642 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/facter/facterinterfaces.rb | 13 ------------- plugins/facter/interfaces.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100755 plugins/facter/facterinterfaces.rb create mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/facterinterfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end -- cgit v1.2.3 From ded0ef9de27bda5ea6c722991054b47ed3b8fc13 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 18:05:28 +0000 Subject: reverted namechange git-svn-id: https://svn/ipuppet/trunk/modules/munin@642 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/facter/facterinterfaces.rb | 13 ------------- plugins/facter/interfaces.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100755 plugins/facter/facterinterfaces.rb create mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/facterinterfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end -- cgit v1.2.3 From f8d4920d6cb275ee3eedf4f4db9f00e6a64e2c99 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 18:05:28 +0000 Subject: reverted namechange --- plugins/facter/facterinterfaces.rb | 13 ------------- plugins/facter/interfaces.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100755 plugins/facter/facterinterfaces.rb create mode 100755 plugins/facter/interfaces.rb diff --git a/plugins/facter/facterinterfaces.rb b/plugins/facter/facterinterfaces.rb deleted file mode 100755 index 4bf10bc..0000000 --- a/plugins/facter/facterinterfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("facterinterfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/plugins/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end -- cgit v1.2.3 From 42ffd6da19977d825bd5f50064fd3a2700037a27 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 19:50:58 +0000 Subject: =?UTF-8?q?falsche=20umbenennung=20r=C3=BCckg=C3=A4ngig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@646 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 61cf4e2..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From 9e6ea5e5bb0033d7fd9647f76eaf2e206c384fb9 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 19:50:58 +0000 Subject: =?UTF-8?q?falsche=20umbenennung=20r=C3=BCckg=C3=A4ngig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@646 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 61cf4e2..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From b39e61aebc45a1419785c9b3d8a6e10306313a3d Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 19:50:58 +0000 Subject: =?UTF-8?q?falsche=20umbenennung=20r=C3=BCckg=C3=A4ngig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 61cf4e2..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,8 +155,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($facterinterfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($facterinterfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From 4587cac4c7800d1d0eff00bf890768eea9456d93 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:04:42 +0000 Subject: fixed servicemodules/munin/manifests/client.pp git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@648 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 1aa0e88..d20850a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -155,7 +155,7 @@ class munin::client::gentoo notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From 7700dacfbdd0d6366a5c05d5bb1a72844a55b8fd Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:04:42 +0000 Subject: fixed servicemodules/munin/manifests/client.pp git-svn-id: https://svn/ipuppet/trunk/modules/munin@648 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 1aa0e88..d20850a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -155,7 +155,7 @@ class munin::client::gentoo notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From 2be6a1adaea42c80126f8c55069f7283198fbbc5 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:04:42 +0000 Subject: fixed servicemodules/munin/manifests/client.pp --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 1aa0e88..d20850a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -155,7 +155,7 @@ class munin::client::gentoo notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From ba1207644ab0a4dd5e4eaefbb23cd183c3447374 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:06:20 +0000 Subject: munin-node service git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@649 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index d20850a..c2a59e4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -165,7 +165,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin-node': + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From c53532f9bc5a360522a067b14ef81de66add9d17 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:06:20 +0000 Subject: munin-node service git-svn-id: https://svn/ipuppet/trunk/modules/munin@649 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index d20850a..c2a59e4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -165,7 +165,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin-node': + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From e7d5725e20ffdb20718c7e68dd9e39c7d987675f Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 20:06:20 +0000 Subject: munin-node service --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index d20850a..c2a59e4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -165,7 +165,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin-node': + package { 'munin': ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From b76ba1485dab12b8cb09f5ed476a911e2ea73c30 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:13:15 +0000 Subject: fixed service git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@651 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index c2a59e4..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,7 +152,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From fd721045a7d529f3b9fbc796c58e26177b89ad65 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:13:15 +0000 Subject: fixed service git-svn-id: https://svn/ipuppet/trunk/modules/munin@651 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index c2a59e4..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,7 +152,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From 77212a2b8c764900b0ba5b167fb450ea6ecf3b96 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:13:15 +0000 Subject: fixed service --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index c2a59e4..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,7 +152,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From 66be244097a1b05db19fa2cac40de91703dc9376 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:16:54 +0000 Subject: chaos-a... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@652 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..56742cb 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From b2bbba673547959692b51f783b71959a17dce7dd Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:16:54 +0000 Subject: chaos-a... git-svn-id: https://svn/ipuppet/trunk/modules/munin@652 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..56742cb 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From 8e637082f8bfb8430a0f1e4b11627646c8291453 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 20:16:54 +0000 Subject: chaos-a... --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..56742cb 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From a9c98c99b3e1795ba8838023342676c25a9789ef Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:18:05 +0000 Subject: doch munin-node git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@653 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 56742cb..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From b929f469342c6c61ff29bb9f5f4271ab80d5d5fe Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 20:18:05 +0000 Subject: doch munin-node git-svn-id: https://svn/ipuppet/trunk/modules/munin@653 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 56742cb..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From 93ea9fb239a35098a10d95c191cafc84e1dc9769 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 20:18:05 +0000 Subject: doch munin-node --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 56742cb..bc47a23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -187,7 +187,7 @@ class munin::client::centos notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } -- cgit v1.2.3 From 68e6d8ba0323faa7b1b48d3755a1275cc68ba030 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:48:53 +0000 Subject: fixed service git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@654 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..69d4624 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" + $munin_node_service = "munin-node" + #$munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From d5c7b0ba7a8f3e7bdac373f58e077fa9e4a9a26b Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:48:53 +0000 Subject: fixed service git-svn-id: https://svn/ipuppet/trunk/modules/munin@654 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..69d4624 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" + $munin_node_service = "munin-node" + #$munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From 87503595260b3329b953a78f1d8f56bf3295fcb0 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 20:48:53 +0000 Subject: fixed service --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..69d4624 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" + $munin_node_service = "munin-node" + #$munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From ed175c22c0b18a19fea9da59e84253ce47a61fb8 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:14:36 +0000 Subject: gentoo auf munin, versuch symlink git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@655 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..af2c523 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,10 +152,10 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin-node"], + notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From 26e8702b15a37a5e22c070cbd6dd0105355b0d45 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:14:36 +0000 Subject: gentoo auf munin, versuch symlink git-svn-id: https://svn/ipuppet/trunk/modules/munin@655 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..af2c523 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,10 +152,10 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin-node"], + notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From 75b7cf781e33d78a890e0717d4c052835a804f2c Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 22:14:36 +0000 Subject: gentoo auf munin, versuch symlink --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index bc47a23..af2c523 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -152,10 +152,10 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin-node"], + notify => Service["munin"], } - service { "munin-node": + service { "munin": ensure => running, } -- cgit v1.2.3 From b15037286e26b8e7a7a295d5030fdcc8e8fa6cd2 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:19:05 +0000 Subject: kein notify? git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@656 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index af2c523..3c2814b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -141,6 +141,13 @@ class munin::client::gentoo }, } + # link + file{ + "/etc/init.d/munin": + ensure => "/etc/init.d/munin-node", + } + + file { "/etc/munin/": @@ -152,7 +159,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + # notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From 562c898ab81bc9ee19548f9b4601d39773b516e1 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:19:05 +0000 Subject: kein notify? git-svn-id: https://svn/ipuppet/trunk/modules/munin@656 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index af2c523..3c2814b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -141,6 +141,13 @@ class munin::client::gentoo }, } + # link + file{ + "/etc/init.d/munin": + ensure => "/etc/init.d/munin-node", + } + + file { "/etc/munin/": @@ -152,7 +159,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + # notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From ffadb6ba14efabe3eeae1decaef7034d4dbd03e3 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 22:19:05 +0000 Subject: kein notify? --- manifests/client.pp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index af2c523..3c2814b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -141,6 +141,13 @@ class munin::client::gentoo }, } + # link + file{ + "/etc/init.d/munin": + ensure => "/etc/init.d/munin-node", + } + + file { "/etc/munin/": @@ -152,7 +159,7 @@ class munin::client::gentoo # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin"], - notify => Service["munin"], + # notify => Service["munin"], } service { "munin": -- cgit v1.2.3 From a8f2d70e08ae3f829cc8cbcc9ea8f013aaac7b81 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:28:48 +0000 Subject: noch mehr auf munin stellen, nicht munin-node git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@657 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 69d4624..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - $munin_node_service = "munin-node" - #$munin_node_service = "munin" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From 91776eeb6e976f0063581dbb558f60ebfa13d63a Mon Sep 17 00:00:00 2001 From: am Date: Thu, 31 Jan 2008 22:28:48 +0000 Subject: noch mehr auf munin stellen, nicht munin-node git-svn-id: https://svn/ipuppet/trunk/modules/munin@657 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 69d4624..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - $munin_node_service = "munin-node" - #$munin_node_service = "munin" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From 7f259713d996929155d3c8bcf7d1411eba86e0e8 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 31 Jan 2008 22:28:48 +0000 Subject: noch mehr auf munin stellen, nicht munin-node --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 69d4624..535d76d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -17,8 +17,8 @@ define munin::plugin ( $munin_node_package = "munin-node" } gentoo: { - $munin_node_service = "munin-node" - #$munin_node_service = "munin" + #$munin_node_service = "munin-node" + $munin_node_service = "munin" $munin_node_package = "munin" } default: { -- cgit v1.2.3 From 4eb04b7906f4ab46160ddb0e89f487ba636990d3 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 23:25:21 +0000 Subject: really needed? git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@659 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 3c2814b..4e89f12 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -142,10 +142,11 @@ class munin::client::gentoo } # link - file{ - "/etc/init.d/munin": - ensure => "/etc/init.d/munin-node", - } + # mh: really needed? +# file{ +# "/etc/init.d/munin": +# ensure => "/etc/init.d/munin-node", +# } -- cgit v1.2.3 From 24a5855d19e604e2d1cd23270d6d2514a2839ee0 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 23:25:21 +0000 Subject: really needed? git-svn-id: https://svn/ipuppet/trunk/modules/munin@659 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 3c2814b..4e89f12 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -142,10 +142,11 @@ class munin::client::gentoo } # link - file{ - "/etc/init.d/munin": - ensure => "/etc/init.d/munin-node", - } + # mh: really needed? +# file{ +# "/etc/init.d/munin": +# ensure => "/etc/init.d/munin-node", +# } -- cgit v1.2.3 From 656639fc8a08519013b873a0146bddb472ec8abd Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 31 Jan 2008 23:25:21 +0000 Subject: really needed? --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 3c2814b..4e89f12 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -142,10 +142,11 @@ class munin::client::gentoo } # link - file{ - "/etc/init.d/munin": - ensure => "/etc/init.d/munin-node", - } + # mh: really needed? +# file{ +# "/etc/init.d/munin": +# ensure => "/etc/init.d/munin-node", +# } -- cgit v1.2.3 From 85c9964402016623ed48b66716ce8ece9753df56 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 11:46:02 +0000 Subject: =?UTF-8?q?neuer=20versuch=20mit=20munin=20f=C3=BCr=20immer1-5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@662 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/pg__connections | 142 ++++++++++++++++++++++++++++++++++++++++++ files/plugins/pg__locks | 119 +++++++++++++++++++++++++++++++++++ files/plugins/pg_conn | 51 +++++++++++++++ manifests/plugin.pp | 16 +++++ 4 files changed, 328 insertions(+) create mode 100755 files/plugins/pg__connections create mode 100755 files/plugins/pg__locks create mode 100755 files/plugins/pg_conn diff --git a/files/plugins/pg__connections b/files/plugins/pg__connections new file mode 100755 index 0000000..ca95f56 --- /dev/null +++ b/files/plugins/pg__connections @@ -0,0 +1,142 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__connections \ +# /etc/munin/plugins/pg__connections +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbuserx = $ENV{'dbuserx'} || ''; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + print "requires DBD::Pg\n"; + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + my $sql_max = "SHOW max_connections;"; + my $sth_max = $dbh->prepare($sql_max); + $sth_max->execute(); + my ($max_connections) = $sth_max->fetchrow(); + my $warning = int ($max_connections * 0.7); + my $critical = int ($max_connections * 0.8); + print "graph_title PostgresSQL active connections\n"; + print "graph_args -l 0 --base 1000\n"; + print "graph_vlabel Connections\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows active Postgresql connections from $dbname\n"; + + + my $sql = "select datname, count(*) from pg_stat_activity group by datname"; + my $sth = $dbh->prepare($sql); + $sth->execute(); + my $setarea = "yes"; + while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.label $datname active connections\n"; + print "$datname.info $datname active connections\n"; + print "$datname.type GAUGE\n"; + if ($setarea eq "yes") { + print "$datname.draw AREA\n"; + $setarea=""; + } else { + print "$datname.draw STACK\n"; + } + } + + print "max_connections.label Max. connections\n"; + print "max_connections.info Max. connections\n"; + print "max_connections.type GAUGE\n"; + + print "warning $warning\n"; + print "critical $critical\n"; + exit 0; + } +} + + +# select datname, count(*) from pg_stat_activity group by datname +my $sql_max = "SHOW max_connections;"; +my $sth_max = $dbh->prepare($sql_max); +$sth_max->execute(); +my ($max_connections) = $sth_max->fetchrow(); + +#my $sql = "SELECT COUNT (*) FROM pg_stat_activity;"; +my $sql = "select datname, count(*) from pg_stat_activity group by datname"; +my $sth = $dbh->prepare($sql); +$sth->execute(); +while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.value $curr_conn\n"; +} +print "max_connections.value $max_connections\n"; diff --git a/files/plugins/pg__locks b/files/plugins/pg__locks new file mode 100755 index 0000000..33a9a8a --- /dev/null +++ b/files/plugins/pg__locks @@ -0,0 +1,119 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__locks \ +# /etc/munin/plugins/pg__locks +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/8.1/interactive/monitoring-locks.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + print "graph_title PostgresSQL locks\n"; + print "graph_args --base 1000\n"; + print "graph_vlabel Locks\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows Postgresql locks\n"; + print "locks.label Locks\n"; + print "locks.info Locks (more info here, please... :)\n"; + print "locks.type GAUGE\n"; + print "locks.warning 5\n"; + print "locks.critical 10\n"; + print "exlocks.label Exclusive locks\n"; + print "exlocks.info Exclusive locks (here too, please... :)\n"; + print "exlocks.type GAUGE\n"; + print "exlocks.warning 5\n"; + print "exlocks.critical 10\n"; + exit 0; + } +} + +my $sql="SELECT mode,COUNT(mode) FROM pg_locks GROUP BY mode ORDER BY mode;"; +my $sth = $dbh->prepare ($sql); +$sth->execute (); +my $locks = 0; +my $exlocks = 0; +while (my ($mode, $count) = $sth->fetchrow ()) { + if ($mode =~ /exclusive/i) { + $exlocks = $exlocks + $count; + } + $locks = $locks+$count; +} +print "locks.value $locks\n"; +print "exlocks.value $exlocks\n"; + diff --git a/files/plugins/pg_conn b/files/plugins/pg_conn new file mode 100755 index 0000000..aa2ebb7 --- /dev/null +++ b/files/plugins/pg_conn @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Plugin to monitor PostgreSQL connections. +# +# Parameters: +# +# config (required) +# autoconf (optional - only used by munin-config) +# Based on netstat plugin +# $Log$ +# eric@ohmforce.com +# +# +# Magic markers (optional - used by munin-config and some installation +# scripts): +#%# family=auto +#%# capabilities=autoconf + + + +if [ "$1" = "autoconf" ]; then + if ( netstat -s 2>/dev/null >/dev/null ); then + echo yes + exit 0 + else + if [ $? -eq 127 ] + then + echo "no (netstat program not found)" + exit 1 + else + echo no + exit 1 + fi + fi +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title PostgreSQL' + echo 'graph_args -l 0 ' + echo 'graph_vlabel Number of PostgreSQL connections' + echo 'graph_category postgresql' + echo 'graph_period second' + echo 'graph_info This graph shows the number of opened connections on PostgreSQL.' + echo 'established.label established' + echo 'established.type GAUGE' + echo 'established.max 500' + echo 'established.info The number of currently open connections.' + exit 0 +fi +netstat -a | awk '{ print $4 }'| grep postgres | wc -l | xargs echo established.value diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..df31fe2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -259,3 +259,19 @@ class munin::plugins::djbdns inherits munin::plugins::base { } } +class munin::plugins::postgres inherits munin::plugins::base { + file { + [ "$script_path_default/pg_conn" ]: + source => "puppet://$servername/munin/plugins/pg_conn", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__connections" ]: + source => "puppet://$servername/munin/plugins/pg__connections", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__locks" ]: + source => "puppet://$servername/munin/plugins/pg__locks", + ensure => file, + mode => 0755, owner => root, group => 0; + } +} -- cgit v1.2.3 From bad976aee83677afeccdd9750fe791e7665fbfbd Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 11:46:02 +0000 Subject: =?UTF-8?q?neuer=20versuch=20mit=20munin=20f=C3=BCr=20immer1-5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@662 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/pg__connections | 142 ++++++++++++++++++++++++++++++++++++++++++ files/plugins/pg__locks | 119 +++++++++++++++++++++++++++++++++++ files/plugins/pg_conn | 51 +++++++++++++++ manifests/plugin.pp | 16 +++++ 4 files changed, 328 insertions(+) create mode 100755 files/plugins/pg__connections create mode 100755 files/plugins/pg__locks create mode 100755 files/plugins/pg_conn diff --git a/files/plugins/pg__connections b/files/plugins/pg__connections new file mode 100755 index 0000000..ca95f56 --- /dev/null +++ b/files/plugins/pg__connections @@ -0,0 +1,142 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__connections \ +# /etc/munin/plugins/pg__connections +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbuserx = $ENV{'dbuserx'} || ''; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + print "requires DBD::Pg\n"; + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + my $sql_max = "SHOW max_connections;"; + my $sth_max = $dbh->prepare($sql_max); + $sth_max->execute(); + my ($max_connections) = $sth_max->fetchrow(); + my $warning = int ($max_connections * 0.7); + my $critical = int ($max_connections * 0.8); + print "graph_title PostgresSQL active connections\n"; + print "graph_args -l 0 --base 1000\n"; + print "graph_vlabel Connections\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows active Postgresql connections from $dbname\n"; + + + my $sql = "select datname, count(*) from pg_stat_activity group by datname"; + my $sth = $dbh->prepare($sql); + $sth->execute(); + my $setarea = "yes"; + while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.label $datname active connections\n"; + print "$datname.info $datname active connections\n"; + print "$datname.type GAUGE\n"; + if ($setarea eq "yes") { + print "$datname.draw AREA\n"; + $setarea=""; + } else { + print "$datname.draw STACK\n"; + } + } + + print "max_connections.label Max. connections\n"; + print "max_connections.info Max. connections\n"; + print "max_connections.type GAUGE\n"; + + print "warning $warning\n"; + print "critical $critical\n"; + exit 0; + } +} + + +# select datname, count(*) from pg_stat_activity group by datname +my $sql_max = "SHOW max_connections;"; +my $sth_max = $dbh->prepare($sql_max); +$sth_max->execute(); +my ($max_connections) = $sth_max->fetchrow(); + +#my $sql = "SELECT COUNT (*) FROM pg_stat_activity;"; +my $sql = "select datname, count(*) from pg_stat_activity group by datname"; +my $sth = $dbh->prepare($sql); +$sth->execute(); +while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.value $curr_conn\n"; +} +print "max_connections.value $max_connections\n"; diff --git a/files/plugins/pg__locks b/files/plugins/pg__locks new file mode 100755 index 0000000..33a9a8a --- /dev/null +++ b/files/plugins/pg__locks @@ -0,0 +1,119 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__locks \ +# /etc/munin/plugins/pg__locks +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/8.1/interactive/monitoring-locks.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + print "graph_title PostgresSQL locks\n"; + print "graph_args --base 1000\n"; + print "graph_vlabel Locks\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows Postgresql locks\n"; + print "locks.label Locks\n"; + print "locks.info Locks (more info here, please... :)\n"; + print "locks.type GAUGE\n"; + print "locks.warning 5\n"; + print "locks.critical 10\n"; + print "exlocks.label Exclusive locks\n"; + print "exlocks.info Exclusive locks (here too, please... :)\n"; + print "exlocks.type GAUGE\n"; + print "exlocks.warning 5\n"; + print "exlocks.critical 10\n"; + exit 0; + } +} + +my $sql="SELECT mode,COUNT(mode) FROM pg_locks GROUP BY mode ORDER BY mode;"; +my $sth = $dbh->prepare ($sql); +$sth->execute (); +my $locks = 0; +my $exlocks = 0; +while (my ($mode, $count) = $sth->fetchrow ()) { + if ($mode =~ /exclusive/i) { + $exlocks = $exlocks + $count; + } + $locks = $locks+$count; +} +print "locks.value $locks\n"; +print "exlocks.value $exlocks\n"; + diff --git a/files/plugins/pg_conn b/files/plugins/pg_conn new file mode 100755 index 0000000..aa2ebb7 --- /dev/null +++ b/files/plugins/pg_conn @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Plugin to monitor PostgreSQL connections. +# +# Parameters: +# +# config (required) +# autoconf (optional - only used by munin-config) +# Based on netstat plugin +# $Log$ +# eric@ohmforce.com +# +# +# Magic markers (optional - used by munin-config and some installation +# scripts): +#%# family=auto +#%# capabilities=autoconf + + + +if [ "$1" = "autoconf" ]; then + if ( netstat -s 2>/dev/null >/dev/null ); then + echo yes + exit 0 + else + if [ $? -eq 127 ] + then + echo "no (netstat program not found)" + exit 1 + else + echo no + exit 1 + fi + fi +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title PostgreSQL' + echo 'graph_args -l 0 ' + echo 'graph_vlabel Number of PostgreSQL connections' + echo 'graph_category postgresql' + echo 'graph_period second' + echo 'graph_info This graph shows the number of opened connections on PostgreSQL.' + echo 'established.label established' + echo 'established.type GAUGE' + echo 'established.max 500' + echo 'established.info The number of currently open connections.' + exit 0 +fi +netstat -a | awk '{ print $4 }'| grep postgres | wc -l | xargs echo established.value diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..df31fe2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -259,3 +259,19 @@ class munin::plugins::djbdns inherits munin::plugins::base { } } +class munin::plugins::postgres inherits munin::plugins::base { + file { + [ "$script_path_default/pg_conn" ]: + source => "puppet://$servername/munin/plugins/pg_conn", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__connections" ]: + source => "puppet://$servername/munin/plugins/pg__connections", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__locks" ]: + source => "puppet://$servername/munin/plugins/pg__locks", + ensure => file, + mode => 0755, owner => root, group => 0; + } +} -- cgit v1.2.3 From b4fd40ac48b7a67dd35e3a1e079c1ad38ddcb105 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 11:46:02 +0000 Subject: =?UTF-8?q?neuer=20versuch=20mit=20munin=20f=C3=BCr=20immer1-5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/plugins/pg__connections | 142 ++++++++++++++++++++++++++++++++++++++++++ files/plugins/pg__locks | 119 +++++++++++++++++++++++++++++++++++ files/plugins/pg_conn | 51 +++++++++++++++ manifests/plugin.pp | 16 +++++ 4 files changed, 328 insertions(+) create mode 100755 files/plugins/pg__connections create mode 100755 files/plugins/pg__locks create mode 100755 files/plugins/pg_conn diff --git a/files/plugins/pg__connections b/files/plugins/pg__connections new file mode 100755 index 0000000..ca95f56 --- /dev/null +++ b/files/plugins/pg__connections @@ -0,0 +1,142 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__connections \ +# /etc/munin/plugins/pg__connections +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbuserx = $ENV{'dbuserx'} || ''; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + print "requires DBD::Pg\n"; + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + my $sql_max = "SHOW max_connections;"; + my $sth_max = $dbh->prepare($sql_max); + $sth_max->execute(); + my ($max_connections) = $sth_max->fetchrow(); + my $warning = int ($max_connections * 0.7); + my $critical = int ($max_connections * 0.8); + print "graph_title PostgresSQL active connections\n"; + print "graph_args -l 0 --base 1000\n"; + print "graph_vlabel Connections\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows active Postgresql connections from $dbname\n"; + + + my $sql = "select datname, count(*) from pg_stat_activity group by datname"; + my $sth = $dbh->prepare($sql); + $sth->execute(); + my $setarea = "yes"; + while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.label $datname active connections\n"; + print "$datname.info $datname active connections\n"; + print "$datname.type GAUGE\n"; + if ($setarea eq "yes") { + print "$datname.draw AREA\n"; + $setarea=""; + } else { + print "$datname.draw STACK\n"; + } + } + + print "max_connections.label Max. connections\n"; + print "max_connections.info Max. connections\n"; + print "max_connections.type GAUGE\n"; + + print "warning $warning\n"; + print "critical $critical\n"; + exit 0; + } +} + + +# select datname, count(*) from pg_stat_activity group by datname +my $sql_max = "SHOW max_connections;"; +my $sth_max = $dbh->prepare($sql_max); +$sth_max->execute(); +my ($max_connections) = $sth_max->fetchrow(); + +#my $sql = "SELECT COUNT (*) FROM pg_stat_activity;"; +my $sql = "select datname, count(*) from pg_stat_activity group by datname"; +my $sth = $dbh->prepare($sql); +$sth->execute(); +while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { + print "$datname.value $curr_conn\n"; +} +print "max_connections.value $max_connections\n"; diff --git a/files/plugins/pg__locks b/files/plugins/pg__locks new file mode 100755 index 0000000..33a9a8a --- /dev/null +++ b/files/plugins/pg__locks @@ -0,0 +1,119 @@ +#!/usr/bin/perl -w +# Plugin for monitor postgres connections. +# +# Licenced under GPL v2. +# +# Usage: +# +# Symlink into /etc/munin/plugins/ and add the monitored +# database to the filename. e.g.: +# +# ln -s /usr/share/munin/plugins/pg__locks \ +# /etc/munin/plugins/pg__locks +# This should, however, be given through autoconf and suggest. +# +# If required, give username, password and/or Postgresql server +# host through environment variables. +# +# You must also activate Postgresql statistics. See +# http://www.postgresql.org/docs/8.1/interactive/monitoring-locks.html +# for how to enable this. Specifically, the following lines must +# exist in your postgresql.conf: +# +# stats_start_collector = true +# stats_block_level = true +# +# +# Parameters: +# +# config (required) +# +# Config variables: +# +# dbhost - Which database server to use. Defaults to +# 'localhost'. +# dbname - Which database to use. Defaults to template1 +# dbuser - A Postgresql user account with read permission to +# the given database. Defaults to +# 'postgres'. Anyway, Munin must be told which user +# this plugin should be run as. +# dbpass - The corresponding password, if +# applicable. Default to undef. Remember that +# pg_hba.conf must be configured accordingly. +# +# Magic markers +#%# family=auto +#%# capabilities=autoconf + +use strict; +use DBI; + +my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; +my $dbname = $ENV{'dbname'} || 'template1'; +my $dbuser = $ENV{'dbuser'} || 'postgres'; +my $dbport = $ENV{'dbport'} || '5432'; +my $dbpass = $ENV{'dbpass'} || ''; + +# Check for DBD::Pg +if (! eval "require DBD::Pg;") { + exit 1; +} + +my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; +#print "$dsn\n"; +my $dbh = DBI->connect ($dsn, $dbuser, + $dbpass, + {RaiseError =>1}) || die ""; + + + +if (exists $ARGV[0]) { + if ($ARGV[0] eq 'autoconf') { + # Check for DBD::Pg + if (! eval "require DBD::Pg;") { + print "no (DBD::Pg not found)"; + exit 1; + } + if ($dbh) { + print "yes\n"; + exit 0; + } else { + print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; + exit 1; + } + } + + if ($ARGV[0] eq "config") { + print "graph_title PostgresSQL locks\n"; + print "graph_args --base 1000\n"; + print "graph_vlabel Locks\n"; + print "graph_category Postgresql\n"; + print "graph_info Shows Postgresql locks\n"; + print "locks.label Locks\n"; + print "locks.info Locks (more info here, please... :)\n"; + print "locks.type GAUGE\n"; + print "locks.warning 5\n"; + print "locks.critical 10\n"; + print "exlocks.label Exclusive locks\n"; + print "exlocks.info Exclusive locks (here too, please... :)\n"; + print "exlocks.type GAUGE\n"; + print "exlocks.warning 5\n"; + print "exlocks.critical 10\n"; + exit 0; + } +} + +my $sql="SELECT mode,COUNT(mode) FROM pg_locks GROUP BY mode ORDER BY mode;"; +my $sth = $dbh->prepare ($sql); +$sth->execute (); +my $locks = 0; +my $exlocks = 0; +while (my ($mode, $count) = $sth->fetchrow ()) { + if ($mode =~ /exclusive/i) { + $exlocks = $exlocks + $count; + } + $locks = $locks+$count; +} +print "locks.value $locks\n"; +print "exlocks.value $exlocks\n"; + diff --git a/files/plugins/pg_conn b/files/plugins/pg_conn new file mode 100755 index 0000000..aa2ebb7 --- /dev/null +++ b/files/plugins/pg_conn @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Plugin to monitor PostgreSQL connections. +# +# Parameters: +# +# config (required) +# autoconf (optional - only used by munin-config) +# Based on netstat plugin +# $Log$ +# eric@ohmforce.com +# +# +# Magic markers (optional - used by munin-config and some installation +# scripts): +#%# family=auto +#%# capabilities=autoconf + + + +if [ "$1" = "autoconf" ]; then + if ( netstat -s 2>/dev/null >/dev/null ); then + echo yes + exit 0 + else + if [ $? -eq 127 ] + then + echo "no (netstat program not found)" + exit 1 + else + echo no + exit 1 + fi + fi +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title PostgreSQL' + echo 'graph_args -l 0 ' + echo 'graph_vlabel Number of PostgreSQL connections' + echo 'graph_category postgresql' + echo 'graph_period second' + echo 'graph_info This graph shows the number of opened connections on PostgreSQL.' + echo 'established.label established' + echo 'established.type GAUGE' + echo 'established.max 500' + echo 'established.info The number of currently open connections.' + exit 0 +fi +netstat -a | awk '{ print $4 }'| grep postgres | wc -l | xargs echo established.value diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 535d76d..df31fe2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -259,3 +259,19 @@ class munin::plugins::djbdns inherits munin::plugins::base { } } +class munin::plugins::postgres inherits munin::plugins::base { + file { + [ "$script_path_default/pg_conn" ]: + source => "puppet://$servername/munin/plugins/pg_conn", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__connections" ]: + source => "puppet://$servername/munin/plugins/pg__connections", + ensure => file, + mode => 0755, owner => root, group => 0; + [ "$script_path_default/pg__locks" ]: + source => "puppet://$servername/munin/plugins/pg__locks", + ensure => file, + mode => 0755, owner => root, group => 0; + } +} -- cgit v1.2.3 From 3394d7e1073f6c65953c8ba62a04482e08b631a6 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:01:02 +0000 Subject: versuch mit einer function git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@673 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb new file mode 100644 index 0000000..27f96f4 --- /dev/null +++ b/plugins/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From b7c178614bce6fb848f775b95d1ace6418eca4ad Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:01:02 +0000 Subject: versuch mit einer function git-svn-id: https://svn/ipuppet/trunk/modules/munin@673 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb new file mode 100644 index 0000000..27f96f4 --- /dev/null +++ b/plugins/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From 7a06b89833eaba82f63c28d15e4efe71a17cafe5 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:01:02 +0000 Subject: versuch mit einer function --- plugins/parser/functions/muninport.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb new file mode 100644 index 0000000..27f96f4 --- /dev/null +++ b/plugins/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From 177389ef15c6b96014ee86e4b362579c59c3535b Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:05:17 +0000 Subject: +rvalue git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@674 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb index 27f96f4..d0b5909 100644 --- a/plugins/parser/functions/muninport.rb +++ b/plugins/parser/functions/muninport.rb @@ -1,6 +1,6 @@ # immerda module Puppet::Parser::Functions - newfunction(:muninport) do |args| + newfunction(:muninport, :type => :rvalue) do |args| args[0]+65400 end end -- cgit v1.2.3 From 4e3bd787f5cf56ed6bba54910cffcfff5c6f4ef3 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:05:17 +0000 Subject: +rvalue git-svn-id: https://svn/ipuppet/trunk/modules/munin@674 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb index 27f96f4..d0b5909 100644 --- a/plugins/parser/functions/muninport.rb +++ b/plugins/parser/functions/muninport.rb @@ -1,6 +1,6 @@ # immerda module Puppet::Parser::Functions - newfunction(:muninport) do |args| + newfunction(:muninport, :type => :rvalue) do |args| args[0]+65400 end end -- cgit v1.2.3 From 8003e0fc6b32f53d7f5860ebc94f4ad2feac9d2e Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:05:17 +0000 Subject: +rvalue --- plugins/parser/functions/muninport.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb index 27f96f4..d0b5909 100644 --- a/plugins/parser/functions/muninport.rb +++ b/plugins/parser/functions/muninport.rb @@ -1,6 +1,6 @@ # immerda module Puppet::Parser::Functions - newfunction(:muninport) do |args| + newfunction(:muninport, :type => :rvalue) do |args| args[0]+65400 end end -- cgit v1.2.3 From 8a9028f2b03f0d1890c4161e6862dd53eab9dd8c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:11:17 +0000 Subject: mv git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@675 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 7 ------- plugins/puppet/parser/functions/muninport.rb | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 plugins/parser/functions/muninport.rb create mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb new file mode 100644 index 0000000..d0b5909 --- /dev/null +++ b/plugins/puppet/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport, :type => :rvalue) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From f99fa21bdf280930ddd0ef8304d06b77a785a1b4 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:11:17 +0000 Subject: mv git-svn-id: https://svn/ipuppet/trunk/modules/munin@675 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- plugins/parser/functions/muninport.rb | 7 ------- plugins/puppet/parser/functions/muninport.rb | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 plugins/parser/functions/muninport.rb create mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb new file mode 100644 index 0000000..d0b5909 --- /dev/null +++ b/plugins/puppet/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport, :type => :rvalue) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From 7562bd4fc36b6a7671095c9e279e4b2fcf41aaa2 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:11:17 +0000 Subject: mv --- plugins/parser/functions/muninport.rb | 7 ------- plugins/puppet/parser/functions/muninport.rb | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 plugins/parser/functions/muninport.rb create mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/plugins/parser/functions/muninport.rb b/plugins/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb new file mode 100644 index 0000000..d0b5909 --- /dev/null +++ b/plugins/puppet/parser/functions/muninport.rb @@ -0,0 +1,7 @@ +# immerda +module Puppet::Parser::Functions + newfunction(:muninport, :type => :rvalue) do |args| + args[0]+65400 + end +end + -- cgit v1.2.3 From 8429ac62dc90820471acf5b92f4d3071aa4d4c93 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:25:50 +0000 Subject: test in modul git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@676 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 4e89f12..f334756 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,3 +203,11 @@ class munin::client::centos } +define munin::client::immer1-5($domU_number = '0') { + $munin_port = $domU_number ? { + '4949' => 4949, + default => muninport($domU_number); + } + + include munin::client +} -- cgit v1.2.3 From db0ab2b74a969303bd5adb678e24c1e7bebb64c7 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:25:50 +0000 Subject: test in modul git-svn-id: https://svn/ipuppet/trunk/modules/munin@676 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 4e89f12..f334756 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,3 +203,11 @@ class munin::client::centos } +define munin::client::immer1-5($domU_number = '0') { + $munin_port = $domU_number ? { + '4949' => 4949, + default => muninport($domU_number); + } + + include munin::client +} -- cgit v1.2.3 From b5c0d56b42604771808b90397a84619f31240261 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:25:50 +0000 Subject: test in modul --- manifests/client.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 4e89f12..f334756 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,3 +203,11 @@ class munin::client::centos } +define munin::client::immer1-5($domU_number = '0') { + $munin_port = $domU_number ? { + '4949' => 4949, + default => muninport($domU_number); + } + + include munin::client +} -- cgit v1.2.3 From dc68262d7f7319962a13a6dff9da2e625b94f997 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:28:32 +0000 Subject: fehler? git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@677 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index f334756..341aeaa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immer1-5($domU_number = '0') { +define munin::client::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); -- cgit v1.2.3 From dda34c92a218f2f77a2904a868c573e766898d37 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:28:32 +0000 Subject: fehler? git-svn-id: https://svn/ipuppet/trunk/modules/munin@677 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index f334756..341aeaa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immer1-5($domU_number = '0') { +define munin::client::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); -- cgit v1.2.3 From bb494884dff041662ee188f19d4969ea2d38e7d0 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:28:32 +0000 Subject: fehler? --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index f334756..341aeaa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immer1-5($domU_number = '0') { +define munin::client::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); -- cgit v1.2.3 From fea64565336669b771360e94f7722477a3d62300 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:32:06 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@678 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 341aeaa..e0cf17b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immertest($domU_number = '0') { +define munin::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); @@ -211,3 +211,4 @@ define munin::client::immertest($domU_number = '0') { include munin::client } + -- cgit v1.2.3 From 775a5fb9185abb040659cea5bb4c3490633ae888 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:32:06 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@678 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 341aeaa..e0cf17b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immertest($domU_number = '0') { +define munin::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); @@ -211,3 +211,4 @@ define munin::client::immertest($domU_number = '0') { include munin::client } + -- cgit v1.2.3 From b685b11ba32d98ce7e2e56b7902e5aa3f93c3c5a Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:32:06 +0000 Subject: test --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 341aeaa..e0cf17b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,7 +203,7 @@ class munin::client::centos } -define munin::client::immertest($domU_number = '0') { +define munin::immertest($domU_number = '0') { $munin_port = $domU_number ? { '4949' => 4949, default => muninport($domU_number); @@ -211,3 +211,4 @@ define munin::client::immertest($domU_number = '0') { include munin::client } + -- cgit v1.2.3 From e4bc658617122a2fe00dea7fbdd77d4f9541f138 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:43:48 +0000 Subject: case... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@679 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index e0cf17b..510945d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,12 +203,4 @@ class munin::client::centos } -define munin::immertest($domU_number = '0') { - $munin_port = $domU_number ? { - '4949' => 4949, - default => muninport($domU_number); - } - - include munin::client -} -- cgit v1.2.3 From a9a318e0c451bbddeaaac135ac4317bb01599bc4 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 14:43:48 +0000 Subject: case... git-svn-id: https://svn/ipuppet/trunk/modules/munin@679 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index e0cf17b..510945d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,12 +203,4 @@ class munin::client::centos } -define munin::immertest($domU_number = '0') { - $munin_port = $domU_number ? { - '4949' => 4949, - default => muninport($domU_number); - } - - include munin::client -} -- cgit v1.2.3 From e850327283865f00748f241247e7e196ff653ada Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 14:43:48 +0000 Subject: case... --- manifests/client.pp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index e0cf17b..510945d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -203,12 +203,4 @@ class munin::client::centos } -define munin::immertest($domU_number = '0') { - $munin_port = $domU_number ? { - '4949' => 4949, - default => muninport($domU_number); - } - - include munin::client -} -- cgit v1.2.3 From 7327f05bc389178aa18351d9aa6016420ea87aa3 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:15:24 +0000 Subject: munin script_path nur in plugins-gebraucht git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@684 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index df31fe2..d9b944c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path = $script_path_default, + $script_path = '/usr/libexec/munin/plugins', $config = '') { case $operatingsystem { @@ -20,6 +20,7 @@ define munin::plugin ( #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" + $script_path = $script_path_default, } default: { $munin_node_service = "munin-node" @@ -102,18 +103,22 @@ class munin::plugins::base { gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } } case $operatingsystem { @@ -145,11 +150,6 @@ class munin::plugins::base { } } } - - case $operatingsystem { - gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } - default: { $script_path_default = "/usr/share/munin/plugins" } - } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 315495b18f4c5e1a2ced06e603a1617e5867b41a Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:15:24 +0000 Subject: munin script_path nur in plugins-gebraucht git-svn-id: https://svn/ipuppet/trunk/modules/munin@684 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index df31fe2..d9b944c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path = $script_path_default, + $script_path = '/usr/libexec/munin/plugins', $config = '') { case $operatingsystem { @@ -20,6 +20,7 @@ define munin::plugin ( #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" + $script_path = $script_path_default, } default: { $munin_node_service = "munin-node" @@ -102,18 +103,22 @@ class munin::plugins::base { gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } } case $operatingsystem { @@ -145,11 +150,6 @@ class munin::plugins::base { } } } - - case $operatingsystem { - gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } - default: { $script_path_default = "/usr/share/munin/plugins" } - } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From e644c426af63a4c490192ff567108f4aa8d3d628 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:15:24 +0000 Subject: munin script_path nur in plugins-gebraucht --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index df31fe2..d9b944c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,7 +4,7 @@ define munin::plugin ( $ensure = "present", - $script_path = $script_path_default, + $script_path = '/usr/libexec/munin/plugins', $config = '') { case $operatingsystem { @@ -20,6 +20,7 @@ define munin::plugin ( #$munin_node_service = "munin-node" $munin_node_service = "munin" $munin_node_package = "munin" + $script_path = $script_path_default, } default: { $munin_node_service = "munin-node" @@ -102,18 +103,22 @@ class munin::plugins::base { gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/libexec/munin/plugins" } } case $operatingsystem { @@ -145,11 +150,6 @@ class munin::plugins::base { } } } - - case $operatingsystem { - gentoo: { $script_path_default = "/usr/libexec/munin/plugins" } - default: { $script_path_default = "/usr/share/munin/plugins" } - } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 7c962d612c78e13cf4017e4681d38a7f71733bfa Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:24:28 +0000 Subject: path als class inlcude git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@685 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 59 +++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d9b944c..572f79b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,31 +2,39 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', - $config = '') +class munin::plugin::paths { case $operatingsystem { - debian: { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } + debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - centos: { + $script_path_default = "/usr/share/munin/plugins" + } + centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" - $munin_node_package = "munin" - $script_path = $script_path_default, - } + $script_path_default = "/usr/share/munin/plugins" + } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } } + +{ + +define munin::plugin ( + $ensure = "present", + $script_path = '/usr/libexec/munin/plugins', + $config = '') +{ + include munin::plugin::paths $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -98,29 +106,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::paths - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - } case $operatingsystem { centos: { file { -- cgit v1.2.3 From d28a2979f038b6b48322584a43932f66c488fb03 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:24:28 +0000 Subject: path als class inlcude git-svn-id: https://svn/ipuppet/trunk/modules/munin@685 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 59 +++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d9b944c..572f79b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,31 +2,39 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', - $config = '') +class munin::plugin::paths { case $operatingsystem { - debian: { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } + debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - centos: { + $script_path_default = "/usr/share/munin/plugins" + } + centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" - $munin_node_package = "munin" - $script_path = $script_path_default, - } + $script_path_default = "/usr/share/munin/plugins" + } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } } + +{ + +define munin::plugin ( + $ensure = "present", + $script_path = '/usr/libexec/munin/plugins', + $config = '') +{ + include munin::plugin::paths $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -98,29 +106,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::paths - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - } case $operatingsystem { centos: { file { -- cgit v1.2.3 From 0ed246de50b9da2a1623e278fd581a378e1fc0e0 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:24:28 +0000 Subject: path als class inlcude --- manifests/plugin.pp | 59 +++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d9b944c..572f79b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,31 +2,39 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', - $config = '') +class munin::plugin::paths { case $operatingsystem { - debian: { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } + debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - centos: { + $script_path_default = "/usr/share/munin/plugins" + } + centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" - $munin_node_package = "munin" - $script_path = $script_path_default, - } + $script_path_default = "/usr/share/munin/plugins" + } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } } + +{ + +define munin::plugin ( + $ensure = "present", + $script_path = '/usr/libexec/munin/plugins', + $config = '') +{ + include munin::plugin::paths $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -98,29 +106,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::paths - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - } case $operatingsystem { centos: { file { -- cgit v1.2.3 From 16bcc5f14cfa174324b214b9e8da1fd4fd3401d5 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:28:00 +0000 Subject: script path ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@686 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 572f79b..0d11c01 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,22 +8,22 @@ class munin::plugin::paths gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $script_path = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } } @@ -181,7 +181,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path_default/gentoo_lastupdated": + file { "$script_path/gentoo_lastupdated": source => "puppet://$servername/munin/plugins/gentoo_lastupdated", ensure => file, mode => 0755, owner => root, group => 0; @@ -194,7 +194,7 @@ class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path_default/selinuxenforced": + file { "$script_path/selinuxenforced": source => "puppet://$servername/munin/plugins/selinuxenforced", ensure => file, mode => 0755, owner => root, group => 0; @@ -205,19 +205,19 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::dom0 inherits munin::plugins::base { file { - [ "$script_path_default/xen" ]: + [ "$script_path/xen" ]: source => "puppet://$servername/munin/plugins/xen", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen-cpu" ]: + [ "$script_path/xen-cpu" ]: source => "puppet://$servername/munin/plugins/xen-cpu", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_memory" ]: + [ "$script_path/xen_memory" ]: source => "puppet://$servername/munin/plugins/xen_memory", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_vbd" ]: + [ "$script_path/xen_vbd" ]: source => "puppet://$servername/munin/plugins/xen_vbd", ensure => file, mode => 0755, owner => root, group => 0; @@ -235,7 +235,7 @@ class munin::plugins::domU inherits munin::plugins::base { class munin::plugins::djbdns inherits munin::plugins::base { file { - [ "$script_path_default/tinydns" ]: + [ "$script_path/tinydns" ]: source => "puppet://$servername/munin/plugins/tinydns", ensure => file, mode => 0755, owner => root, group => 0; @@ -248,15 +248,15 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { file { - [ "$script_path_default/pg_conn" ]: + [ "$script_path/pg_conn" ]: source => "puppet://$servername/munin/plugins/pg_conn", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__connections" ]: + [ "$script_path/pg__connections" ]: source => "puppet://$servername/munin/plugins/pg__connections", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__locks" ]: + [ "$script_path/pg__locks" ]: source => "puppet://$servername/munin/plugins/pg__locks", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From f866b953289eab2b50cba45411ced3b25820884c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:28:00 +0000 Subject: script path ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@686 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 572f79b..0d11c01 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,22 +8,22 @@ class munin::plugin::paths gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $script_path = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } } @@ -181,7 +181,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path_default/gentoo_lastupdated": + file { "$script_path/gentoo_lastupdated": source => "puppet://$servername/munin/plugins/gentoo_lastupdated", ensure => file, mode => 0755, owner => root, group => 0; @@ -194,7 +194,7 @@ class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path_default/selinuxenforced": + file { "$script_path/selinuxenforced": source => "puppet://$servername/munin/plugins/selinuxenforced", ensure => file, mode => 0755, owner => root, group => 0; @@ -205,19 +205,19 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::dom0 inherits munin::plugins::base { file { - [ "$script_path_default/xen" ]: + [ "$script_path/xen" ]: source => "puppet://$servername/munin/plugins/xen", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen-cpu" ]: + [ "$script_path/xen-cpu" ]: source => "puppet://$servername/munin/plugins/xen-cpu", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_memory" ]: + [ "$script_path/xen_memory" ]: source => "puppet://$servername/munin/plugins/xen_memory", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_vbd" ]: + [ "$script_path/xen_vbd" ]: source => "puppet://$servername/munin/plugins/xen_vbd", ensure => file, mode => 0755, owner => root, group => 0; @@ -235,7 +235,7 @@ class munin::plugins::domU inherits munin::plugins::base { class munin::plugins::djbdns inherits munin::plugins::base { file { - [ "$script_path_default/tinydns" ]: + [ "$script_path/tinydns" ]: source => "puppet://$servername/munin/plugins/tinydns", ensure => file, mode => 0755, owner => root, group => 0; @@ -248,15 +248,15 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { file { - [ "$script_path_default/pg_conn" ]: + [ "$script_path/pg_conn" ]: source => "puppet://$servername/munin/plugins/pg_conn", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__connections" ]: + [ "$script_path/pg__connections" ]: source => "puppet://$servername/munin/plugins/pg__connections", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__locks" ]: + [ "$script_path/pg__locks" ]: source => "puppet://$servername/munin/plugins/pg__locks", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 3d6ecf7a34a91b6149710bf4eadcf06834cc2ed3 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:28:00 +0000 Subject: script path ... --- manifests/plugin.pp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 572f79b..0d11c01 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,22 +8,22 @@ class munin::plugin::paths gentoo: { $munin_node_package = "munin" $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $script_path = "/usr/libexec/munin/plugins" } debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $script_path = "/usr/share/munin/plugins" } } @@ -181,7 +181,7 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path_default/gentoo_lastupdated": + file { "$script_path/gentoo_lastupdated": source => "puppet://$servername/munin/plugins/gentoo_lastupdated", ensure => file, mode => 0755, owner => root, group => 0; @@ -194,7 +194,7 @@ class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path_default/selinuxenforced": + file { "$script_path/selinuxenforced": source => "puppet://$servername/munin/plugins/selinuxenforced", ensure => file, mode => 0755, owner => root, group => 0; @@ -205,19 +205,19 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::dom0 inherits munin::plugins::base { file { - [ "$script_path_default/xen" ]: + [ "$script_path/xen" ]: source => "puppet://$servername/munin/plugins/xen", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen-cpu" ]: + [ "$script_path/xen-cpu" ]: source => "puppet://$servername/munin/plugins/xen-cpu", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_memory" ]: + [ "$script_path/xen_memory" ]: source => "puppet://$servername/munin/plugins/xen_memory", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/xen_vbd" ]: + [ "$script_path/xen_vbd" ]: source => "puppet://$servername/munin/plugins/xen_vbd", ensure => file, mode => 0755, owner => root, group => 0; @@ -235,7 +235,7 @@ class munin::plugins::domU inherits munin::plugins::base { class munin::plugins::djbdns inherits munin::plugins::base { file { - [ "$script_path_default/tinydns" ]: + [ "$script_path/tinydns" ]: source => "puppet://$servername/munin/plugins/tinydns", ensure => file, mode => 0755, owner => root, group => 0; @@ -248,15 +248,15 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { file { - [ "$script_path_default/pg_conn" ]: + [ "$script_path/pg_conn" ]: source => "puppet://$servername/munin/plugins/pg_conn", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__connections" ]: + [ "$script_path/pg__connections" ]: source => "puppet://$servername/munin/plugins/pg__connections", ensure => file, mode => 0755, owner => root, group => 0; - [ "$script_path_default/pg__locks" ]: + [ "$script_path/pg__locks" ]: source => "puppet://$servername/munin/plugins/pg__locks", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 9ea005de9581930c575b19a892408204c9304d62 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:35:18 +0000 Subject: script path git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@687 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0d11c01..2b12896 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -31,11 +31,13 @@ class munin::plugin::paths define munin::plugin ( $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', + $script_path_in = '', $config = '') { include munin::plugin::paths + $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" -- cgit v1.2.3 From 6661f91c54049defe2aa8f4d587d34d7e7b15dee Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:35:18 +0000 Subject: script path git-svn-id: https://svn/ipuppet/trunk/modules/munin@687 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0d11c01..2b12896 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -31,11 +31,13 @@ class munin::plugin::paths define munin::plugin ( $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', + $script_path_in = '', $config = '') { include munin::plugin::paths + $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" -- cgit v1.2.3 From d4448bd2b5ed8fdc0a967ace62c83f07210007ff Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:35:18 +0000 Subject: script path --- manifests/plugin.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0d11c01..2b12896 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -31,11 +31,13 @@ class munin::plugin::paths define munin::plugin ( $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', + $script_path_in = '', $config = '') { include munin::plugin::paths + $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" -- cgit v1.2.3 From dc53a7550c00871030f334c12fe26399715f617c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:40:39 +0000 Subject: div git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@688 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b12896..b33260e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -36,7 +36,7 @@ define munin::plugin ( { include munin::plugin::paths - $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From d2f00103d81de8d0483997b98bf879a98d9134e3 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:40:39 +0000 Subject: div git-svn-id: https://svn/ipuppet/trunk/modules/munin@688 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b12896..b33260e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -36,7 +36,7 @@ define munin::plugin ( { include munin::plugin::paths - $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From c08e63bd126694d8f8e7b2449c2d382cd3920aa4 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:40:39 +0000 Subject: div --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b12896..b33260e 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -36,7 +36,7 @@ define munin::plugin ( { include munin::plugin::paths - $script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) -- cgit v1.2.3 From dda4708eac5e443f8f2f6303e989c2949d248b03 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:47:52 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@689 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b33260e..8869383 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -34,7 +34,28 @@ define munin::plugin ( $script_path_in = '', $config = '') { - include munin::plugin::paths + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } -- cgit v1.2.3 From 2e59b0457541b624057f9b60eb6aa99d0d827521 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:47:52 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@689 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b33260e..8869383 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -34,7 +34,28 @@ define munin::plugin ( $script_path_in = '', $config = '') { - include munin::plugin::paths + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } -- cgit v1.2.3 From d9e65b358ad4dae5670b7dd366f170807d330d69 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:47:52 +0000 Subject: test --- manifests/plugin.pp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b33260e..8869383 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -34,7 +34,28 @@ define munin::plugin ( $script_path_in = '', $config = '') { - include munin::plugin::paths + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } -- cgit v1.2.3 From 6991309e5f2414fc44af38f7813bec9350469b24 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:55:40 +0000 Subject: klammerfehler git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@690 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8869383..cdfca80 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,7 +27,7 @@ class munin::plugin::paths } } -{ +} define munin::plugin ( $ensure = "present", -- cgit v1.2.3 From bfea715ace59348bf12e881bdb8898333fe54ede Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:55:40 +0000 Subject: klammerfehler git-svn-id: https://svn/ipuppet/trunk/modules/munin@690 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8869383..cdfca80 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,7 +27,7 @@ class munin::plugin::paths } } -{ +} define munin::plugin ( $ensure = "present", -- cgit v1.2.3 From 1791c117f9bf8e4ef8842dc33523c98c678e5586 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:55:40 +0000 Subject: klammerfehler --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8869383..cdfca80 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,7 +27,7 @@ class munin::plugin::paths } } -{ +} define munin::plugin ( $ensure = "present", -- cgit v1.2.3 From e291607945d7cef41d29dc1993a925e637097a10 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:58:04 +0000 Subject: =?UTF-8?q?kein=20service=20f=C3=BCr=20gentoo,=20f=C3=BCr=20den=20?= =?UTF-8?q?mom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@691 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index cdfca80..b28b918 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) case $operatingsystem { - centos: { + centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package]; -- cgit v1.2.3 From fdd40a1954998128e024321cf3e55a900b336a68 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:58:04 +0000 Subject: =?UTF-8?q?kein=20service=20f=C3=BCr=20gentoo,=20f=C3=BCr=20den=20?= =?UTF-8?q?mom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@691 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index cdfca80..b28b918 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) case $operatingsystem { - centos: { + centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package]; -- cgit v1.2.3 From 3eee1a476d408d0d7836fa10b8cd728e65a77b9d Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:58:04 +0000 Subject: =?UTF-8?q?kein=20service=20f=C3=BCr=20gentoo,=20f=C3=BCr=20den=20?= =?UTF-8?q?mom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index cdfca80..b28b918 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -71,7 +71,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) case $operatingsystem { - centos: { + centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", require => Package[$munin_node_package]; -- cgit v1.2.3 From 3f5d27d114773600812646b31c47eab41eb8b20c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:59:59 +0000 Subject: path git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@692 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b28b918..426e30f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -129,7 +129,29 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::paths + + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } case $operatingsystem { centos: { -- cgit v1.2.3 From 68021a7334465225066ee24958dde7675f31dcdd Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 15:59:59 +0000 Subject: path git-svn-id: https://svn/ipuppet/trunk/modules/munin@692 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b28b918..426e30f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -129,7 +129,29 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::paths + + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } case $operatingsystem { centos: { -- cgit v1.2.3 From cb1dec1b3514162b4f761edb8068c703693c0f90 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:59:59 +0000 Subject: path --- manifests/plugin.pp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index b28b918..426e30f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -129,7 +129,29 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::paths + + case $operatingsystem { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path = "/usr/libexec/munin/plugins" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + centos: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + default: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + $script_path = "/usr/share/munin/plugins" + } + } case $operatingsystem { centos: { -- cgit v1.2.3 From 1be97093abe3dc6cf1b5e024a36ec83d0de3e680 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 16:26:17 +0000 Subject: munin entflochten ... git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@693 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 426e30f..a66ccb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,33 +2,6 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -class munin::plugin::paths -{ - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - -} - define munin::plugin ( $ensure = "present", $script_path_in = '', -- cgit v1.2.3 From 77ed58048b3652e5c7c15cd04f82313374b4cf61 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 16:26:17 +0000 Subject: munin entflochten ... git-svn-id: https://svn/ipuppet/trunk/modules/munin@693 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 426e30f..a66ccb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,33 +2,6 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -class munin::plugin::paths -{ - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - -} - define munin::plugin ( $ensure = "present", $script_path_in = '', -- cgit v1.2.3 From 11dc1992fcda8eba39f5362394e165d44c8b9912 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 16:26:17 +0000 Subject: munin entflochten ... --- manifests/plugin.pp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 426e30f..a66ccb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,33 +2,6 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -class munin::plugin::paths -{ - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - -} - define munin::plugin ( $ensure = "present", $script_path_in = '', -- cgit v1.2.3 From fba92933ddb8fdafe8a0175a9abffcc19e2bd68c Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:14:33 +0000 Subject: fixed some service issues git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@705 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a66ccb8..8c6fa15 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin" + $munin_node_service = "munin-munin" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From 74f2bb9154dec374abba9ff9f268155cbf00e470 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:14:33 +0000 Subject: fixed some service issues git-svn-id: https://svn/ipuppet/trunk/modules/munin@705 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a66ccb8..8c6fa15 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin" + $munin_node_service = "munin-munin" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From 2e67040248f020caaab383d443d245075db47fd4 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:14:33 +0000 Subject: fixed some service issues --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a66ccb8..8c6fa15 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin" + $munin_node_service = "munin-munin" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From 1f2ad708412857057791b4927372bf59465ca469 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:17:35 +0000 Subject: fixed some service issues git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@706 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8c6fa15..bc706ab 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-munin" + $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From 25484de8fd6c7908b21cb0fcfde08f95f9244c46 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:17:35 +0000 Subject: fixed some service issues git-svn-id: https://svn/ipuppet/trunk/modules/munin@706 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8c6fa15..bc706ab 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-munin" + $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From 6656354fc298a8911d128cab1c6daac8112e5394 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:17:35 +0000 Subject: fixed some service issues --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8c6fa15..bc706ab 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( case $operatingsystem { gentoo: { $munin_node_package = "munin" - $munin_node_service = "munin-munin" + $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { -- cgit v1.2.3 From a382a6c63ec1487f437d77630c0f4bcbc4c83a0c Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:29:58 +0000 Subject: fixed some service correlation git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@707 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 510945d..df60a77 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,6 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': + alias => 'munin-node' ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -159,7 +160,7 @@ class munin::client::gentoo mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], # notify => Service["munin"], } @@ -175,10 +176,6 @@ class munin::client::centos $script_path_default = "/usr/share/munin/plugins" package { 'munin': ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, } @@ -191,7 +188,7 @@ class munin::client::centos mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], notify => Service["munin"], } -- cgit v1.2.3 From 1116b7ecf0b2760e09e589543a1a6fb9a6fed38b Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:29:58 +0000 Subject: fixed some service correlation git-svn-id: https://svn/ipuppet/trunk/modules/munin@707 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 510945d..df60a77 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,6 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': + alias => 'munin-node' ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -159,7 +160,7 @@ class munin::client::gentoo mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], # notify => Service["munin"], } @@ -175,10 +176,6 @@ class munin::client::centos $script_path_default = "/usr/share/munin/plugins" package { 'munin': ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, } @@ -191,7 +188,7 @@ class munin::client::centos mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], notify => Service["munin"], } -- cgit v1.2.3 From af67525a0b0eeac47b62efe23e7dd8ef8c320262 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:29:58 +0000 Subject: fixed some service correlation --- manifests/client.pp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 510945d..df60a77 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,6 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': + alias => 'munin-node' ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -159,7 +160,7 @@ class munin::client::gentoo mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], # notify => Service["munin"], } @@ -175,10 +176,6 @@ class munin::client::centos $script_path_default = "/usr/share/munin/plugins" package { 'munin': ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, } @@ -191,7 +188,7 @@ class munin::client::centos mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! - before => Package["munin"], + before => Package["munin-node"], notify => Service["munin"], } -- cgit v1.2.3 From d53d271f8aac59622809307bd3a7f6d9886d8897 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:33:29 +0000 Subject: fixed some service correlation git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@708 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index df60a77..d61db3b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -174,7 +174,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin': + package { 'munin-node': ensure => present, } -- cgit v1.2.3 From a35e38d571e0a3411f4fd1831cdb18235157621f Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:33:29 +0000 Subject: fixed some service correlation git-svn-id: https://svn/ipuppet/trunk/modules/munin@708 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index df60a77..d61db3b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -174,7 +174,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin': + package { 'munin-node': ensure => present, } -- cgit v1.2.3 From 52c1bc427e718aa98ae2ce6ff5cced66a0aa6d2d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 18:33:29 +0000 Subject: fixed some service correlation --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index df60a77..d61db3b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -174,7 +174,7 @@ class munin::client::gentoo class munin::client::centos { $script_path_default = "/usr/share/munin/plugins" - package { 'munin': + package { 'munin-node': ensure => present, } -- cgit v1.2.3 From 64821f27700c091cbca95fe6b75f73760e1daa46 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 18:59:21 +0000 Subject: tippfehler git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@710 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d61db3b..d0f793e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node' + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 4fb0b2fa23bc1aa4e1eaf34cff6b2fa17653e3f1 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 18:59:21 +0000 Subject: tippfehler git-svn-id: https://svn/ipuppet/trunk/modules/munin@710 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d61db3b..d0f793e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node' + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 6764bd14ef940c0126b1f403525dc36a538d28dc Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 18:59:21 +0000 Subject: tippfehler --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d61db3b..d0f793e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node' + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From d58277f7e8a43eefce741b03149c26f8a88e0fa5 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 19:06:03 +0000 Subject: test git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@712 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d0f793e..71f86fa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node', + alias => munin-node, ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 07415f2506af67e05d83d04979f4e8f2d3fc1a1b Mon Sep 17 00:00:00 2001 From: am Date: Fri, 1 Feb 2008 19:06:03 +0000 Subject: test git-svn-id: https://svn/ipuppet/trunk/modules/munin@712 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d0f793e..71f86fa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node', + alias => munin-node, ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 798813916cf38cbc7d8eaded019b37acab99415c Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 19:06:03 +0000 Subject: test --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d0f793e..71f86fa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,7 @@ class munin::client::gentoo $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" package { 'munin': - alias => 'munin-node', + alias => munin-node, ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 24a6f6a749025e79367cd3676cf7e805fbb4f0c3 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 19:11:06 +0000 Subject: fixed service problem git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@713 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 71f86fa..17ad207 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -164,7 +164,7 @@ class munin::client::gentoo # notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } @@ -189,7 +189,7 @@ class munin::client::centos # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From b3a600ad26a21e446d528a93ff03d3ca9dfb66c1 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 19:11:06 +0000 Subject: fixed service problem git-svn-id: https://svn/ipuppet/trunk/modules/munin@713 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 71f86fa..17ad207 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -164,7 +164,7 @@ class munin::client::gentoo # notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } @@ -189,7 +189,7 @@ class munin::client::centos # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From 5049f21501bbdda4a448cae66845bba603e47e03 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 1 Feb 2008 19:11:06 +0000 Subject: fixed service problem --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 71f86fa..17ad207 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -164,7 +164,7 @@ class munin::client::gentoo # notify => Service["munin"], } - service { "munin": + service { "munin-node": ensure => running, } @@ -189,7 +189,7 @@ class munin::client::centos # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], - notify => Service["munin"], + notify => Service["munin-node"], } service { "munin-node": -- cgit v1.2.3 From e437c257bb3e7d3564f86f9e88a1632fd91c31f8 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 2 Feb 2008 00:33:47 +0000 Subject: fixed language problem, added need package by debian git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@734 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 17ad207..7dcbbe1 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -103,6 +103,8 @@ class munin::client::debian $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } + # the plugin will need that + package { "iproute": ensure => installed } file { "/etc/munin/": -- cgit v1.2.3 From fd7b356081ce48f9b882610fe06f17cd4762c3c7 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 2 Feb 2008 00:33:47 +0000 Subject: fixed language problem, added need package by debian git-svn-id: https://svn/ipuppet/trunk/modules/munin@734 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 17ad207..7dcbbe1 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -103,6 +103,8 @@ class munin::client::debian $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } + # the plugin will need that + package { "iproute": ensure => installed } file { "/etc/munin/": -- cgit v1.2.3 From 3ff86b597015cedc9a53abd95781ab2d1f3eb4ab Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 2 Feb 2008 00:33:47 +0000 Subject: fixed language problem, added need package by debian --- manifests/client.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 17ad207..7dcbbe1 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -103,6 +103,8 @@ class munin::client::debian $script_path_default = "/usr/share/munin/plugins" package { "munin-node": ensure => installed } + # the plugin will need that + package { "iproute": ensure => installed } file { "/etc/munin/": -- cgit v1.2.3 From 03f4985111dafbe7b97119fbad414baa4784cf2e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:03:47 +0000 Subject: removed unneeded definition git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@763 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc706ab..5fd4190 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -102,30 +102,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - case $operatingsystem { centos: { file { -- cgit v1.2.3 From 47e1e2322ed93842146d251ece06856f603d5403 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:03:47 +0000 Subject: removed unneeded definition git-svn-id: https://svn/ipuppet/trunk/modules/munin@763 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc706ab..5fd4190 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -102,30 +102,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - case $operatingsystem { centos: { file { -- cgit v1.2.3 From bd54bb182afef2fd13e0159c67dcbc7375bfd577 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:03:47 +0000 Subject: removed unneeded definition --- manifests/plugin.pp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc706ab..5fd4190 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -102,30 +102,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path = "/usr/share/munin/plugins" - } - } - case $operatingsystem { centos: { file { -- cgit v1.2.3 From 443bbd222f652caa2d4c759acaa1e8a13bb61b4c Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:31:50 +0000 Subject: fixed? munin plugin problems git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@764 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 18 +++--------------- manifests/plugin.pp | 19 ++++++------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7dcbbe1..ba59333 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -100,8 +100,6 @@ class munin::client::darwin class munin::client::debian { - $script_path_default = "/usr/share/munin/plugins" - package { "munin-node": ensure => installed } # the plugin will need that package { "iproute": ensure => installed } @@ -133,10 +131,10 @@ class munin::client::debian class munin::client::gentoo { - $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" - package { 'munin': - alias => munin-node, + package { 'munin-node': + name => 'munin', + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -144,15 +142,6 @@ class munin::client::gentoo }, } - # link - # mh: really needed? -# file{ -# "/etc/init.d/munin": -# ensure => "/etc/init.d/munin-node", -# } - - - file { "/etc/munin/": ensure => directory, @@ -175,7 +164,6 @@ class munin::client::gentoo class munin::client::centos { - $script_path_default = "/usr/share/munin/plugins" package { 'munin-node': ensure => present, } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5fd4190..97c89b2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,23 +9,15 @@ define munin::plugin ( { case $operatingsystem { gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } } @@ -47,14 +39,14 @@ define munin::plugin ( centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package]; + require => Package['munin-node']; } } default: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - notify => Service[$munin_node_service]; + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -123,11 +115,12 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, - notify => Service["$munin_node_service"]; + notify => Service['munin-node']; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => 0, - notify => Service[$munin_node_service]; + notify => Service['munin-node'], + before => Package['munin-node']; } } } -- cgit v1.2.3 From 1115e76a91b398ccb45f2cd5ea2195cb3351bc22 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:31:50 +0000 Subject: fixed? munin plugin problems git-svn-id: https://svn/ipuppet/trunk/modules/munin@764 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 18 +++--------------- manifests/plugin.pp | 19 ++++++------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7dcbbe1..ba59333 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -100,8 +100,6 @@ class munin::client::darwin class munin::client::debian { - $script_path_default = "/usr/share/munin/plugins" - package { "munin-node": ensure => installed } # the plugin will need that package { "iproute": ensure => installed } @@ -133,10 +131,10 @@ class munin::client::debian class munin::client::gentoo { - $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" - package { 'munin': - alias => munin-node, + package { 'munin-node': + name => 'munin', + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -144,15 +142,6 @@ class munin::client::gentoo }, } - # link - # mh: really needed? -# file{ -# "/etc/init.d/munin": -# ensure => "/etc/init.d/munin-node", -# } - - - file { "/etc/munin/": ensure => directory, @@ -175,7 +164,6 @@ class munin::client::gentoo class munin::client::centos { - $script_path_default = "/usr/share/munin/plugins" package { 'munin-node': ensure => present, } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5fd4190..97c89b2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,23 +9,15 @@ define munin::plugin ( { case $operatingsystem { gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } } @@ -47,14 +39,14 @@ define munin::plugin ( centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package]; + require => Package['munin-node']; } } default: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - notify => Service[$munin_node_service]; + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -123,11 +115,12 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, - notify => Service["$munin_node_service"]; + notify => Service['munin-node']; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => 0, - notify => Service[$munin_node_service]; + notify => Service['munin-node'], + before => Package['munin-node']; } } } -- cgit v1.2.3 From 6f3d5ae95495d024f69c8ab29ca42558a796aa0c Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:31:50 +0000 Subject: fixed? munin plugin problems --- manifests/client.pp | 18 +++--------------- manifests/plugin.pp | 19 ++++++------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7dcbbe1..ba59333 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -100,8 +100,6 @@ class munin::client::darwin class munin::client::debian { - $script_path_default = "/usr/share/munin/plugins" - package { "munin-node": ensure => installed } # the plugin will need that package { "iproute": ensure => installed } @@ -133,10 +131,10 @@ class munin::client::debian class munin::client::gentoo { - $script_path_default = "/usr/libexec/munin/plugins" $acpi_available = "absent" - package { 'munin': - alias => munin-node, + package { 'munin-node': + name => 'munin', + alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', @@ -144,15 +142,6 @@ class munin::client::gentoo }, } - # link - # mh: really needed? -# file{ -# "/etc/init.d/munin": -# ensure => "/etc/init.d/munin-node", -# } - - - file { "/etc/munin/": ensure => directory, @@ -175,7 +164,6 @@ class munin::client::gentoo class munin::client::centos { - $script_path_default = "/usr/share/munin/plugins" package { 'munin-node': ensure => present, } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5fd4190..97c89b2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -9,23 +9,15 @@ define munin::plugin ( { case $operatingsystem { gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin-node" $script_path = "/usr/libexec/munin/plugins" } debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" $script_path = "/usr/share/munin/plugins" } } @@ -47,14 +39,14 @@ define munin::plugin ( centos, gentoo: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package]; + require => Package['munin-node']; } } default: { file { $plugin: ensure => "$script_path/${plugin_src}", - require => Package[$munin_node_package], - notify => Service[$munin_node_service]; + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -123,11 +115,12 @@ class munin::plugins::base { ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, - notify => Service["$munin_node_service"]; + notify => Service['munin-node']; "/etc/munin/plugin-conf.d/munin-node": ensure => present, mode => 0644, owner => root, group => 0, - notify => Service[$munin_node_service]; + notify => Service['munin-node'], + before => Package['munin-node']; } } } -- cgit v1.2.3 From 47dc70484afec3c95ba38a3635b2dc455972755e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:39:54 +0000 Subject: fixed double package problem git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@765 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index ba59333..13f3e09 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,6 @@ class munin::client::gentoo $acpi_available = "absent" package { 'munin-node': name => 'munin', - alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From f0b680075d3106efc0a04c8fd3a5d5f05dbe82e6 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:39:54 +0000 Subject: fixed double package problem git-svn-id: https://svn/ipuppet/trunk/modules/munin@765 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index ba59333..13f3e09 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,6 @@ class munin::client::gentoo $acpi_available = "absent" package { 'munin-node': name => 'munin', - alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 047a55a85be261881b7709fe243633ac533f43d8 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Feb 2008 20:39:54 +0000 Subject: fixed double package problem --- manifests/client.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index ba59333..13f3e09 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -134,7 +134,6 @@ class munin::client::gentoo $acpi_available = "absent" package { 'munin-node': name => 'munin', - alias => 'munin-node', ensure => present, category => $operatingsystem ? { gentoo => 'net-analyzer', -- cgit v1.2.3 From 07ae196caadb77245cfa5b7298d991212b7ded07 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:20:38 +0000 Subject: pfad nicht richtig def git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@776 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97c89b2..0363317 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,11 +2,7 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path_in = '', - $config = '') -{ +class munin::plugin::scriptpaths { case $operatingsystem { gentoo: { $script_path = "/usr/libexec/munin/plugins" @@ -21,7 +17,16 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins" } } +} + +define munin::plugin ( + $ensure = "present", + $script_path_in = '', + $config = '') +{ + + include munin::plugin::scriptpaths #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -94,6 +99,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::scriptpaths + case $operatingsystem { centos: { file { -- cgit v1.2.3 From 8f58fe2d444587451c0e042574f2931a4162ee08 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:20:38 +0000 Subject: pfad nicht richtig def git-svn-id: https://svn/ipuppet/trunk/modules/munin@776 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97c89b2..0363317 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,11 +2,7 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path_in = '', - $config = '') -{ +class munin::plugin::scriptpaths { case $operatingsystem { gentoo: { $script_path = "/usr/libexec/munin/plugins" @@ -21,7 +17,16 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins" } } +} + +define munin::plugin ( + $ensure = "present", + $script_path_in = '', + $config = '') +{ + + include munin::plugin::scriptpaths #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -94,6 +99,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::scriptpaths + case $operatingsystem { centos: { file { -- cgit v1.2.3 From f2d6994a63d6ad1fcbd9e18dd32423e34e9e1a3d Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 10:20:38 +0000 Subject: pfad nicht richtig def --- manifests/plugin.pp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97c89b2..0363317 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,11 +2,7 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path_in = '', - $config = '') -{ +class munin::plugin::scriptpaths { case $operatingsystem { gentoo: { $script_path = "/usr/libexec/munin/plugins" @@ -21,7 +17,16 @@ define munin::plugin ( $script_path = "/usr/share/munin/plugins" } } +} + +define munin::plugin ( + $ensure = "present", + $script_path_in = '', + $config = '') +{ + + include munin::plugin::scriptpaths #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -94,6 +99,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::scriptpaths + case $operatingsystem { centos: { file { -- cgit v1.2.3 From e691335a32b70606db86a463a8a5772714025a41 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:37:32 +0000 Subject: deploy function git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@778 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0363317..ae57378 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -40,20 +40,10 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - case $operatingsystem { - centos, gentoo: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node']; - } - } - default: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node'], - notify => Service['munin-node']; - } - } + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -197,6 +187,23 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } +define munin::plugins::deploy ($source = '') { + $real_source = $source ? { + '' => "munin/plugins/$name", + default => $source + } + include munin::plugins::scriptpaths + file { "munin_plugin_${name}: + path => "$script_path/$name", + source => "puppet://$servername/$real_source", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{$name: ensure => present } + +} + class munin::plugins::dom0 inherits munin::plugins::base { file { [ "$script_path/xen" ]: -- cgit v1.2.3 From a883c099328cce1c9805c153cc8b7f589a203601 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:37:32 +0000 Subject: deploy function git-svn-id: https://svn/ipuppet/trunk/modules/munin@778 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0363317..ae57378 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -40,20 +40,10 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - case $operatingsystem { - centos, gentoo: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node']; - } - } - default: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node'], - notify => Service['munin-node']; - } - } + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -197,6 +187,23 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } +define munin::plugins::deploy ($source = '') { + $real_source = $source ? { + '' => "munin/plugins/$name", + default => $source + } + include munin::plugins::scriptpaths + file { "munin_plugin_${name}: + path => "$script_path/$name", + source => "puppet://$servername/$real_source", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{$name: ensure => present } + +} + class munin::plugins::dom0 inherits munin::plugins::base { file { [ "$script_path/xen" ]: -- cgit v1.2.3 From f13bb0f6bb9a6f067bda5d4380891c492924586f Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 10:37:32 +0000 Subject: deploy function --- manifests/plugin.pp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0363317..ae57378 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -40,20 +40,10 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - case $operatingsystem { - centos, gentoo: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node']; - } - } - default: { - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package['munin-node'], - notify => Service['munin-node']; - } - } + file { $plugin: + ensure => "$script_path/${plugin_src}", + require => Package['munin-node'], + notify => Service['munin-node']; } } } @@ -197,6 +187,23 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } +define munin::plugins::deploy ($source = '') { + $real_source = $source ? { + '' => "munin/plugins/$name", + default => $source + } + include munin::plugins::scriptpaths + file { "munin_plugin_${name}: + path => "$script_path/$name", + source => "puppet://$servername/$real_source", + ensure => file, + mode => 0755, owner => root, group => 0; + } + + plugin{$name: ensure => present } + +} + class munin::plugins::dom0 inherits munin::plugins::base { file { [ "$script_path/xen" ]: -- cgit v1.2.3 From 8036a083dcaf6fde02d5280c1fdcb8ee09403115 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:44:46 +0000 Subject: deploy aktiv git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@779 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 64 +++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ae57378..bbb3cc4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,7 +187,7 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '') { +define munin::plugins::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -198,36 +198,18 @@ define munin::plugins::deploy ($source = '') { source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; - } - - plugin{$name: ensure => present } + } + if $enabled { + plugin{$name: ensure => present } + } } class munin::plugins::dom0 inherits munin::plugins::base { - file { - [ "$script_path/xen" ]: - source => "puppet://$servername/munin/plugins/xen", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen-cpu" ]: - source => "puppet://$servername/munin/plugins/xen-cpu", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_memory" ]: - source => "puppet://$servername/munin/plugins/xen_memory", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_vbd" ]: - source => "puppet://$servername/munin/plugins/xen_vbd", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin { - [ xen, xen-cpu, xen_memory, xen_vbd ]: - ensure => present; - } + munin::plugins::deploy { "xen": } + munin::plugins::deploy { "xen-cpu": } + munin::plugins::deploy { "xen_memory": } + munin::plugins::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -235,31 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - file { - [ "$script_path/tinydns" ]: - source => "puppet://$servername/munin/plugins/tinydns", - ensure => file, - mode => 0755, owner => root, group => 0; - } - plugin { - [ tinydns ]: - ensure => present; - } + munin::plugins::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - file { - [ "$script_path/pg_conn" ]: - source => "puppet://$servername/munin/plugins/pg_conn", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__connections" ]: - source => "puppet://$servername/munin/plugins/pg__connections", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__locks" ]: - source => "puppet://$servername/munin/plugins/pg__locks", - ensure => file, - mode => 0755, owner => root, group => 0; - } + munin::plugins::deploy { "pg_conn": } + munin::plugins::deploy { "pg__connections": enabled => false } + munin::plugins::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From da9dc6cfaccebe21bef99211d7bb5b653dbda9a9 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:44:46 +0000 Subject: deploy aktiv git-svn-id: https://svn/ipuppet/trunk/modules/munin@779 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 64 +++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ae57378..bbb3cc4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,7 +187,7 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '') { +define munin::plugins::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -198,36 +198,18 @@ define munin::plugins::deploy ($source = '') { source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; - } - - plugin{$name: ensure => present } + } + if $enabled { + plugin{$name: ensure => present } + } } class munin::plugins::dom0 inherits munin::plugins::base { - file { - [ "$script_path/xen" ]: - source => "puppet://$servername/munin/plugins/xen", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen-cpu" ]: - source => "puppet://$servername/munin/plugins/xen-cpu", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_memory" ]: - source => "puppet://$servername/munin/plugins/xen_memory", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_vbd" ]: - source => "puppet://$servername/munin/plugins/xen_vbd", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin { - [ xen, xen-cpu, xen_memory, xen_vbd ]: - ensure => present; - } + munin::plugins::deploy { "xen": } + munin::plugins::deploy { "xen-cpu": } + munin::plugins::deploy { "xen_memory": } + munin::plugins::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -235,31 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - file { - [ "$script_path/tinydns" ]: - source => "puppet://$servername/munin/plugins/tinydns", - ensure => file, - mode => 0755, owner => root, group => 0; - } - plugin { - [ tinydns ]: - ensure => present; - } + munin::plugins::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - file { - [ "$script_path/pg_conn" ]: - source => "puppet://$servername/munin/plugins/pg_conn", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__connections" ]: - source => "puppet://$servername/munin/plugins/pg__connections", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__locks" ]: - source => "puppet://$servername/munin/plugins/pg__locks", - ensure => file, - mode => 0755, owner => root, group => 0; - } + munin::plugins::deploy { "pg_conn": } + munin::plugins::deploy { "pg__connections": enabled => false } + munin::plugins::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From af825fb60b3c29f491b4e459b309de493a7ede6b Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 10:44:46 +0000 Subject: deploy aktiv --- manifests/plugin.pp | 64 +++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ae57378..bbb3cc4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,7 +187,7 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '') { +define munin::plugins::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -198,36 +198,18 @@ define munin::plugins::deploy ($source = '') { source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; - } - - plugin{$name: ensure => present } + } + if $enabled { + plugin{$name: ensure => present } + } } class munin::plugins::dom0 inherits munin::plugins::base { - file { - [ "$script_path/xen" ]: - source => "puppet://$servername/munin/plugins/xen", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen-cpu" ]: - source => "puppet://$servername/munin/plugins/xen-cpu", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_memory" ]: - source => "puppet://$servername/munin/plugins/xen_memory", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/xen_vbd" ]: - source => "puppet://$servername/munin/plugins/xen_vbd", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin { - [ xen, xen-cpu, xen_memory, xen_vbd ]: - ensure => present; - } + munin::plugins::deploy { "xen": } + munin::plugins::deploy { "xen-cpu": } + munin::plugins::deploy { "xen_memory": } + munin::plugins::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -235,31 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - file { - [ "$script_path/tinydns" ]: - source => "puppet://$servername/munin/plugins/tinydns", - ensure => file, - mode => 0755, owner => root, group => 0; - } - plugin { - [ tinydns ]: - ensure => present; - } + munin::plugins::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - file { - [ "$script_path/pg_conn" ]: - source => "puppet://$servername/munin/plugins/pg_conn", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__connections" ]: - source => "puppet://$servername/munin/plugins/pg__connections", - ensure => file, - mode => 0755, owner => root, group => 0; - [ "$script_path/pg__locks" ]: - source => "puppet://$servername/munin/plugins/pg__locks", - ensure => file, - mode => 0755, owner => root, group => 0; - } + munin::plugins::deploy { "pg_conn": } + munin::plugins::deploy { "pg__connections": enabled => false } + munin::plugins::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From 8a17f36f877c06eba9335154309775feb2c1ebe1 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:49:39 +0000 Subject: typo git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@781 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bbb3cc4..a939b19 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -193,8 +193,8 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { default => $source } include munin::plugins::scriptpaths - file { "munin_plugin_${name}: - path => "$script_path/$name", + file { "munin_plugin_${name}": + path => "${script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 114b676cec4908441a8cab417f4fb5801994447c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:49:39 +0000 Subject: typo git-svn-id: https://svn/ipuppet/trunk/modules/munin@781 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bbb3cc4..a939b19 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -193,8 +193,8 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { default => $source } include munin::plugins::scriptpaths - file { "munin_plugin_${name}: - path => "$script_path/$name", + file { "munin_plugin_${name}": + path => "${script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 413ee12b603c0af24e990495eb4ec4785b593948 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 10:49:39 +0000 Subject: typo --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bbb3cc4..a939b19 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -193,8 +193,8 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { default => $source } include munin::plugins::scriptpaths - file { "munin_plugin_${name}: - path => "$script_path/$name", + file { "munin_plugin_${name}": + path => "${script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 8fd718da9088395b810b78cf73400482f85513b5 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:54:02 +0000 Subject: plugin(s) git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@782 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a939b19..a36eeaa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,12 +187,12 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source } - include munin::plugins::scriptpaths + include munin::plugin::scriptpaths file { "munin_plugin_${name}": path => "${script_path}/${name}", source => "puppet://$servername/$real_source", @@ -206,10 +206,10 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { } class munin::plugins::dom0 inherits munin::plugins::base { - munin::plugins::deploy { "xen": } - munin::plugins::deploy { "xen-cpu": } - munin::plugins::deploy { "xen_memory": } - munin::plugins::deploy { "xen_vbd": } + munin::plugin::deploy { "xen": } + munin::plugin::deploy { "xen-cpu": } + munin::plugin::deploy { "xen_memory": } + munin::plugin::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -217,11 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - munin::plugins::deploy { "tinydns": } + munin::plugin::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - munin::plugins::deploy { "pg_conn": } - munin::plugins::deploy { "pg__connections": enabled => false } - munin::plugins::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg_conn": } + munin::plugin::deploy { "pg__connections": enabled => false } + munin::plugin::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From de8f419c512b5403ac5d4027a849f76e35124146 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 10:54:02 +0000 Subject: plugin(s) git-svn-id: https://svn/ipuppet/trunk/modules/munin@782 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a939b19..a36eeaa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,12 +187,12 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source } - include munin::plugins::scriptpaths + include munin::plugin::scriptpaths file { "munin_plugin_${name}": path => "${script_path}/${name}", source => "puppet://$servername/$real_source", @@ -206,10 +206,10 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { } class munin::plugins::dom0 inherits munin::plugins::base { - munin::plugins::deploy { "xen": } - munin::plugins::deploy { "xen-cpu": } - munin::plugins::deploy { "xen_memory": } - munin::plugins::deploy { "xen_vbd": } + munin::plugin::deploy { "xen": } + munin::plugin::deploy { "xen-cpu": } + munin::plugin::deploy { "xen_memory": } + munin::plugin::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -217,11 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - munin::plugins::deploy { "tinydns": } + munin::plugin::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - munin::plugins::deploy { "pg_conn": } - munin::plugins::deploy { "pg__connections": enabled => false } - munin::plugins::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg_conn": } + munin::plugin::deploy { "pg__connections": enabled => false } + munin::plugin::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From 48b4e1e0f2005cff9a1d2a0d0236f99018827ac0 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 10:54:02 +0000 Subject: plugin(s) --- manifests/plugin.pp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a939b19..a36eeaa 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -187,12 +187,12 @@ class munin::plugins::selinux inherits munin::plugins::base { plugin{"selinuxenforced": ensure => present;} } -define munin::plugins::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source } - include munin::plugins::scriptpaths + include munin::plugin::scriptpaths file { "munin_plugin_${name}": path => "${script_path}/${name}", source => "puppet://$servername/$real_source", @@ -206,10 +206,10 @@ define munin::plugins::deploy ($source = '', $enabled = 'true') { } class munin::plugins::dom0 inherits munin::plugins::base { - munin::plugins::deploy { "xen": } - munin::plugins::deploy { "xen-cpu": } - munin::plugins::deploy { "xen_memory": } - munin::plugins::deploy { "xen_vbd": } + munin::plugin::deploy { "xen": } + munin::plugin::deploy { "xen-cpu": } + munin::plugin::deploy { "xen_memory": } + munin::plugin::deploy { "xen_vbd": } } class munin::plugins::domU inherits munin::plugins::base { @@ -217,11 +217,11 @@ class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { - munin::plugins::deploy { "tinydns": } + munin::plugin::deploy { "tinydns": } } class munin::plugins::postgres inherits munin::plugins::base { - munin::plugins::deploy { "pg_conn": } - munin::plugins::deploy { "pg__connections": enabled => false } - munin::plugins::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg_conn": } + munin::plugin::deploy { "pg__connections": enabled => false } + munin::plugin::deploy { "pg__locks": enabled => false } } -- cgit v1.2.3 From 1f57144abfa179e508f3877d724bffdb23975c8d Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:12:45 +0000 Subject: bla git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@783 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a36eeaa..c1a9cb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,10 +27,10 @@ define munin::plugin ( { include munin::plugin::scriptpaths - #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -41,7 +41,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "${real_script_path}/${plugin_src}", require => Package['munin-node'], notify => Service['munin-node']; } @@ -82,7 +82,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { munin::plugin { $name: ensure => $ensure, config => $config, - script_path => "/var/lib/puppet/modules/munin/plugins", + script_path_in => "/var/lib/puppet/modules/munin/plugins", } } } @@ -192,9 +192,8 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - include munin::plugin::scriptpaths file { "munin_plugin_${name}": - path => "${script_path}/${name}", + path => "${munin::plugin::scriptpaths::script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 98c15e46bb325d2f18616c5e080f94c47126b113 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:12:45 +0000 Subject: bla git-svn-id: https://svn/ipuppet/trunk/modules/munin@783 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a36eeaa..c1a9cb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,10 +27,10 @@ define munin::plugin ( { include munin::plugin::scriptpaths - #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -41,7 +41,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "${real_script_path}/${plugin_src}", require => Package['munin-node'], notify => Service['munin-node']; } @@ -82,7 +82,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { munin::plugin { $name: ensure => $ensure, config => $config, - script_path => "/var/lib/puppet/modules/munin/plugins", + script_path_in => "/var/lib/puppet/modules/munin/plugins", } } } @@ -192,9 +192,8 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - include munin::plugin::scriptpaths file { "munin_plugin_${name}": - path => "${script_path}/${name}", + path => "${munin::plugin::scriptpaths::script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From a871a342b8cdc7f8ee4ae2cf75f19ac34f2830d3 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 11:12:45 +0000 Subject: bla --- manifests/plugin.pp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a36eeaa..c1a9cb8 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -27,10 +27,10 @@ define munin::plugin ( { include munin::plugin::scriptpaths - #$script_path = $script_path_in ? { '' => $script_path, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -41,7 +41,7 @@ define munin::plugin ( default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "${real_script_path}/${plugin_src}", require => Package['munin-node'], notify => Service['munin-node']; } @@ -82,7 +82,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { munin::plugin { $name: ensure => $ensure, config => $config, - script_path => "/var/lib/puppet/modules/munin/plugins", + script_path_in => "/var/lib/puppet/modules/munin/plugins", } } } @@ -192,9 +192,8 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - include munin::plugin::scriptpaths file { "munin_plugin_${name}": - path => "${script_path}/${name}", + path => "${munin::plugin::scriptpaths::script_path}/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From d9ea3b611d0998bc8e9ae7a64e7b5fb96de3ebcd Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:16:46 +0000 Subject: debug msgs git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@784 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c1a9cb8..ced6795 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -192,6 +192,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } + 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", -- cgit v1.2.3 From 1159cbfcb43ef81a72d7c029e8b25b75cfea4c1b Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:16:46 +0000 Subject: debug msgs git-svn-id: https://svn/ipuppet/trunk/modules/munin@784 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c1a9cb8..ced6795 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -192,6 +192,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } + 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", -- cgit v1.2.3 From 1989191e36ce15adce36a79a074193e10592e627 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 11:16:46 +0000 Subject: debug msgs --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c1a9cb8..ced6795 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -192,6 +192,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } + 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", -- cgit v1.2.3 From fc8598b4f2de1561c58e6429f5011607966a07f3 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Feb 2008 11:26:08 +0000 Subject: new try git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@785 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ced6795..5e0db81 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,11 +26,10 @@ define munin::plugin ( $config = '') { - include munin::plugin::scriptpaths - $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$munin::plugin::scriptpaths::script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -89,8 +88,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::scriptpaths - case $operatingsystem { centos: { file { @@ -192,9 +189,9 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=${munin::plugin::scriptpaths::script_path}" ) + 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}", + path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From 9b983369ce90029a31a06f82b1ec59569ff66bd5 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Feb 2008 11:26:08 +0000 Subject: new try git-svn-id: https://svn/ipuppet/trunk/modules/munin@785 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ced6795..5e0db81 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,11 +26,10 @@ define munin::plugin ( $config = '') { - include munin::plugin::scriptpaths - $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$munin::plugin::scriptpaths::script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -89,8 +88,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::scriptpaths - case $operatingsystem { centos: { file { @@ -192,9 +189,9 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=${munin::plugin::scriptpaths::script_path}" ) + 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}", + path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From cb805d53d162187edd03dcb2de8bfe0122d8fafe Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Feb 2008 11:26:08 +0000 Subject: new try --- manifests/plugin.pp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ced6795..5e0db81 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,11 +26,10 @@ define munin::plugin ( $config = '') { - include munin::plugin::scriptpaths - $real_script_path = $script_path_in ? { '' => ${munin::plugin::scriptpaths::script_path}, default => $script_path_in } + $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=${munin::plugin::scriptpaths::script_path}" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$munin::plugin::scriptpaths::script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -89,8 +88,6 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { - include munin::plugin::scriptpaths - case $operatingsystem { centos: { file { @@ -192,9 +189,9 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "munin/plugins/$name", default => $source } - debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=${munin::plugin::scriptpaths::script_path}" ) + 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}", + path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$servername/$real_source", ensure => file, mode => 0755, owner => root, group => 0; -- cgit v1.2.3 From c04d43692be840d5916ddd2d69d52ee9ea69e8d1 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:31:56 +0000 Subject: include brauchts git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@787 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5e0db81..dfd506f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,6 +26,7 @@ define munin::plugin ( $config = '') { + include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -189,6 +190,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "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}", -- cgit v1.2.3 From d7db3dc055814e340bffe27592730299ce5cd198 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:31:56 +0000 Subject: include brauchts git-svn-id: https://svn/ipuppet/trunk/modules/munin@787 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5e0db81..dfd506f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,6 +26,7 @@ define munin::plugin ( $config = '') { + include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -189,6 +190,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "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}", -- cgit v1.2.3 From 147a647235d39442255f04fbcc654dc1a1b4530d Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 11:31:56 +0000 Subject: include brauchts --- manifests/plugin.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 5e0db81..dfd506f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -26,6 +26,7 @@ define munin::plugin ( $config = '') { + include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } @@ -189,6 +190,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { '' => "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}", -- cgit v1.2.3 From 88c4bca3ff37aec8b51ec0bd32543069ed3110ee Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:38:14 +0000 Subject: restliche plugins git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@788 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index dfd506f..0cd1cb5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -163,26 +163,14 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path/gentoo_lastupdated": - source => "puppet://$servername/munin/plugins/gentoo_lastupdated", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"gentoo_lastupdated": ensure => present;} + munin::plugin::deploy { "gentoo_lastupdated": } } class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path/selinuxenforced": - source => "puppet://$servername/munin/plugins/selinuxenforced", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"selinuxenforced": ensure => present;} + munin::plugin::deploy { "selinuxenforced": } } define munin::plugin::deploy ($source = '', $enabled = 'true') { -- cgit v1.2.3 From 55054d004c779531512da86db4c9040eaa76cf3c Mon Sep 17 00:00:00 2001 From: am Date: Fri, 8 Feb 2008 11:38:14 +0000 Subject: restliche plugins git-svn-id: https://svn/ipuppet/trunk/modules/munin@788 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index dfd506f..0cd1cb5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -163,26 +163,14 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path/gentoo_lastupdated": - source => "puppet://$servername/munin/plugins/gentoo_lastupdated", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"gentoo_lastupdated": ensure => present;} + munin::plugin::deploy { "gentoo_lastupdated": } } class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path/selinuxenforced": - source => "puppet://$servername/munin/plugins/selinuxenforced", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"selinuxenforced": ensure => present;} + munin::plugin::deploy { "selinuxenforced": } } define munin::plugin::deploy ($source = '', $enabled = 'true') { -- cgit v1.2.3 From 0fa11c90e81828c962483d530bbdf1996f7eb1b8 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 8 Feb 2008 11:38:14 +0000 Subject: restliche plugins --- manifests/plugin.pp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index dfd506f..0cd1cb5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -163,26 +163,14 @@ class munin::plugins::vserver inherits munin::plugins::base { } class munin::plugins::gentoo inherits munin::plugins::base { - file { "$script_path/gentoo_lastupdated": - source => "puppet://$servername/munin/plugins/gentoo_lastupdated", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"gentoo_lastupdated": ensure => present;} + munin::plugin::deploy { "gentoo_lastupdated": } } class munin::plugins::centos inherits munin::plugins::base { } class munin::plugins::selinux inherits munin::plugins::base { - file { "$script_path/selinuxenforced": - source => "puppet://$servername/munin/plugins/selinuxenforced", - ensure => file, - mode => 0755, owner => root, group => 0; - } - - plugin{"selinuxenforced": ensure => present;} + munin::plugin::deploy { "selinuxenforced": } } define munin::plugin::deploy ($source = '', $enabled = 'true') { -- cgit v1.2.3 From 644ba84338d4c807a165f33e1af167328ad0d490 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Feb 2008 17:18:23 +0000 Subject: fixed lsb release stuff it should be like that git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@815 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index a1ea92c..9c4b1de 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,5 +13,7 @@ import "host.pp" import "client.pp" import "plugin.pp" -include assert_lsbdistcodename +case $operatingsystem { + debian,ubuntu: { include assert_lsbdistcodename } +} -- cgit v1.2.3 From 322e46b3d2ac0447e5d681491c82df9fbba25292 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Feb 2008 17:18:23 +0000 Subject: fixed lsb release stuff it should be like that git-svn-id: https://svn/ipuppet/trunk/modules/munin@815 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index a1ea92c..9c4b1de 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,5 +13,7 @@ import "host.pp" import "client.pp" import "plugin.pp" -include assert_lsbdistcodename +case $operatingsystem { + debian,ubuntu: { include assert_lsbdistcodename } +} -- cgit v1.2.3 From f94f8faaf36943501ac66eb441d1f2b2d482a103 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Feb 2008 17:18:23 +0000 Subject: fixed lsb release stuff it should be like that --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index a1ea92c..9c4b1de 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,5 +13,7 @@ import "host.pp" import "client.pp" import "plugin.pp" -include assert_lsbdistcodename +case $operatingsystem { + debian,ubuntu: { include assert_lsbdistcodename } +} -- cgit v1.2.3 From 0614f5c5f0f838c0c66d763fac7d17079b3a3cd0 Mon Sep 17 00:00:00 2001 From: am Date: Mon, 10 Mar 2008 13:59:07 +0000 Subject: =?UTF-8?q?*=20iostat=20nur=20f=C3=BCr=20dom0=20*=20firewall=20auf?= =?UTF-8?q?=20shorewall=20war=20deaktiviert=20..=20warum=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1059 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0cd1cb5..e4702c2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -135,7 +135,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { plugin { - [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat ]: -- cgit v1.2.3 From 2ec5c3d5940384a008a3053e4f59454df7b114d4 Mon Sep 17 00:00:00 2001 From: am Date: Mon, 10 Mar 2008 13:59:07 +0000 Subject: =?UTF-8?q?*=20iostat=20nur=20f=C3=BCr=20dom0=20*=20firewall=20auf?= =?UTF-8?q?=20shorewall=20war=20deaktiviert=20..=20warum=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn/ipuppet/trunk/modules/munin@1059 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0cd1cb5..e4702c2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -135,7 +135,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { plugin { - [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat ]: -- cgit v1.2.3 From 8d3a49260d6dbf22346697e2b8d070c3449e7edb Mon Sep 17 00:00:00 2001 From: andreas Date: Mon, 10 Mar 2008 13:59:07 +0000 Subject: =?UTF-8?q?*=20iostat=20nur=20f=C3=BCr=20dom0=20*=20firewall=20auf?= =?UTF-8?q?=20shorewall=20war=20deaktiviert=20..=20warum=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0cd1cb5..e4702c2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -135,7 +135,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { plugin { - [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, + [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat ]: -- cgit v1.2.3 From 00f81a173cbe0887374a09e4df3a2ae4d4007795 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 14:55:24 +0000 Subject: added gutsy link git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1072 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian.gutsy | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian.gutsy diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 039b7118a4ad96b0e404084029255856b7f15034 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 14:55:24 +0000 Subject: added gutsy link git-svn-id: https://svn/ipuppet/trunk/modules/munin@1072 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian.gutsy | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian.gutsy diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From f6e15cc5d19cfc16a087b169208375e4b589534b Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 14:55:24 +0000 Subject: added gutsy link --- templates/munin-node.conf.Debian.gutsy | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian.gutsy diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 7034b942348320bf431f2587eff6309e0ef92b26 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 15:05:24 +0000 Subject: fixed allow stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1073 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian.etch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0673937..0f0f568 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,4 +33,5 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow %> +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> -- cgit v1.2.3 From 096514004dbdda6e9441a744e211a9584a8b84ad Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 15:05:24 +0000 Subject: fixed allow stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@1073 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian.etch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0673937..0f0f568 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,4 +33,5 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow %> +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> -- cgit v1.2.3 From 185c968186f42fc28d719ddeac532185e6aaa172 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Mar 2008 15:05:24 +0000 Subject: fixed allow stuff --- templates/munin-node.conf.Debian.etch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0673937..0f0f568 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,4 +33,5 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow %> +allow <%= munin_allow1 %> +allow <%= munin_allow2 %> -- cgit v1.2.3 From 6c6496bbce75a1424167dba817b9c108da47ac2d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:54:48 +0000 Subject: rearranged some munin stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1081 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 +++++--- manifests/plugin.pp | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 13f3e09..0a65418 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -39,9 +39,6 @@ class munin::client { guest: { include munin::plugins::vserver } default: { include munin::plugins::linux - case $virtual { - xen0: { include munin::plugins::dom0 } - } } } } @@ -49,6 +46,11 @@ class munin::client { err( "Don't know which munin plugins to install for $kernel" ) } } + case $virtual { + physical: { munin::plugins::physical } + xen0: { include munin::plugins::dom0 } + xenu: { include munin::plugins::domU } + } } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e4702c2..81bab27 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -169,10 +169,6 @@ class munin::plugins::gentoo inherits munin::plugins::base { class munin::plugins::centos inherits munin::plugins::base { } -class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } -} - define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", @@ -192,13 +188,17 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { } } -class munin::plugins::dom0 inherits munin::plugins::base { +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": } } +class munin::plugins::physical inherits munin::plugins::base { + munin::plugin { iostat: } +} + class munin::plugins::domU inherits munin::plugins::base { plugin { if_eth0: ensure => "if_" } } -- cgit v1.2.3 From 89ef873f7b1f26e670fb4abc8cadea8e87e76de0 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:54:48 +0000 Subject: rearranged some munin stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@1081 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 8 +++++--- manifests/plugin.pp | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 13f3e09..0a65418 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -39,9 +39,6 @@ class munin::client { guest: { include munin::plugins::vserver } default: { include munin::plugins::linux - case $virtual { - xen0: { include munin::plugins::dom0 } - } } } } @@ -49,6 +46,11 @@ class munin::client { err( "Don't know which munin plugins to install for $kernel" ) } } + case $virtual { + physical: { munin::plugins::physical } + xen0: { include munin::plugins::dom0 } + xenu: { include munin::plugins::domU } + } } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e4702c2..81bab27 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -169,10 +169,6 @@ class munin::plugins::gentoo inherits munin::plugins::base { class munin::plugins::centos inherits munin::plugins::base { } -class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } -} - define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", @@ -192,13 +188,17 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { } } -class munin::plugins::dom0 inherits munin::plugins::base { +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": } } +class munin::plugins::physical inherits munin::plugins::base { + munin::plugin { iostat: } +} + class munin::plugins::domU inherits munin::plugins::base { plugin { if_eth0: ensure => "if_" } } -- cgit v1.2.3 From e3fd671690685c5ebd198c5fd643030290d142d6 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:54:48 +0000 Subject: rearranged some munin stuff --- manifests/client.pp | 8 +++++--- manifests/plugin.pp | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 13f3e09..0a65418 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -39,9 +39,6 @@ class munin::client { guest: { include munin::plugins::vserver } default: { include munin::plugins::linux - case $virtual { - xen0: { include munin::plugins::dom0 } - } } } } @@ -49,6 +46,11 @@ class munin::client { err( "Don't know which munin plugins to install for $kernel" ) } } + case $virtual { + physical: { munin::plugins::physical } + xen0: { include munin::plugins::dom0 } + xenu: { include munin::plugins::domU } + } } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e4702c2..81bab27 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -169,10 +169,6 @@ class munin::plugins::gentoo inherits munin::plugins::base { class munin::plugins::centos inherits munin::plugins::base { } -class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } -} - define munin::plugin::deploy ($source = '', $enabled = 'true') { $real_source = $source ? { '' => "munin/plugins/$name", @@ -192,13 +188,17 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { } } -class munin::plugins::dom0 inherits munin::plugins::base { +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": } } +class munin::plugins::physical inherits munin::plugins::base { + munin::plugin { iostat: } +} + class munin::plugins::domU inherits munin::plugins::base { plugin { if_eth0: ensure => "if_" } } -- cgit v1.2.3 From 274e54bda13b811bf91c9bc3a04b0032d60b1164 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:57:06 +0000 Subject: fixed typo git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1082 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 0a65418..dbf175a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -47,7 +47,7 @@ class munin::client { } } case $virtual { - physical: { munin::plugins::physical } + physical: { include munin::plugins::physical } xen0: { include munin::plugins::dom0 } xenu: { include munin::plugins::domU } } -- cgit v1.2.3 From 1804eec4a2d9d99964373595da00349adc869cac Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:57:06 +0000 Subject: fixed typo git-svn-id: https://svn/ipuppet/trunk/modules/munin@1082 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 0a65418..dbf175a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -47,7 +47,7 @@ class munin::client { } } case $virtual { - physical: { munin::plugins::physical } + physical: { include munin::plugins::physical } xen0: { include munin::plugins::dom0 } xenu: { include munin::plugins::domU } } -- cgit v1.2.3 From 2601cf24698507d2be6e75923b58f8fb40ed2985 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:57:06 +0000 Subject: fixed typo --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 0a65418..dbf175a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -47,7 +47,7 @@ class munin::client { } } case $virtual { - physical: { munin::plugins::physical } + physical: { include munin::plugins::physical } xen0: { include munin::plugins::dom0 } xenu: { include munin::plugins::domU } } -- cgit v1.2.3 From 00aabf0e0b1950b97528d73b2e6906d2b5de00aa Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:58:48 +0000 Subject: removed unnedded definition git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1083 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81bab27..ebf1cd4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,9 +199,7 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } -class munin::plugins::domU inherits munin::plugins::base { - plugin { if_eth0: ensure => "if_" } -} +class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } -- cgit v1.2.3 From 82dc3da0817f5709d6bbc96043c90db4b55b4deb Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:58:48 +0000 Subject: removed unnedded definition git-svn-id: https://svn/ipuppet/trunk/modules/munin@1083 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81bab27..ebf1cd4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,9 +199,7 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } -class munin::plugins::domU inherits munin::plugins::base { - plugin { if_eth0: ensure => "if_" } -} +class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } -- cgit v1.2.3 From b362db6a83161169145b3fac76de75b2f58c7594 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 21 Mar 2008 15:58:48 +0000 Subject: removed unnedded definition --- manifests/plugin.pp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 81bab27..ebf1cd4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,9 +199,7 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } -class munin::plugins::domU inherits munin::plugins::base { - plugin { if_eth0: ensure => "if_" } -} +class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } -- cgit v1.2.3 From aa6516a5dfd34242d1d6a3417c0e03b0d26dcc1e Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:27:08 +0000 Subject: fixed header git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1142 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/selinuxenforced | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced index 2f88b9b..16a3f66 100755 --- a/files/plugins/selinuxenforced +++ b/files/plugins/selinuxenforced @@ -1,14 +1,9 @@ #!/bin/sh # -*- sh -*- # -# Plugin to count the daily amount of Virii (qmailscan) +# Plugin to monitor the status of selinux # -# Contributed by David Obando (david@cryptix.de) - 03.12.2005 -# - -# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: -#LOG0=/var/spool/qmailscan/quarantine.log -#LOG1=/var/spool/qmailscan/quarantine.log.1 +# Contributed by admin(at)immerda.ch if [ "$1" = "autoconf" ]; then echo yes -- cgit v1.2.3 From ef97c202ad675255deb20bdfce59fe03ad757a63 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:27:08 +0000 Subject: fixed header git-svn-id: https://svn/ipuppet/trunk/modules/munin@1142 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/selinuxenforced | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced index 2f88b9b..16a3f66 100755 --- a/files/plugins/selinuxenforced +++ b/files/plugins/selinuxenforced @@ -1,14 +1,9 @@ #!/bin/sh # -*- sh -*- # -# Plugin to count the daily amount of Virii (qmailscan) +# Plugin to monitor the status of selinux # -# Contributed by David Obando (david@cryptix.de) - 03.12.2005 -# - -# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: -#LOG0=/var/spool/qmailscan/quarantine.log -#LOG1=/var/spool/qmailscan/quarantine.log.1 +# Contributed by admin(at)immerda.ch if [ "$1" = "autoconf" ]; then echo yes -- cgit v1.2.3 From 14105f0629c105ffe276807fc2c6adfe84fbdac7 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:27:08 +0000 Subject: fixed header --- files/plugins/selinuxenforced | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced index 2f88b9b..16a3f66 100755 --- a/files/plugins/selinuxenforced +++ b/files/plugins/selinuxenforced @@ -1,14 +1,9 @@ #!/bin/sh # -*- sh -*- # -# Plugin to count the daily amount of Virii (qmailscan) +# Plugin to monitor the status of selinux # -# Contributed by David Obando (david@cryptix.de) - 03.12.2005 -# - -# define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles: -#LOG0=/var/spool/qmailscan/quarantine.log -#LOG1=/var/spool/qmailscan/quarantine.log.1 +# Contributed by admin(at)immerda.ch if [ "$1" = "autoconf" ]; then echo yes -- cgit v1.2.3 From 82b0a8a4fadc3ccd56440f5bb02128e5265d1484 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:47:43 +0000 Subject: merged munin-module with davids git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1143 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 1 + manifests/host.pp | 9 ++++++++- plugins/puppet/parser/functions/muninport.rb | 7 ------- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/manifests/client.pp b/manifests/client.pp index dbf175a..c81e6f4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -74,6 +74,7 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), + tag => 'munin', } } diff --git a/manifests/host.pp b/manifests/host.pp index 844698d..286f5ee 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -6,12 +6,19 @@ class munin::host { package { [ "munin", "nmap"]: ensure => installed, } - File <<||>> + File <<| tag == 'munin' |>> concatenated_file { "/etc/munin/munin.conf": dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } + + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", + "/var/log/munin-graph.log", "/var/log/munin-html.log"]: + ensure => present, + mode => 640, owner => munin, group => 0; + } + } diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/puppet/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - -- cgit v1.2.3 From a969b61bab854b4c4a9bb7f216073dd426514f73 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:47:43 +0000 Subject: merged munin-module with davids git-svn-id: https://svn/ipuppet/trunk/modules/munin@1143 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 1 + manifests/host.pp | 9 ++++++++- plugins/puppet/parser/functions/muninport.rb | 7 ------- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/manifests/client.pp b/manifests/client.pp index dbf175a..c81e6f4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -74,6 +74,7 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), + tag => 'munin', } } diff --git a/manifests/host.pp b/manifests/host.pp index 844698d..286f5ee 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -6,12 +6,19 @@ class munin::host { package { [ "munin", "nmap"]: ensure => installed, } - File <<||>> + File <<| tag == 'munin' |>> concatenated_file { "/etc/munin/munin.conf": dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } + + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", + "/var/log/munin-graph.log", "/var/log/munin-html.log"]: + ensure => present, + mode => 640, owner => munin, group => 0; + } + } diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/puppet/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - -- cgit v1.2.3 From 2051940e6d88d1c7d04df289c0d4873c04dbe020 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 29 Mar 2008 14:47:43 +0000 Subject: merged munin-module with davids --- manifests/client.pp | 1 + manifests/host.pp | 9 ++++++++- plugins/puppet/parser/functions/muninport.rb | 7 ------- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 plugins/puppet/parser/functions/muninport.rb diff --git a/manifests/client.pp b/manifests/client.pp index dbf175a..c81e6f4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -74,6 +74,7 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), + tag => 'munin', } } diff --git a/manifests/host.pp b/manifests/host.pp index 844698d..286f5ee 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -6,12 +6,19 @@ class munin::host { package { [ "munin", "nmap"]: ensure => installed, } - File <<||>> + File <<| tag == 'munin' |>> concatenated_file { "/etc/munin/munin.conf": dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } + + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", + "/var/log/munin-graph.log", "/var/log/munin-html.log"]: + ensure => present, + mode => 640, owner => munin, group => 0; + } + } diff --git a/plugins/puppet/parser/functions/muninport.rb b/plugins/puppet/parser/functions/muninport.rb deleted file mode 100644 index d0b5909..0000000 --- a/plugins/puppet/parser/functions/muninport.rb +++ /dev/null @@ -1,7 +0,0 @@ -# immerda -module Puppet::Parser::Functions - newfunction(:muninport, :type => :rvalue) do |args| - args[0]+65400 - end -end - -- cgit v1.2.3 From 6a780c37ca99d971f6bc36b703bfc8f5ea4113a3 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:34:40 +0000 Subject: added default apache modules git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1152 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/apache_activity | 99 +++++++++++++++++++++++++++++++++++++++++++ manifests/host.pp | 1 + manifests/plugin.pp | 12 ++++++ 3 files changed, 112 insertions(+) create mode 100755 files/plugins/apache_activity diff --git a/files/plugins/apache_activity b/files/plugins/apache_activity new file mode 100755 index 0000000..65fc072 --- /dev/null +++ b/files/plugins/apache_activity @@ -0,0 +1,99 @@ +#!/usr/bin/perl +# +# Parameters supported: +# +# config +# autoconf +# +# Configurable variables +# +# url - Override default status-url +# +# Magic markers: +#%# family=auto +#%# capabilities=autoconf + +my $ret = undef; +if (!eval "require LWP::UserAgent;") { + $ret = "LWP::UserAgent not found"; +} + +my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto"; +my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80); +my %chars = ( + # '\_' => 'Waiting', + # 'S' => 'Starting up', + 'R' => 'Reading request', + 'W' => 'Sending reply', + 'K' => 'Keepalive', + 'D' => 'DNS lookup', + 'C' => 'Closing', + # 'L' => 'Logging', + # 'G' => 'Gracefully finishing', + # 'I' => 'Idle cleanup', + # '\.' => 'Open slot', + ); + +# "_" Waiting for Connection, "S" Starting up, "R" Reading Request, +# "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, +# "C" Closing connection, "L" Logging, "G" Gracefully finishing, +# "I" Idle cleanup of worker, "." Open slot with no current process + +if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { + if ($ret) { + print "no ($ret)\n"; + exit 1; + } + my $ua = LWP::UserAgent->new(timeout => 30); + my @badports; + + foreach my $port (@PORTS) { + my $url = sprintf $URL, $port; + my $response = $ua->request(HTTP::Request->new('GET',$url)); + push @badports, $port unless $response->is_success and $response->content =~ /Scoreboard/im; + } + + if (@badports) { + print "no (no apache server-status on ports @badports)\n"; + exit 1; + } else { + print "yes\n"; + exit 0; + } +} + +if (exists $ARGV[0] and $ARGV[0] eq "config") { + print "graph_title Apache activity\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category apache\n"; + print "graph_vlabel processes\n"; + foreach my $port (@PORTS) { + while (my ($char, $val) = each (%chars)) { + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.label "; + print $val, "\n"; + print "activity_${port}_${char}.type GAUGE\n"; + } + } + exit 0; +} + +foreach my $port (@PORTS) { + my $ua = LWP::UserAgent->new (timeout => 30); + my $url = sprintf $URL, $port; + my $response = $ua->request (HTTP::Request->new('GET',$url)); + if ($response->content =~ /^Scoreboard\:\s?(.*)$/sm) { + my $string = $1; + chomp $string; + my @act = split (//, $string); + foreach my $char (keys (%chars)) { + my $num = scalar (grep (/$char/, @act)); + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.value $num\n"; + } + } +} + + diff --git a/manifests/host.pp b/manifests/host.pp index 286f5ee..3ae6065 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,6 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } + munin::plugins::djbdns } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ebf1cd4..8a76df4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,12 +199,24 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } +class munin::plugins::muninhost inherits munin::plugins::base { + munin::plugin { munin_update: } + munin::plugin { munin_graph: } +} + class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } } +class munin::plugins::apache inherits munin::plugins::base { + munin::plugin::deploy { "apache_accesses": } + munin::plugin::deploy { "apache_processes": } + munin::plugin::deploy { "apache_volume": } + munin::plugin::deploy { "apache_activity": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From bb8699288512aa2d1de7ad12b0420146f8daabfd Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:34:40 +0000 Subject: added default apache modules git-svn-id: https://svn/ipuppet/trunk/modules/munin@1152 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/apache_activity | 99 +++++++++++++++++++++++++++++++++++++++++++ manifests/host.pp | 1 + manifests/plugin.pp | 12 ++++++ 3 files changed, 112 insertions(+) create mode 100755 files/plugins/apache_activity diff --git a/files/plugins/apache_activity b/files/plugins/apache_activity new file mode 100755 index 0000000..65fc072 --- /dev/null +++ b/files/plugins/apache_activity @@ -0,0 +1,99 @@ +#!/usr/bin/perl +# +# Parameters supported: +# +# config +# autoconf +# +# Configurable variables +# +# url - Override default status-url +# +# Magic markers: +#%# family=auto +#%# capabilities=autoconf + +my $ret = undef; +if (!eval "require LWP::UserAgent;") { + $ret = "LWP::UserAgent not found"; +} + +my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto"; +my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80); +my %chars = ( + # '\_' => 'Waiting', + # 'S' => 'Starting up', + 'R' => 'Reading request', + 'W' => 'Sending reply', + 'K' => 'Keepalive', + 'D' => 'DNS lookup', + 'C' => 'Closing', + # 'L' => 'Logging', + # 'G' => 'Gracefully finishing', + # 'I' => 'Idle cleanup', + # '\.' => 'Open slot', + ); + +# "_" Waiting for Connection, "S" Starting up, "R" Reading Request, +# "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, +# "C" Closing connection, "L" Logging, "G" Gracefully finishing, +# "I" Idle cleanup of worker, "." Open slot with no current process + +if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { + if ($ret) { + print "no ($ret)\n"; + exit 1; + } + my $ua = LWP::UserAgent->new(timeout => 30); + my @badports; + + foreach my $port (@PORTS) { + my $url = sprintf $URL, $port; + my $response = $ua->request(HTTP::Request->new('GET',$url)); + push @badports, $port unless $response->is_success and $response->content =~ /Scoreboard/im; + } + + if (@badports) { + print "no (no apache server-status on ports @badports)\n"; + exit 1; + } else { + print "yes\n"; + exit 0; + } +} + +if (exists $ARGV[0] and $ARGV[0] eq "config") { + print "graph_title Apache activity\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category apache\n"; + print "graph_vlabel processes\n"; + foreach my $port (@PORTS) { + while (my ($char, $val) = each (%chars)) { + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.label "; + print $val, "\n"; + print "activity_${port}_${char}.type GAUGE\n"; + } + } + exit 0; +} + +foreach my $port (@PORTS) { + my $ua = LWP::UserAgent->new (timeout => 30); + my $url = sprintf $URL, $port; + my $response = $ua->request (HTTP::Request->new('GET',$url)); + if ($response->content =~ /^Scoreboard\:\s?(.*)$/sm) { + my $string = $1; + chomp $string; + my @act = split (//, $string); + foreach my $char (keys (%chars)) { + my $num = scalar (grep (/$char/, @act)); + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.value $num\n"; + } + } +} + + diff --git a/manifests/host.pp b/manifests/host.pp index 286f5ee..3ae6065 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,6 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } + munin::plugins::djbdns } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ebf1cd4..8a76df4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,12 +199,24 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } +class munin::plugins::muninhost inherits munin::plugins::base { + munin::plugin { munin_update: } + munin::plugin { munin_graph: } +} + class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } } +class munin::plugins::apache inherits munin::plugins::base { + munin::plugin::deploy { "apache_accesses": } + munin::plugin::deploy { "apache_processes": } + munin::plugin::deploy { "apache_volume": } + munin::plugin::deploy { "apache_activity": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From d6783519aae52160c3e5448728c443e24ad7f45c Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:34:40 +0000 Subject: added default apache modules --- files/plugins/apache_activity | 99 +++++++++++++++++++++++++++++++++++++++++++ manifests/host.pp | 1 + manifests/plugin.pp | 12 ++++++ 3 files changed, 112 insertions(+) create mode 100755 files/plugins/apache_activity diff --git a/files/plugins/apache_activity b/files/plugins/apache_activity new file mode 100755 index 0000000..65fc072 --- /dev/null +++ b/files/plugins/apache_activity @@ -0,0 +1,99 @@ +#!/usr/bin/perl +# +# Parameters supported: +# +# config +# autoconf +# +# Configurable variables +# +# url - Override default status-url +# +# Magic markers: +#%# family=auto +#%# capabilities=autoconf + +my $ret = undef; +if (!eval "require LWP::UserAgent;") { + $ret = "LWP::UserAgent not found"; +} + +my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://127.0.0.1:%d/server-status?auto"; +my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (80); +my %chars = ( + # '\_' => 'Waiting', + # 'S' => 'Starting up', + 'R' => 'Reading request', + 'W' => 'Sending reply', + 'K' => 'Keepalive', + 'D' => 'DNS lookup', + 'C' => 'Closing', + # 'L' => 'Logging', + # 'G' => 'Gracefully finishing', + # 'I' => 'Idle cleanup', + # '\.' => 'Open slot', + ); + +# "_" Waiting for Connection, "S" Starting up, "R" Reading Request, +# "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, +# "C" Closing connection, "L" Logging, "G" Gracefully finishing, +# "I" Idle cleanup of worker, "." Open slot with no current process + +if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { + if ($ret) { + print "no ($ret)\n"; + exit 1; + } + my $ua = LWP::UserAgent->new(timeout => 30); + my @badports; + + foreach my $port (@PORTS) { + my $url = sprintf $URL, $port; + my $response = $ua->request(HTTP::Request->new('GET',$url)); + push @badports, $port unless $response->is_success and $response->content =~ /Scoreboard/im; + } + + if (@badports) { + print "no (no apache server-status on ports @badports)\n"; + exit 1; + } else { + print "yes\n"; + exit 0; + } +} + +if (exists $ARGV[0] and $ARGV[0] eq "config") { + print "graph_title Apache activity\n"; + print "graph_args --base 1000 -l 0\n"; + print "graph_category apache\n"; + print "graph_vlabel processes\n"; + foreach my $port (@PORTS) { + while (my ($char, $val) = each (%chars)) { + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.label "; + print $val, "\n"; + print "activity_${port}_${char}.type GAUGE\n"; + } + } + exit 0; +} + +foreach my $port (@PORTS) { + my $ua = LWP::UserAgent->new (timeout => 30); + my $url = sprintf $URL, $port; + my $response = $ua->request (HTTP::Request->new('GET',$url)); + if ($response->content =~ /^Scoreboard\:\s?(.*)$/sm) { + my $string = $1; + chomp $string; + my @act = split (//, $string); + foreach my $char (keys (%chars)) { + my $num = scalar (grep (/$char/, @act)); + $char =~ s/\\\./dot/; + $char =~ s/\\\_/underline/; + print "activity_${port}_${char}.value $num\n"; + } + } +} + + diff --git a/manifests/host.pp b/manifests/host.pp index 286f5ee..3ae6065 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,6 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } + munin::plugins::djbdns } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ebf1cd4..8a76df4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -199,12 +199,24 @@ class munin::plugins::physical inherits munin::plugins::base { munin::plugin { iostat: } } +class munin::plugins::muninhost inherits munin::plugins::base { + munin::plugin { munin_update: } + munin::plugin { munin_graph: } +} + class munin::plugins::domU inherits munin::plugins::base { } class munin::plugins::djbdns inherits munin::plugins::base { munin::plugin::deploy { "tinydns": } } +class munin::plugins::apache inherits munin::plugins::base { + munin::plugin::deploy { "apache_accesses": } + munin::plugin::deploy { "apache_processes": } + munin::plugin::deploy { "apache_volume": } + munin::plugin::deploy { "apache_activity": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From 54fb667a287550bc45dff13aa62707f504ba26c5 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:49:13 +0000 Subject: added selinux plugins git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1153 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8a76df4..39e9742 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -148,18 +148,14 @@ class munin::plugins::linux inherits munin::plugins::base { } class munin::plugins::debian inherits munin::plugins::base { - plugin { apt_all: ensure => present; } - } class munin::plugins::vserver inherits munin::plugins::base { - plugin { [ netstat, processes ]: ensure => present; } - } class munin::plugins::gentoo inherits munin::plugins::base { @@ -217,6 +213,11 @@ class munin::plugins::apache inherits munin::plugins::base { munin::plugin::deploy { "apache_activity": } } +class munin::plugins::selinux inherits munin::plugins::base { + munin::plugin::deploy { "selinuxenforced": } + munin::plugin::deploy { "selinux_avcstats": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From 060befb2e08b5419d7cb90ad9ff80d72ef3b1889 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:49:13 +0000 Subject: added selinux plugins git-svn-id: https://svn/ipuppet/trunk/modules/munin@1153 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8a76df4..39e9742 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -148,18 +148,14 @@ class munin::plugins::linux inherits munin::plugins::base { } class munin::plugins::debian inherits munin::plugins::base { - plugin { apt_all: ensure => present; } - } class munin::plugins::vserver inherits munin::plugins::base { - plugin { [ netstat, processes ]: ensure => present; } - } class munin::plugins::gentoo inherits munin::plugins::base { @@ -217,6 +213,11 @@ class munin::plugins::apache inherits munin::plugins::base { munin::plugin::deploy { "apache_activity": } } +class munin::plugins::selinux inherits munin::plugins::base { + munin::plugin::deploy { "selinuxenforced": } + munin::plugin::deploy { "selinux_avcstats": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From ead83e0c99b06c3f0f05a1e9adb587b79b817212 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:49:13 +0000 Subject: added selinux plugins --- manifests/plugin.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8a76df4..39e9742 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -148,18 +148,14 @@ class munin::plugins::linux inherits munin::plugins::base { } class munin::plugins::debian inherits munin::plugins::base { - plugin { apt_all: ensure => present; } - } class munin::plugins::vserver inherits munin::plugins::base { - plugin { [ netstat, processes ]: ensure => present; } - } class munin::plugins::gentoo inherits munin::plugins::base { @@ -217,6 +213,11 @@ class munin::plugins::apache inherits munin::plugins::base { munin::plugin::deploy { "apache_activity": } } +class munin::plugins::selinux inherits munin::plugins::base { + munin::plugin::deploy { "selinuxenforced": } + munin::plugin::deploy { "selinux_avcstats": } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": enabled => false } -- cgit v1.2.3 From 2112eb880d053bc7e363e8bf3187f5884baa7200 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:51:13 +0000 Subject: fixed typo git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1154 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/host.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 3ae6065..4625ba9 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,8 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } - munin::plugins::djbdns - + include munin::plugins::muninhost } class munin::snmp_collector -- cgit v1.2.3 From e76dd0c92ee5d4dae78ef59013255339bf48e331 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:51:13 +0000 Subject: fixed typo git-svn-id: https://svn/ipuppet/trunk/modules/munin@1154 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/host.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 3ae6065..4625ba9 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,8 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } - munin::plugins::djbdns - + include munin::plugins::muninhost } class munin::snmp_collector -- cgit v1.2.3 From d68e2e9a2b9808bd99af8002933e5d3c017ea5e8 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 30 Mar 2008 17:51:13 +0000 Subject: fixed typo --- manifests/host.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 3ae6065..4625ba9 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,8 +19,7 @@ class munin::host mode => 640, owner => munin, group => 0; } - munin::plugins::djbdns - + include munin::plugins::muninhost } class munin::snmp_collector -- cgit v1.2.3 From 3ece0ea0046a03f7e9b6c84b91b849479ce5c44f Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 14:12:53 +0000 Subject: extending apache to centos usage, vhost and crypto stuff on immer8 and class to enable server-status for munin-plugins, where not yet done git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1212 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 39e9742..bc9f00c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -207,6 +207,7 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { + include apache::status munin::plugin::deploy { "apache_accesses": } munin::plugin::deploy { "apache_processes": } munin::plugin::deploy { "apache_volume": } -- cgit v1.2.3 From 13574dc22d09138b40433ff906efc2ab4895553e Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 14:12:53 +0000 Subject: extending apache to centos usage, vhost and crypto stuff on immer8 and class to enable server-status for munin-plugins, where not yet done git-svn-id: https://svn/ipuppet/trunk/modules/munin@1212 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 39e9742..bc9f00c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -207,6 +207,7 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { + include apache::status munin::plugin::deploy { "apache_accesses": } munin::plugin::deploy { "apache_processes": } munin::plugin::deploy { "apache_volume": } -- cgit v1.2.3 From b3ec072deaadf33b19b2ddbf22b1448fdf4532fe Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 14:12:53 +0000 Subject: extending apache to centos usage, vhost and crypto stuff on immer8 and class to enable server-status for munin-plugins, where not yet done --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 39e9742..bc9f00c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -207,6 +207,7 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { + include apache::status munin::plugin::deploy { "apache_accesses": } munin::plugin::deploy { "apache_processes": } munin::plugin::deploy { "apache_volume": } -- cgit v1.2.3 From 225e30cc5afa6d6cf4cf87e83b58d34f76b065bc Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 15:02:34 +0000 Subject: fixed uneeded deployment and directories git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1217 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc9f00c..dbf8eb1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -208,9 +208,9 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::apache inherits munin::plugins::base { include apache::status - munin::plugin::deploy { "apache_accesses": } - munin::plugin::deploy { "apache_processes": } - munin::plugin::deploy { "apache_volume": } + munin::plugin{ "apache_accesses": } + munin::plugin{ "apache_processes": } + munin::plugin{ "apache_volume": } munin::plugin::deploy { "apache_activity": } } -- cgit v1.2.3 From 6ae8a3c99f66f63c51eb76fc9b3e4b49273c5b2c Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 15:02:34 +0000 Subject: fixed uneeded deployment and directories git-svn-id: https://svn/ipuppet/trunk/modules/munin@1217 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc9f00c..dbf8eb1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -208,9 +208,9 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::apache inherits munin::plugins::base { include apache::status - munin::plugin::deploy { "apache_accesses": } - munin::plugin::deploy { "apache_processes": } - munin::plugin::deploy { "apache_volume": } + munin::plugin{ "apache_accesses": } + munin::plugin{ "apache_processes": } + munin::plugin{ "apache_volume": } munin::plugin::deploy { "apache_activity": } } -- cgit v1.2.3 From 6783f2aa339ab707f533b5c048ea2abb7a105806 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 12 Apr 2008 15:02:34 +0000 Subject: fixed uneeded deployment and directories --- manifests/plugin.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index bc9f00c..dbf8eb1 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -208,9 +208,9 @@ class munin::plugins::djbdns inherits munin::plugins::base { class munin::plugins::apache inherits munin::plugins::base { include apache::status - munin::plugin::deploy { "apache_accesses": } - munin::plugin::deploy { "apache_processes": } - munin::plugin::deploy { "apache_volume": } + munin::plugin{ "apache_accesses": } + munin::plugin{ "apache_processes": } + munin::plugin{ "apache_volume": } munin::plugin::deploy { "apache_activity": } } -- cgit v1.2.3 From ea3630a1c8c975ceb27ca1547f0a88eb48e05e42 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 13 Apr 2008 17:15:48 +0000 Subject: not needed as this make it appear everywhere the exim stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1222 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/defaultclient.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index 954a0cb..ddce1bb 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,4 +11,3 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes - exim_mailstats.graph_period minute -- cgit v1.2.3 From 3de81e20f12d274efb0352693e394e98c1484c2b Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 13 Apr 2008 17:15:48 +0000 Subject: not needed as this make it appear everywhere the exim stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@1222 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/defaultclient.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index 954a0cb..ddce1bb 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,4 +11,3 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes - exim_mailstats.graph_period minute -- cgit v1.2.3 From 07e3c54dc265b53028a997565f207b06b85a4146 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 13 Apr 2008 17:15:48 +0000 Subject: not needed as this make it appear everywhere the exim stuff --- templates/defaultclient.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index 954a0cb..ddce1bb 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,4 +11,3 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes - exim_mailstats.graph_period minute -- cgit v1.2.3 From a487e3e628ce1acf256b8d21bdbd60c84f173154 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:47:24 +0000 Subject: rearranged some definitions, fixed config issues git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1229 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 56 ++++++++++++++++++++++++++++++----------------------- 1 file 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 # 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 { -- cgit v1.2.3 From 8b017ab9ff19f9a3773603fc33cc3820ec730c9e Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:47:24 +0000 Subject: rearranged some definitions, fixed config issues git-svn-id: https://svn/ipuppet/trunk/modules/munin@1229 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 56 ++++++++++++++++++++++++++++++----------------------- 1 file 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 # 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 { -- cgit v1.2.3 From 01ec99817ecf48a813a90de36443dc8a9fd45932 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:47:24 +0000 Subject: rearranged some definitions, fixed config issues --- manifests/plugin.pp | 56 ++++++++++++++++++++++++++++++----------------------- 1 file 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 # 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 { -- cgit v1.2.3 From 5c16fb7eb59192b1c0c0ccb7569d7245ce5d2017 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:49:00 +0000 Subject: added load borders git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1230 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/defaultclient.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index ddce1bb..5611bf4 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,3 +11,5 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes + load.load.warning 5 + load.load.critical 10 -- cgit v1.2.3 From f64b68757b2a26e77628060fe255cf1de3b2c0cb Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:49:00 +0000 Subject: added load borders git-svn-id: https://svn/ipuppet/trunk/modules/munin@1230 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/defaultclient.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index ddce1bb..5611bf4 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,3 +11,5 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes + load.load.warning 5 + load.load.critical 10 -- cgit v1.2.3 From b6a92599a27cd0bdb4b97105fdf14286fed86329 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 11:49:00 +0000 Subject: added load borders --- templates/defaultclient.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index ddce1bb..5611bf4 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,3 +11,5 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes + load.load.warning 5 + load.load.critical 10 -- cgit v1.2.3 From 306da2135a4ef7025ed7a3aaa766ef6c71af7701 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 12:04:59 +0000 Subject: fixed params and made it more all the same way git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1231 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 782f9f2..97bcbf3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -92,7 +92,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } } -define munin::plugin::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -106,9 +106,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { mode => 0755, owner => root, group => 0; } - if $enabled { - plugin{$name: ensure => present } - } + munin::plugin{$name: ensure => $ensure, config => $config } } ### clases for plugins -- cgit v1.2.3 From 4b66892e98b993264e396b95a641c744a95c83c3 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 12:04:59 +0000 Subject: fixed params and made it more all the same way git-svn-id: https://svn/ipuppet/trunk/modules/munin@1231 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 782f9f2..97bcbf3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -92,7 +92,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } } -define munin::plugin::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -106,9 +106,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { mode => 0755, owner => root, group => 0; } - if $enabled { - plugin{$name: ensure => present } - } + munin::plugin{$name: ensure => $ensure, config => $config } } ### clases for plugins -- cgit v1.2.3 From 74463978e6be2d3e15d30358f40bf102851f5745 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 12:04:59 +0000 Subject: fixed params and made it more all the same way --- manifests/plugin.pp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 782f9f2..97bcbf3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -92,7 +92,7 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } } -define munin::plugin::deploy ($source = '', $enabled = 'true') { +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { $real_source = $source ? { '' => "munin/plugins/$name", default => $source @@ -106,9 +106,7 @@ define munin::plugin::deploy ($source = '', $enabled = 'true') { mode => 0755, owner => root, group => 0; } - if $enabled { - plugin{$name: ensure => present } - } + munin::plugin{$name: ensure => $ensure, config => $config } } ### clases for plugins -- cgit v1.2.3 From 5a6aeb1967758fb6d504b996fd3d061e6c2725f7 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 14:51:32 +0000 Subject: fixed renaming git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1236 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97bcbf3..2b66ce2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -227,6 +227,6 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": enabled => false } - munin::plugin::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg__connections": ensure => false } + munin::plugin::deploy { "pg__locks": ensure => false } } -- cgit v1.2.3 From ebe1a5fdc83e550529fb11f6dd136bda38a0c689 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 14:51:32 +0000 Subject: fixed renaming git-svn-id: https://svn/ipuppet/trunk/modules/munin@1236 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97bcbf3..2b66ce2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -227,6 +227,6 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": enabled => false } - munin::plugin::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg__connections": ensure => false } + munin::plugin::deploy { "pg__locks": ensure => false } } -- cgit v1.2.3 From 3edac04b0cdb7b94c439a6224b25028651285aa5 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2008 14:51:32 +0000 Subject: fixed renaming --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 97bcbf3..2b66ce2 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -227,6 +227,6 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": enabled => false } - munin::plugin::deploy { "pg__locks": enabled => false } + munin::plugin::deploy { "pg__connections": ensure => false } + munin::plugin::deploy { "pg__locks": ensure => false } } -- cgit v1.2.3 From ebdcae0d53a7ee50e2abb2f6606f731cb76c83e8 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 11:28:54 +0200 Subject: empty module $MODULENAME --- files/.git_placeholder | 1 + manifests/init.pp | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 files/.git_placeholder create mode 100644 manifests/init.pp diff --git a/files/.git_placeholder b/files/.git_placeholder new file mode 100644 index 0000000..89cb1fe --- /dev/null +++ b/files/.git_placeholder @@ -0,0 +1 @@ +# file needed for git - don't remove it diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..c4c4db0 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,9 @@ +####################################### +# munin module +# Puzzle ITC - haerry+puppet(at)puzzle.ch +# GPLv3 +####################################### + + +# modules_dir { "munin": } +class munin {} -- cgit v1.2.3 From 4014ccdfea44498e8abd51a33073e0c5ecde0c36 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 11:52:31 +0200 Subject: merged last things --- manifests/init.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e1f62a6..6b6cd08 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,12 +1,8 @@ # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -<<<<<<< HEAD:manifests/init.pp # adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch # -======= - ->>>>>>> immerda/master:manifests/init.pp # the port is a parameter so vservers can share IP addresses and still be happy # Define where the individual nodes' configs are stored -- cgit v1.2.3 From 8e503cf77c5f5390e6502688a341b3f2a32e0baa Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 14:24:48 +0200 Subject: fixed status way --- manifests/plugin.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b66ce2..6eaa518 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -213,7 +213,6 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { - include apache::status munin::plugin{ "apache_accesses": } munin::plugin{ "apache_processes": } munin::plugin{ "apache_volume": } -- cgit v1.2.3 From c6f6cca89f7a89b5ba72b0bd65e469c93e3cf3ce Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 15:01:48 +0200 Subject: added nagios class --- manifests/plugin.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6eaa518..36773ee 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -229,3 +229,11 @@ class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg__connections": ensure => false } munin::plugin::deploy { "pg__locks": ensure => false } } +class munin::plugins::nagios inherits munin::plugins::base { + munin::plugin { + nagios_hosts: script_path => "/usr/local/bin", config => 'user root'; + nagios_svc: script_path => "/usr/local/bin", config => 'user root'; + nagios_perf_hosts: ensure => nagios_perf_, script_path => "/usr/local/bin", config => 'user root'; + nagios_perf_svc: ensure => nagios_perf_, script_path => "/usr/local/bin", config => 'user root'; + } +} -- cgit v1.2.3 From fd83ae45a94213366b069b1e0278868129430006 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 15:31:37 +0200 Subject: added nagios plugins --- files/plugins/nagios_hosts | 28 ++++++++++++++++++++++++++++ files/plugins/nagios_perf_ | 35 +++++++++++++++++++++++++++++++++++ files/plugins/nagios_svc | 33 +++++++++++++++++++++++++++++++++ manifests/plugin.pp | 10 +++++----- 4 files changed, 101 insertions(+), 5 deletions(-) create mode 100755 files/plugins/nagios_hosts create mode 100755 files/plugins/nagios_perf_ create mode 100755 files/plugins/nagios_svc diff --git a/files/plugins/nagios_hosts b/files/plugins/nagios_hosts new file mode 100755 index 0000000..04fe8ed --- /dev/null +++ b/files/plugins/nagios_hosts @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios host stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel hosts' + echo 'graph_category nagios' + echo 'graph_info The number of hosts checked by nagios' + echo 'up.label up' + echo 'up.draw AREA' + echo 'up.info number of hosts UP' + echo 'down.label down' + echo 'down.draw STACK' + echo 'down.info number of hosts DOWN' + echo 'unr.label unr' + echo 'unr.draw STACK' + echo 'unr.info number of hosts UNREACHABLE' + + exit 0 +fi + +echo -n 'up.value ' +nagios2stats --mrtg --data NUMHSTUP +echo -n 'down.value ' +nagios2stats --mrtg --data NUMHSTDOWN +echo -n 'unr.value ' +nagios2stats --mrtg --data NUMHSTUNR + diff --git a/files/plugins/nagios_perf_ b/files/plugins/nagios_perf_ new file mode 100755 index 0000000..f819def --- /dev/null +++ b/files/plugins/nagios_perf_ @@ -0,0 +1,35 @@ +#!/bin/bash + +NAME=$(basename $0) + +TYPE=${NAME##nagios_perf_} + +[ "x$TYPE" = 'xhosts' ] && TYPE_ABBR=HST +[ "x$TYPE" = 'xsvc' ] && TYPE_ABBR=SVC +[ -z "$TYPE_ABBR" ] && echo "unknown type $TYPE" >&2 && exit 1 + +if [ "$1" = "config" ]; then + echo "graph_title Nagios $TYPE performance stats" + echo "graph_args --base 1000" + echo "graph_vlabel seconds" + echo "graph_category nagios" + echo "graph_info Check performance statistics" + + echo "act_lat_$TYPE_ABBR.label act lat" + echo "act_lat_$TYPE_ABBR.type GAUGE" + echo "act_lat_$TYPE_ABBR.draw AREA" + echo "act_lat_$TYPE_ABBR.cdef act_lat_$TYPE_ABBR,1000,/" + echo "act_lat_$TYPE_ABBR.info average latency of active checks over the last 5 minutes" + + echo "act_ext_$TYPE_ABBR.label act ext" + echo "act_ext_$TYPE_ABBR.type GAUGE" + echo "act_ext_$TYPE_ABBR.draw LINE1" + echo "act_ext_$TYPE_ABBR.cdef act_ext_$TYPE_ABBR,1000,/" + echo "act_ext_$TYPE_ABBR.info average execution time of active checks over the last 5 minutes" + + exit 0 +fi + +echo "act_lat_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}EXT) + diff --git a/files/plugins/nagios_svc b/files/plugins/nagios_svc new file mode 100755 index 0000000..3938999 --- /dev/null +++ b/files/plugins/nagios_svc @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios service stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel services' + echo 'graph_category nagios' + echo 'graph_info The number of services checked by nagios' + echo 'ok.label ok' + echo 'ok.draw AREA' + echo 'ok.info number of services OK' + echo 'warn.label warn' + echo 'warn.draw STACK' + echo 'warn.info number of services WARNING' + echo 'crit.label crit' + echo 'crit.draw STACK' + echo 'crit.info number of services CRITICAL' + echo 'unkn.label unkn' + echo 'unkn.draw STACK' + echo 'unkn.info number of services UNKNOWN' + + exit 0 +fi + +echo -n 'ok.value ' +nagios2stats --mrtg --data NUMSVCOK +echo -n 'warn.value ' +nagios2stats --mrtg --data NUMSVCWARN +echo -n 'crit.value ' +nagios2stats --mrtg --data NUMSVCCRIT +echo -n 'unkn.value ' +nagios2stats --mrtg --data NUMSVCUNKN + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 36773ee..40e7f47 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -230,10 +230,10 @@ class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg__locks": ensure => false } } class munin::plugins::nagios inherits munin::plugins::base { - munin::plugin { - nagios_hosts: script_path => "/usr/local/bin", config => 'user root'; - nagios_svc: script_path => "/usr/local/bin", config => 'user root'; - nagios_perf_hosts: ensure => nagios_perf_, script_path => "/usr/local/bin", config => 'user root'; - nagios_perf_svc: ensure => nagios_perf_, script_path => "/usr/local/bin", config => 'user root'; + 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'; } } -- cgit v1.2.3 From 70e9b0703c41ebbd7f9902488f41c3d90e77981a Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 15:41:02 +0200 Subject: added new xen plugin --- files/plugins/xen_traffic_all | 63 +++++++++++++++++++++++++++++++++++++++++++ manifests/plugin.pp | 1 + 2 files changed, 64 insertions(+) create mode 100644 files/plugins/xen_traffic_all diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all new file mode 100644 index 0000000..1216a7d --- /dev/null +++ b/files/plugins/xen_traffic_all @@ -0,0 +1,63 @@ +#!/bin/sh +# Author: mario manno +# Description: measure traffic for all xen hosts +# +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + else + echo "no (xm not found)" + exit 1 + fi + if [ -r /proc/net/dev ]; then + echo yes + else + echo "no (/proc/net/dev not found)" + exit 1 + fi + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title Xen Traffic' + echo 'graph_vlabel bits received (-) / sent (+) per ${graph_period}' + echo 'graph_args --base 1024 -l 0' + echo 'graph_category xen' + DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") + for dom in $DOMAINS; do + name=$( echo $dom | sed -e's/-/_/g' ) + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" + + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done + exit 0 +fi + +DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") +for dom in $DOMAINS; do + dev=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + name=$( echo $dom | sed -e's/-/_/g' ) + #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ + #'{ sub(/^ */,""); if ($1 == interface) \ + #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev +done + diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 40e7f47..d7fad3d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -195,6 +195,7 @@ class munin::plugins::dom0 inherits munin::plugins::physical { munin::plugin::deploy { "xen-cpu": config => "user root"} munin::plugin::deploy { "xen_memory": config => "user root"} munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } class munin::plugins::physical inherits munin::plugins::base { -- cgit v1.2.3 From 7a059412363908e454d96af9c2a4e879bb2a4620 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 16:17:56 +0200 Subject: refactore base client class --- manifests/client.pp | 160 +++++++++++++++------------------------------------- manifests/plugin.pp | 15 +++++ 2 files changed, 59 insertions(+), 116 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 2d13d24..c5b8969 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -11,46 +11,15 @@ class munin::client { default => $munin_host } - case $operatingsystem { - darwin: { include munin::client::darwin } - debian: { - include munin::client::debian - include munin::plugins::debian - } - ubuntu: { - info ( "Trying to configure Ubuntu's munin with Debian class" ) - include munin::client::debian - include munin::plugins::debian - } - gentoo: { - include munin::client::gentoo - include munin::plugins::gentoo - } - centos: { - include munin::client::centos - include munin::plugins::centos - } - default: { fail ("Don't know how to handle munin on $operatingsystem") } - } - - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } - default: { - err( "Don't know which munin plugins to install for $kernel" ) - } - } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } - xenu: { include munin::plugins::domU } + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { include munin::client::debian } + ubuntu: { include munin::client::ubuntu } + centos: { include munin::client::centos } + gentoo: { include munin::client::gentoo } + default: { include munin::client:: base } } + } define munin::register() @@ -78,8 +47,30 @@ define munin::register_snmp() } } -class munin::client::darwin -{ +class munin::client:: base { + package { "munin-node": ensure => installed } + service { "munin-node": + ensure => running, + hasstatus => true, + hasrestart => true, + require => Package[munin-node], + } + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => 0; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + mode => 0644, owner => root, group => 0, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + } + munin::register { $fqdn: } + include munin::plugins::base +} + +class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), @@ -101,93 +92,30 @@ class munin::client::darwin munin::register_snmp { $fqdn: } } -class munin::client::debian -{ - package { "munin-node": ensure => installed } +class munin::client::debian inherits munin::client::base { # the plugin will need that package { "iproute": ensure => installed } - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, + Service["munin-node"]: # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } - - munin::register { $fqdn: } - # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } -class munin::client::gentoo -{ - $acpi_available = "absent" - package { 'munin-node': - name => 'munin', - ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, - } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - # notify => Service["munin"], - } - - service { "munin-node": - ensure => running, - } +class munin::client::ubuntu inherits munin::client::debian {} - munin::register { $fqdn: } -} - -class munin::client::centos -{ - package { 'munin-node': - ensure => present, +class munin::client::gentoo inherits munin::client::base { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', } + include munin::plugins::gentoo +} - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group =>0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } - +class munin::client::centos inherits munin::client::base { + include munin::plugins::centos } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d7fad3d..aec1951 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -142,6 +142,21 @@ class munin::plugins::base { } } } + 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 } + xenu: { include munin::plugins::domU } + } } # handle if_ and if_err_ plugins -- cgit v1.2.3 From 6764234701c49349d25105642202aaee5a380e1b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 16:32:30 +0200 Subject: fixed typo --- manifests/client.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index c5b8969..143046c 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -17,9 +17,8 @@ class munin::client { ubuntu: { include munin::client::ubuntu } centos: { include munin::client::centos } gentoo: { include munin::client::gentoo } - default: { include munin::client:: base } + default: { include munin::client::base } } - } define munin::register() -- cgit v1.2.3 From 6413032228f89698c27fa33ef73e19bafe689d1b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 16:34:08 +0200 Subject: fixed typo --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 143046c..0d701af 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -46,7 +46,7 @@ define munin::register_snmp() } } -class munin::client:: base { +class munin::client::base { package { "munin-node": ensure => installed } service { "munin-node": ensure => running, -- cgit v1.2.3 From 35a0cd69d1ecb7fdd2e77545d79f8e685a226f96 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 16:36:37 +0200 Subject: fixed typo --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 0d701af..69e9f2e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -95,7 +95,7 @@ class munin::client::debian inherits munin::client::base { # the plugin will need that package { "iproute": ensure => installed } - Service["munin-node"]: + Service["munin-node"]{ # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } -- cgit v1.2.3 From e85b733cb91b1987b38caec793ccce51dff88550 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 17:48:10 +0200 Subject: initialised server var --- manifests/host.pp | 2 +- manifests/plugin.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 74492b1..cdd7773 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -27,7 +27,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$servername/munin/create_snmp_links.sh", + source => "puppet://$server/munin/create_snmp_links.sh", mode => 755, owner => root, group => 0; } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index aec1951..ec025f5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -101,7 +101,7 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { 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", + source => "puppet://$server/$real_source", ensure => file, mode => 0755, owner => root, group => 0; } @@ -116,7 +116,7 @@ class munin::plugins::base { centos: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0; @@ -129,7 +129,7 @@ class munin::plugins::base { default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 175ca7bf6dfa4a410e0cca920164b90c64a15d6b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 19:54:25 +0200 Subject: removed unneeded nmap --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index cdd7773..8f79020 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,7 +4,7 @@ class munin::host { - package { [ "munin", "nmap"]: ensure => installed, } + package {"munin": ensure => installed, } File <<| tag == 'munin' |>> -- cgit v1.2.3 From 414020e7c349ec509eced5a12c54d9abd5dc5812 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 20:00:47 +0200 Subject: fixed plugin source with relative plugins --- manifests/plugin.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ec025f5..a2f8231 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,8 +93,9 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$name", + '' => "munin/plugins/$plugin_src", default => $source } include munin::plugin::scriptpaths -- cgit v1.2.3 From 65fb027d8cf639c565b0f9fb53b5fbe9ee25dc7b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Apr 2008 20:26:12 +0200 Subject: try to add an empty dir --- files/empty/.git_placeholder | 1 + 1 file changed, 1 insertion(+) create mode 100644 files/empty/.git_placeholder diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.git_placeholder @@ -0,0 +1 @@ +# just used for git -- cgit v1.2.3 From e7aa54e5ff421d67c0d4adaf5a8b9dfd03c4d958 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 09:48:23 +0000 Subject: rearranged plugin ordering, fixed some yum stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1247 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b66ce2..6eaa518 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -213,7 +213,6 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { - include apache::status munin::plugin{ "apache_accesses": } munin::plugin{ "apache_processes": } munin::plugin{ "apache_volume": } -- cgit v1.2.3 From 4ade531347d2cfef7945f2521fb9e1ae3730098c Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 09:48:23 +0000 Subject: rearranged plugin ordering, fixed some yum stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@1247 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b66ce2..6eaa518 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -213,7 +213,6 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { - include apache::status munin::plugin{ "apache_accesses": } munin::plugin{ "apache_processes": } munin::plugin{ "apache_volume": } -- cgit v1.2.3 From b543e7dfd5482555cf035ce28c3ceaccd22e7bde Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 09:48:23 +0000 Subject: rearranged plugin ordering, fixed some yum stuff --- manifests/plugin.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b66ce2..6eaa518 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -213,7 +213,6 @@ class munin::plugins::djbdns inherits munin::plugins::base { } class munin::plugins::apache inherits munin::plugins::base { - include apache::status munin::plugin{ "apache_accesses": } munin::plugin{ "apache_processes": } munin::plugin{ "apache_volume": } -- cgit v1.2.3 From 73ba690aacc13a221aab4865d121cfdba1670d0d Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 11:05:25 +0000 Subject: fixed munin stuff git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1248 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- manifests/plugin.pp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index c81e6f4..8181845 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,6 +66,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), + tag => 'munin', } } @@ -129,7 +130,7 @@ class munin::client::debian munin::register { $fqdn: } # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } + munin::plugin { "postfix_mailvolume": ensure => absent } } class munin::client::gentoo diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6eaa518..161bf88 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -149,7 +149,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") - plugin { + munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } @@ -157,7 +157,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { - plugin { + munin::plugin { [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat -- cgit v1.2.3 From a3ac1c067e22f25b6fa5643873a4a935358561f1 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 11:05:25 +0000 Subject: fixed munin stuff git-svn-id: https://svn/ipuppet/trunk/modules/munin@1248 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- manifests/plugin.pp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index c81e6f4..8181845 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,6 +66,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), + tag => 'munin', } } @@ -129,7 +130,7 @@ class munin::client::debian munin::register { $fqdn: } # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } + munin::plugin { "postfix_mailvolume": ensure => absent } } class munin::client::gentoo diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6eaa518..161bf88 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -149,7 +149,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") - plugin { + munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } @@ -157,7 +157,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { - plugin { + munin::plugin { [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat -- cgit v1.2.3 From eeb818d8d3d16bda743dd007fedcb4de25ba2027 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 11:05:25 +0000 Subject: fixed munin stuff --- manifests/client.pp | 3 ++- manifests/plugin.pp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index c81e6f4..8181845 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,6 +66,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), + tag => 'munin', } } @@ -129,7 +130,7 @@ class munin::client::debian munin::register { $fqdn: } # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } + munin::plugin { "postfix_mailvolume": ensure => absent } } class munin::client::gentoo diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6eaa518..161bf88 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -149,7 +149,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") - plugin { + munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; } @@ -157,7 +157,7 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { - plugin { + munin::plugin { [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, vmstat -- cgit v1.2.3 From 736b484dad95f04a74233306e59cdeead59e8a6b Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 12:26:34 +0000 Subject: unified fileserver location, in the future the fileserver should only be accessed by $server git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1251 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/host.pp | 2 +- manifests/plugin.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 4625ba9..d49c5a2 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -27,7 +27,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$servername/munin/create_snmp_links.sh", + source => "puppet://$server/munin/create_snmp_links.sh", mode => 755, owner => root, group => 0; } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 161bf88..ac25abf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -101,7 +101,7 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { 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", + source => "puppet://$server/$real_source", ensure => file, mode => 0755, owner => root, group => 0; } @@ -116,7 +116,7 @@ class munin::plugins::base { centos: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0; @@ -129,7 +129,7 @@ class munin::plugins::base { default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From b1381333f577b0b4c6ff17a2cfff1abfa58c00e3 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 12:26:34 +0000 Subject: unified fileserver location, in the future the fileserver should only be accessed by $server git-svn-id: https://svn/ipuppet/trunk/modules/munin@1251 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/host.pp | 2 +- manifests/plugin.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 4625ba9..d49c5a2 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -27,7 +27,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$servername/munin/create_snmp_links.sh", + source => "puppet://$server/munin/create_snmp_links.sh", mode => 755, owner => root, group => 0; } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 161bf88..ac25abf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -101,7 +101,7 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { 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", + source => "puppet://$server/$real_source", ensure => file, mode => 0755, owner => root, group => 0; } @@ -116,7 +116,7 @@ class munin::plugins::base { centos: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0; @@ -129,7 +129,7 @@ class munin::plugins::base { default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 470e23c19625c8aa6e9e68085d284fa8be01bc3e Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 12:26:34 +0000 Subject: unified fileserver location, in the future the fileserver should only be accessed by $server --- manifests/host.pp | 2 +- manifests/plugin.pp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index 4625ba9..d49c5a2 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -27,7 +27,7 @@ class munin::snmp_collector file { "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$servername/munin/create_snmp_links.sh", + source => "puppet://$server/munin/create_snmp_links.sh", mode => 755, owner => root, group => 0; } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 161bf88..ac25abf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -101,7 +101,7 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { 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", + source => "puppet://$server/$real_source", ensure => file, mode => 0755, owner => root, group => 0; } @@ -116,7 +116,7 @@ class munin::plugins::base { centos: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0; @@ -129,7 +129,7 @@ class munin::plugins::base { default: { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/munin/empty", + source => "puppet://$server/munin/empty", ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 78a824ac9197a6eea2e8c02dd056ccb47c0911b2 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 13:26:14 +0000 Subject: merged with puzzle upstream git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1254 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/nagios_hosts | 28 ++++++ files/plugins/nagios_perf_ | 35 +++++++ files/plugins/nagios_svc | 33 +++++++ files/plugins/xen_traffic_all | 63 ++++++++++++ manifests/client.pp | 168 +++++++++----------------------- manifests/host.pp | 4 +- manifests/init.pp | 4 +- manifests/plugin.pp | 27 ++++- templates/munin-node.conf.Debian.gutsy | 1 - templates/munin-node.conf.Ubuntu.feisty | 1 + templates/munin-node.conf.Ubuntu.gutsy | 1 + templates/munin-node.conf.Ubuntu.hardy | 1 + 12 files changed, 238 insertions(+), 128 deletions(-) create mode 100755 files/plugins/nagios_hosts create mode 100755 files/plugins/nagios_perf_ create mode 100755 files/plugins/nagios_svc create mode 100644 files/plugins/xen_traffic_all delete mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.feisty create mode 120000 templates/munin-node.conf.Ubuntu.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/files/plugins/nagios_hosts b/files/plugins/nagios_hosts new file mode 100755 index 0000000..04fe8ed --- /dev/null +++ b/files/plugins/nagios_hosts @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios host stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel hosts' + echo 'graph_category nagios' + echo 'graph_info The number of hosts checked by nagios' + echo 'up.label up' + echo 'up.draw AREA' + echo 'up.info number of hosts UP' + echo 'down.label down' + echo 'down.draw STACK' + echo 'down.info number of hosts DOWN' + echo 'unr.label unr' + echo 'unr.draw STACK' + echo 'unr.info number of hosts UNREACHABLE' + + exit 0 +fi + +echo -n 'up.value ' +nagios2stats --mrtg --data NUMHSTUP +echo -n 'down.value ' +nagios2stats --mrtg --data NUMHSTDOWN +echo -n 'unr.value ' +nagios2stats --mrtg --data NUMHSTUNR + diff --git a/files/plugins/nagios_perf_ b/files/plugins/nagios_perf_ new file mode 100755 index 0000000..f819def --- /dev/null +++ b/files/plugins/nagios_perf_ @@ -0,0 +1,35 @@ +#!/bin/bash + +NAME=$(basename $0) + +TYPE=${NAME##nagios_perf_} + +[ "x$TYPE" = 'xhosts' ] && TYPE_ABBR=HST +[ "x$TYPE" = 'xsvc' ] && TYPE_ABBR=SVC +[ -z "$TYPE_ABBR" ] && echo "unknown type $TYPE" >&2 && exit 1 + +if [ "$1" = "config" ]; then + echo "graph_title Nagios $TYPE performance stats" + echo "graph_args --base 1000" + echo "graph_vlabel seconds" + echo "graph_category nagios" + echo "graph_info Check performance statistics" + + echo "act_lat_$TYPE_ABBR.label act lat" + echo "act_lat_$TYPE_ABBR.type GAUGE" + echo "act_lat_$TYPE_ABBR.draw AREA" + echo "act_lat_$TYPE_ABBR.cdef act_lat_$TYPE_ABBR,1000,/" + echo "act_lat_$TYPE_ABBR.info average latency of active checks over the last 5 minutes" + + echo "act_ext_$TYPE_ABBR.label act ext" + echo "act_ext_$TYPE_ABBR.type GAUGE" + echo "act_ext_$TYPE_ABBR.draw LINE1" + echo "act_ext_$TYPE_ABBR.cdef act_ext_$TYPE_ABBR,1000,/" + echo "act_ext_$TYPE_ABBR.info average execution time of active checks over the last 5 minutes" + + exit 0 +fi + +echo "act_lat_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}EXT) + diff --git a/files/plugins/nagios_svc b/files/plugins/nagios_svc new file mode 100755 index 0000000..3938999 --- /dev/null +++ b/files/plugins/nagios_svc @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios service stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel services' + echo 'graph_category nagios' + echo 'graph_info The number of services checked by nagios' + echo 'ok.label ok' + echo 'ok.draw AREA' + echo 'ok.info number of services OK' + echo 'warn.label warn' + echo 'warn.draw STACK' + echo 'warn.info number of services WARNING' + echo 'crit.label crit' + echo 'crit.draw STACK' + echo 'crit.info number of services CRITICAL' + echo 'unkn.label unkn' + echo 'unkn.draw STACK' + echo 'unkn.info number of services UNKNOWN' + + exit 0 +fi + +echo -n 'ok.value ' +nagios2stats --mrtg --data NUMSVCOK +echo -n 'warn.value ' +nagios2stats --mrtg --data NUMSVCWARN +echo -n 'crit.value ' +nagios2stats --mrtg --data NUMSVCCRIT +echo -n 'unkn.value ' +nagios2stats --mrtg --data NUMSVCUNKN + diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all new file mode 100644 index 0000000..1216a7d --- /dev/null +++ b/files/plugins/xen_traffic_all @@ -0,0 +1,63 @@ +#!/bin/sh +# Author: mario manno +# Description: measure traffic for all xen hosts +# +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + else + echo "no (xm not found)" + exit 1 + fi + if [ -r /proc/net/dev ]; then + echo yes + else + echo "no (/proc/net/dev not found)" + exit 1 + fi + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title Xen Traffic' + echo 'graph_vlabel bits received (-) / sent (+) per ${graph_period}' + echo 'graph_args --base 1024 -l 0' + echo 'graph_category xen' + DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") + for dom in $DOMAINS; do + name=$( echo $dom | sed -e's/-/_/g' ) + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" + + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done + exit 0 +fi + +DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") +for dom in $DOMAINS; do + dev=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + name=$( echo $dom | sed -e's/-/_/g' ) + #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ + #'{ sub(/^ */,""); if ($1 == interface) \ + #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev +done + diff --git a/manifests/client.pp b/manifests/client.pp index 8181845..69e9f2e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -11,47 +11,14 @@ class munin::client { default => $munin_host } - case $operatingsystem { - darwin: { include munin::client::darwin } - debian: { - include munin::client::debian - include munin::plugins::debian - } - ubuntu: { - info ( "Trying to configure Ubuntu's munin with Debian class" ) - include munin::client::debian - include munin::plugins::debian - } - gentoo: { - include munin::client::gentoo - include munin::plugins::gentoo - } - centos: { - include munin::client::centos - include munin::plugins::centos - } - default: { fail ("Don't know how to handle munin on $operatingsystem") } - } - - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } - default: { - err( "Don't know which munin plugins to install for $kernel" ) - } - } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } - xenu: { include munin::plugins::domU } + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { include munin::client::debian } + ubuntu: { include munin::client::ubuntu } + centos: { include munin::client::centos } + gentoo: { include munin::client::gentoo } + default: { include munin::client::base } } - } define munin::register() @@ -66,7 +33,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), - tag => 'munin', + tag => 'munin', } } @@ -75,12 +42,34 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), - tag => 'munin', + tag => 'munin', } } -class munin::client::darwin -{ +class munin::client::base { + package { "munin-node": ensure => installed } + service { "munin-node": + ensure => running, + hasstatus => true, + hasrestart => true, + require => Package[munin-node], + } + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => 0; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + mode => 0644, owner => root, group => 0, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + } + munin::register { $fqdn: } + include munin::plugins::base +} + +class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), @@ -102,95 +91,30 @@ class munin::client::darwin munin::register_snmp { $fqdn: } } -class munin::client::debian -{ - package { "munin-node": ensure => installed } +class munin::client::debian inherits munin::client::base { # the plugin will need that package { "iproute": ensure => installed } - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, + Service["munin-node"]{ # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } - - munin::register { $fqdn: } - # workaround bug in munin_node_configure - munin::plugin { "postfix_mailvolume": ensure => absent } + plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } -class munin::client::gentoo -{ - $acpi_available = "absent" - package { 'munin-node': - name => 'munin', - ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, - } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - # notify => Service["munin"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } -} +class munin::client::ubuntu inherits munin::client::debian {} -class munin::client::centos -{ - package { 'munin-node': - ensure => present, +class munin::client::gentoo inherits munin::client::base { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group =>0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } - + include munin::plugins::gentoo } - +class munin::client::centos inherits munin::client::base { + include munin::plugins::centos +} diff --git a/manifests/host.pp b/manifests/host.pp index d49c5a2..8f79020 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,7 +4,7 @@ class munin::host { - package { [ "munin", "nmap"]: ensure => installed, } + package {"munin": ensure => installed, } File <<| tag == 'munin' |>> @@ -12,7 +12,7 @@ class munin::host dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } - + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", "/var/log/munin-graph.log", "/var/log/munin-html.log"]: ensure => present, diff --git a/manifests/init.pp b/manifests/init.pp index 9c4b1de..6b6cd08 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. - +# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# # the port is a parameter so vservers can share IP addresses and still be happy # Define where the individual nodes' configs are stored @@ -16,4 +17,3 @@ import "plugin.pp" case $operatingsystem { debian,ubuntu: { include assert_lsbdistcodename } } - diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ac25abf..6a92c56 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,8 +93,9 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$name", + '' => "munin/plugins/$plugin_src", default => $source } include munin::plugin::scriptpaths @@ -142,6 +143,21 @@ class munin::plugins::base { } } } + 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 } + xenu: { include munin::plugins::domU } + } } # handle if_ and if_err_ plugins @@ -195,6 +211,7 @@ class munin::plugins::dom0 inherits munin::plugins::physical { munin::plugin::deploy { "xen-cpu": config => "user root"} munin::plugin::deploy { "xen_memory": config => "user root"} munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } class munin::plugins::physical inherits munin::plugins::base { @@ -229,3 +246,11 @@ class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg__connections": ensure => false } munin::plugin::deploy { "pg__locks": ensure => false } } +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'; + } +} diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Debian.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 9dca19736cd11ed42cfdb8aed30c8628b22231cb Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 13:26:14 +0000 Subject: merged with puzzle upstream git-svn-id: https://svn/ipuppet/trunk/modules/munin@1254 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/nagios_hosts | 28 ++++++ files/plugins/nagios_perf_ | 35 +++++++ files/plugins/nagios_svc | 33 +++++++ files/plugins/xen_traffic_all | 63 ++++++++++++ manifests/client.pp | 168 +++++++++----------------------- manifests/host.pp | 4 +- manifests/init.pp | 4 +- manifests/plugin.pp | 27 ++++- templates/munin-node.conf.Debian.gutsy | 1 - templates/munin-node.conf.Ubuntu.feisty | 1 + templates/munin-node.conf.Ubuntu.gutsy | 1 + templates/munin-node.conf.Ubuntu.hardy | 1 + 12 files changed, 238 insertions(+), 128 deletions(-) create mode 100755 files/plugins/nagios_hosts create mode 100755 files/plugins/nagios_perf_ create mode 100755 files/plugins/nagios_svc create mode 100644 files/plugins/xen_traffic_all delete mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.feisty create mode 120000 templates/munin-node.conf.Ubuntu.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/files/plugins/nagios_hosts b/files/plugins/nagios_hosts new file mode 100755 index 0000000..04fe8ed --- /dev/null +++ b/files/plugins/nagios_hosts @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios host stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel hosts' + echo 'graph_category nagios' + echo 'graph_info The number of hosts checked by nagios' + echo 'up.label up' + echo 'up.draw AREA' + echo 'up.info number of hosts UP' + echo 'down.label down' + echo 'down.draw STACK' + echo 'down.info number of hosts DOWN' + echo 'unr.label unr' + echo 'unr.draw STACK' + echo 'unr.info number of hosts UNREACHABLE' + + exit 0 +fi + +echo -n 'up.value ' +nagios2stats --mrtg --data NUMHSTUP +echo -n 'down.value ' +nagios2stats --mrtg --data NUMHSTDOWN +echo -n 'unr.value ' +nagios2stats --mrtg --data NUMHSTUNR + diff --git a/files/plugins/nagios_perf_ b/files/plugins/nagios_perf_ new file mode 100755 index 0000000..f819def --- /dev/null +++ b/files/plugins/nagios_perf_ @@ -0,0 +1,35 @@ +#!/bin/bash + +NAME=$(basename $0) + +TYPE=${NAME##nagios_perf_} + +[ "x$TYPE" = 'xhosts' ] && TYPE_ABBR=HST +[ "x$TYPE" = 'xsvc' ] && TYPE_ABBR=SVC +[ -z "$TYPE_ABBR" ] && echo "unknown type $TYPE" >&2 && exit 1 + +if [ "$1" = "config" ]; then + echo "graph_title Nagios $TYPE performance stats" + echo "graph_args --base 1000" + echo "graph_vlabel seconds" + echo "graph_category nagios" + echo "graph_info Check performance statistics" + + echo "act_lat_$TYPE_ABBR.label act lat" + echo "act_lat_$TYPE_ABBR.type GAUGE" + echo "act_lat_$TYPE_ABBR.draw AREA" + echo "act_lat_$TYPE_ABBR.cdef act_lat_$TYPE_ABBR,1000,/" + echo "act_lat_$TYPE_ABBR.info average latency of active checks over the last 5 minutes" + + echo "act_ext_$TYPE_ABBR.label act ext" + echo "act_ext_$TYPE_ABBR.type GAUGE" + echo "act_ext_$TYPE_ABBR.draw LINE1" + echo "act_ext_$TYPE_ABBR.cdef act_ext_$TYPE_ABBR,1000,/" + echo "act_ext_$TYPE_ABBR.info average execution time of active checks over the last 5 minutes" + + exit 0 +fi + +echo "act_lat_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}EXT) + diff --git a/files/plugins/nagios_svc b/files/plugins/nagios_svc new file mode 100755 index 0000000..3938999 --- /dev/null +++ b/files/plugins/nagios_svc @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios service stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel services' + echo 'graph_category nagios' + echo 'graph_info The number of services checked by nagios' + echo 'ok.label ok' + echo 'ok.draw AREA' + echo 'ok.info number of services OK' + echo 'warn.label warn' + echo 'warn.draw STACK' + echo 'warn.info number of services WARNING' + echo 'crit.label crit' + echo 'crit.draw STACK' + echo 'crit.info number of services CRITICAL' + echo 'unkn.label unkn' + echo 'unkn.draw STACK' + echo 'unkn.info number of services UNKNOWN' + + exit 0 +fi + +echo -n 'ok.value ' +nagios2stats --mrtg --data NUMSVCOK +echo -n 'warn.value ' +nagios2stats --mrtg --data NUMSVCWARN +echo -n 'crit.value ' +nagios2stats --mrtg --data NUMSVCCRIT +echo -n 'unkn.value ' +nagios2stats --mrtg --data NUMSVCUNKN + diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all new file mode 100644 index 0000000..1216a7d --- /dev/null +++ b/files/plugins/xen_traffic_all @@ -0,0 +1,63 @@ +#!/bin/sh +# Author: mario manno +# Description: measure traffic for all xen hosts +# +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + else + echo "no (xm not found)" + exit 1 + fi + if [ -r /proc/net/dev ]; then + echo yes + else + echo "no (/proc/net/dev not found)" + exit 1 + fi + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title Xen Traffic' + echo 'graph_vlabel bits received (-) / sent (+) per ${graph_period}' + echo 'graph_args --base 1024 -l 0' + echo 'graph_category xen' + DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") + for dom in $DOMAINS; do + name=$( echo $dom | sed -e's/-/_/g' ) + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" + + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done + exit 0 +fi + +DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") +for dom in $DOMAINS; do + dev=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + name=$( echo $dom | sed -e's/-/_/g' ) + #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ + #'{ sub(/^ */,""); if ($1 == interface) \ + #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev +done + diff --git a/manifests/client.pp b/manifests/client.pp index 8181845..69e9f2e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -11,47 +11,14 @@ class munin::client { default => $munin_host } - case $operatingsystem { - darwin: { include munin::client::darwin } - debian: { - include munin::client::debian - include munin::plugins::debian - } - ubuntu: { - info ( "Trying to configure Ubuntu's munin with Debian class" ) - include munin::client::debian - include munin::plugins::debian - } - gentoo: { - include munin::client::gentoo - include munin::plugins::gentoo - } - centos: { - include munin::client::centos - include munin::plugins::centos - } - default: { fail ("Don't know how to handle munin on $operatingsystem") } - } - - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } - default: { - err( "Don't know which munin plugins to install for $kernel" ) - } - } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } - xenu: { include munin::plugins::domU } + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { include munin::client::debian } + ubuntu: { include munin::client::ubuntu } + centos: { include munin::client::centos } + gentoo: { include munin::client::gentoo } + default: { include munin::client::base } } - } define munin::register() @@ -66,7 +33,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), - tag => 'munin', + tag => 'munin', } } @@ -75,12 +42,34 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), - tag => 'munin', + tag => 'munin', } } -class munin::client::darwin -{ +class munin::client::base { + package { "munin-node": ensure => installed } + service { "munin-node": + ensure => running, + hasstatus => true, + hasrestart => true, + require => Package[munin-node], + } + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => 0; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + mode => 0644, owner => root, group => 0, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + } + munin::register { $fqdn: } + include munin::plugins::base +} + +class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), @@ -102,95 +91,30 @@ class munin::client::darwin munin::register_snmp { $fqdn: } } -class munin::client::debian -{ - package { "munin-node": ensure => installed } +class munin::client::debian inherits munin::client::base { # the plugin will need that package { "iproute": ensure => installed } - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, + Service["munin-node"]{ # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } - - munin::register { $fqdn: } - # workaround bug in munin_node_configure - munin::plugin { "postfix_mailvolume": ensure => absent } + plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } -class munin::client::gentoo -{ - $acpi_available = "absent" - package { 'munin-node': - name => 'munin', - ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, - } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - # notify => Service["munin"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } -} +class munin::client::ubuntu inherits munin::client::debian {} -class munin::client::centos -{ - package { 'munin-node': - ensure => present, +class munin::client::gentoo inherits munin::client::base { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group =>0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } - + include munin::plugins::gentoo } - +class munin::client::centos inherits munin::client::base { + include munin::plugins::centos +} diff --git a/manifests/host.pp b/manifests/host.pp index d49c5a2..8f79020 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,7 +4,7 @@ class munin::host { - package { [ "munin", "nmap"]: ensure => installed, } + package {"munin": ensure => installed, } File <<| tag == 'munin' |>> @@ -12,7 +12,7 @@ class munin::host dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } - + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", "/var/log/munin-graph.log", "/var/log/munin-html.log"]: ensure => present, diff --git a/manifests/init.pp b/manifests/init.pp index 9c4b1de..6b6cd08 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. - +# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# # the port is a parameter so vservers can share IP addresses and still be happy # Define where the individual nodes' configs are stored @@ -16,4 +17,3 @@ import "plugin.pp" case $operatingsystem { debian,ubuntu: { include assert_lsbdistcodename } } - diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ac25abf..6a92c56 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,8 +93,9 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$name", + '' => "munin/plugins/$plugin_src", default => $source } include munin::plugin::scriptpaths @@ -142,6 +143,21 @@ class munin::plugins::base { } } } + 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 } + xenu: { include munin::plugins::domU } + } } # handle if_ and if_err_ plugins @@ -195,6 +211,7 @@ class munin::plugins::dom0 inherits munin::plugins::physical { munin::plugin::deploy { "xen-cpu": config => "user root"} munin::plugin::deploy { "xen_memory": config => "user root"} munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } class munin::plugins::physical inherits munin::plugins::base { @@ -229,3 +246,11 @@ class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg__connections": ensure => false } munin::plugin::deploy { "pg__locks": ensure => false } } +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'; + } +} diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Debian.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 20f5f7d8c26c9272ef302606a6d71ef1b943919a Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 13:26:14 +0000 Subject: merged with puzzle upstream --- files/plugins/nagios_hosts | 28 ++++++ files/plugins/nagios_perf_ | 35 +++++++ files/plugins/nagios_svc | 33 +++++++ files/plugins/xen_traffic_all | 63 ++++++++++++ manifests/client.pp | 168 +++++++++----------------------- manifests/host.pp | 4 +- manifests/init.pp | 4 +- manifests/plugin.pp | 27 ++++- templates/munin-node.conf.Debian.gutsy | 1 - templates/munin-node.conf.Ubuntu.feisty | 1 + templates/munin-node.conf.Ubuntu.gutsy | 1 + templates/munin-node.conf.Ubuntu.hardy | 1 + 12 files changed, 238 insertions(+), 128 deletions(-) create mode 100755 files/plugins/nagios_hosts create mode 100755 files/plugins/nagios_perf_ create mode 100755 files/plugins/nagios_svc create mode 100644 files/plugins/xen_traffic_all delete mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.feisty create mode 120000 templates/munin-node.conf.Ubuntu.gutsy create mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/files/plugins/nagios_hosts b/files/plugins/nagios_hosts new file mode 100755 index 0000000..04fe8ed --- /dev/null +++ b/files/plugins/nagios_hosts @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios host stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel hosts' + echo 'graph_category nagios' + echo 'graph_info The number of hosts checked by nagios' + echo 'up.label up' + echo 'up.draw AREA' + echo 'up.info number of hosts UP' + echo 'down.label down' + echo 'down.draw STACK' + echo 'down.info number of hosts DOWN' + echo 'unr.label unr' + echo 'unr.draw STACK' + echo 'unr.info number of hosts UNREACHABLE' + + exit 0 +fi + +echo -n 'up.value ' +nagios2stats --mrtg --data NUMHSTUP +echo -n 'down.value ' +nagios2stats --mrtg --data NUMHSTDOWN +echo -n 'unr.value ' +nagios2stats --mrtg --data NUMHSTUNR + diff --git a/files/plugins/nagios_perf_ b/files/plugins/nagios_perf_ new file mode 100755 index 0000000..f819def --- /dev/null +++ b/files/plugins/nagios_perf_ @@ -0,0 +1,35 @@ +#!/bin/bash + +NAME=$(basename $0) + +TYPE=${NAME##nagios_perf_} + +[ "x$TYPE" = 'xhosts' ] && TYPE_ABBR=HST +[ "x$TYPE" = 'xsvc' ] && TYPE_ABBR=SVC +[ -z "$TYPE_ABBR" ] && echo "unknown type $TYPE" >&2 && exit 1 + +if [ "$1" = "config" ]; then + echo "graph_title Nagios $TYPE performance stats" + echo "graph_args --base 1000" + echo "graph_vlabel seconds" + echo "graph_category nagios" + echo "graph_info Check performance statistics" + + echo "act_lat_$TYPE_ABBR.label act lat" + echo "act_lat_$TYPE_ABBR.type GAUGE" + echo "act_lat_$TYPE_ABBR.draw AREA" + echo "act_lat_$TYPE_ABBR.cdef act_lat_$TYPE_ABBR,1000,/" + echo "act_lat_$TYPE_ABBR.info average latency of active checks over the last 5 minutes" + + echo "act_ext_$TYPE_ABBR.label act ext" + echo "act_ext_$TYPE_ABBR.type GAUGE" + echo "act_ext_$TYPE_ABBR.draw LINE1" + echo "act_ext_$TYPE_ABBR.cdef act_ext_$TYPE_ABBR,1000,/" + echo "act_ext_$TYPE_ABBR.info average execution time of active checks over the last 5 minutes" + + exit 0 +fi + +echo "act_lat_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}EXT) + diff --git a/files/plugins/nagios_svc b/files/plugins/nagios_svc new file mode 100755 index 0000000..3938999 --- /dev/null +++ b/files/plugins/nagios_svc @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ "$1" = "config" ]; then + echo 'graph_title Nagios service stats' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel services' + echo 'graph_category nagios' + echo 'graph_info The number of services checked by nagios' + echo 'ok.label ok' + echo 'ok.draw AREA' + echo 'ok.info number of services OK' + echo 'warn.label warn' + echo 'warn.draw STACK' + echo 'warn.info number of services WARNING' + echo 'crit.label crit' + echo 'crit.draw STACK' + echo 'crit.info number of services CRITICAL' + echo 'unkn.label unkn' + echo 'unkn.draw STACK' + echo 'unkn.info number of services UNKNOWN' + + exit 0 +fi + +echo -n 'ok.value ' +nagios2stats --mrtg --data NUMSVCOK +echo -n 'warn.value ' +nagios2stats --mrtg --data NUMSVCWARN +echo -n 'crit.value ' +nagios2stats --mrtg --data NUMSVCCRIT +echo -n 'unkn.value ' +nagios2stats --mrtg --data NUMSVCUNKN + diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all new file mode 100644 index 0000000..1216a7d --- /dev/null +++ b/files/plugins/xen_traffic_all @@ -0,0 +1,63 @@ +#!/bin/sh +# Author: mario manno +# Description: measure traffic for all xen hosts +# +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + if which xm > /dev/null ; then + echo yes + else + echo "no (xm not found)" + exit 1 + fi + if [ -r /proc/net/dev ]; then + echo yes + else + echo "no (/proc/net/dev not found)" + exit 1 + fi + exit 0 +fi + +if [ "$1" = "config" ]; then + echo 'graph_title Xen Traffic' + echo 'graph_vlabel bits received (-) / sent (+) per ${graph_period}' + echo 'graph_args --base 1024 -l 0' + echo 'graph_category xen' + DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") + for dom in $DOMAINS; do + name=$( echo $dom | sed -e's/-/_/g' ) + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" + + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done + exit 0 +fi + +DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") +for dom in $DOMAINS; do + dev=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + name=$( echo $dom | sed -e's/-/_/g' ) + #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ + #'{ sub(/^ */,""); if ($1 == interface) \ + #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev +done + diff --git a/manifests/client.pp b/manifests/client.pp index 8181845..69e9f2e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -11,47 +11,14 @@ class munin::client { default => $munin_host } - case $operatingsystem { - darwin: { include munin::client::darwin } - debian: { - include munin::client::debian - include munin::plugins::debian - } - ubuntu: { - info ( "Trying to configure Ubuntu's munin with Debian class" ) - include munin::client::debian - include munin::plugins::debian - } - gentoo: { - include munin::client::gentoo - include munin::plugins::gentoo - } - centos: { - include munin::client::centos - include munin::plugins::centos - } - default: { fail ("Don't know how to handle munin on $operatingsystem") } - } - - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } - default: { - err( "Don't know which munin plugins to install for $kernel" ) - } - } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } - xenu: { include munin::plugins::domU } + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { include munin::client::debian } + ubuntu: { include munin::client::ubuntu } + centos: { include munin::client::centos } + gentoo: { include munin::client::gentoo } + default: { include munin::client::base } } - } define munin::register() @@ -66,7 +33,7 @@ define munin::register() @@file { "${NODESDIR}/${name}_${munin_port_real}": ensure => present, content => template("munin/defaultclient.erb"), - tag => 'munin', + tag => 'munin', } } @@ -75,12 +42,34 @@ define munin::register_snmp() @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), - tag => 'munin', + tag => 'munin', } } -class munin::client::darwin -{ +class munin::client::base { + package { "munin-node": ensure => installed } + service { "munin-node": + ensure => running, + hasstatus => true, + hasrestart => true, + require => Package[munin-node], + } + file { + "/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => 0; + "/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + mode => 0644, owner => root, group => 0, + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package["munin-node"], + } + munin::register { $fqdn: } + include munin::plugins::base +} + +class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), @@ -102,95 +91,30 @@ class munin::client::darwin munin::register_snmp { $fqdn: } } -class munin::client::debian -{ - package { "munin-node": ensure => installed } +class munin::client::debian inherits munin::client::base { # the plugin will need that package { "iproute": ensure => installed } - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, + Service["munin-node"]{ # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } - - munin::register { $fqdn: } - # workaround bug in munin_node_configure - munin::plugin { "postfix_mailvolume": ensure => absent } + plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } -class munin::client::gentoo -{ - $acpi_available = "absent" - package { 'munin-node': - name => 'munin', - ensure => present, - category => $operatingsystem ? { - gentoo => 'net-analyzer', - default => '', - }, - } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.Gentoo."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - # notify => Service["munin"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } -} +class munin::client::ubuntu inherits munin::client::debian {} -class munin::client::centos -{ - package { 'munin-node': - ensure => present, +class munin::client::gentoo inherits munin::client::base { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', } - - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group =>0; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.CentOS."), - mode => 0644, owner => root, group => 0, - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service["munin-node"], - } - - service { "munin-node": - ensure => running, - } - - munin::register { $fqdn: } - + include munin::plugins::gentoo } - +class munin::client::centos inherits munin::client::base { + include munin::plugins::centos +} diff --git a/manifests/host.pp b/manifests/host.pp index d49c5a2..8f79020 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,7 +4,7 @@ class munin::host { - package { [ "munin", "nmap"]: ensure => installed, } + package {"munin": ensure => installed, } File <<| tag == 'munin' |>> @@ -12,7 +12,7 @@ class munin::host dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } - + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", "/var/log/munin-graph.log", "/var/log/munin-html.log"]: ensure => present, diff --git a/manifests/init.pp b/manifests/init.pp index 9c4b1de..6b6cd08 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. - +# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# # the port is a parameter so vservers can share IP addresses and still be happy # Define where the individual nodes' configs are stored @@ -16,4 +17,3 @@ import "plugin.pp" case $operatingsystem { debian,ubuntu: { include assert_lsbdistcodename } } - diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ac25abf..6a92c56 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,8 +93,9 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { "present" => $name, default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$name", + '' => "munin/plugins/$plugin_src", default => $source } include munin::plugin::scriptpaths @@ -142,6 +143,21 @@ class munin::plugins::base { } } } + 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 } + xenu: { include munin::plugins::domU } + } } # handle if_ and if_err_ plugins @@ -195,6 +211,7 @@ class munin::plugins::dom0 inherits munin::plugins::physical { munin::plugin::deploy { "xen-cpu": config => "user root"} munin::plugin::deploy { "xen_memory": config => "user root"} munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } class munin::plugins::physical inherits munin::plugins::base { @@ -229,3 +246,11 @@ class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg__connections": ensure => false } munin::plugin::deploy { "pg__locks": ensure => false } } +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'; + } +} diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Debian.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Ubuntu.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 222dec990a0811424759fc18dd09f888ca116a98 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 14:35:15 +0000 Subject: refixed template path git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1257 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- templates/munin-node.conf.Debian.feisty | 1 + templates/munin-node.conf.Debian.gutsy | 1 + templates/munin-node.conf.Debian.hardy | 1 + templates/munin-node.conf.Ubuntu.feisty | 1 - templates/munin-node.conf.Ubuntu.gutsy | 1 - templates/munin-node.conf.Ubuntu.hardy | 1 - 7 files changed, 4 insertions(+), 4 deletions(-) create mode 120000 templates/munin-node.conf.Debian.feisty create mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Debian.hardy delete mode 120000 templates/munin-node.conf.Ubuntu.feisty delete mode 120000 templates/munin-node.conf.Ubuntu.gutsy delete mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/manifests/client.pp b/manifests/client.pp index 69e9f2e..39d9a15 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! diff --git a/templates/munin-node.conf.Debian.feisty b/templates/munin-node.conf.Debian.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.hardy b/templates/munin-node.conf.Debian.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.feisty +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.hardy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 3b9dff3584c98fe8e2754fe91204748853e84d84 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 14:35:15 +0000 Subject: refixed template path git-svn-id: https://svn/ipuppet/trunk/modules/munin@1257 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 2 +- templates/munin-node.conf.Debian.feisty | 1 + templates/munin-node.conf.Debian.gutsy | 1 + templates/munin-node.conf.Debian.hardy | 1 + templates/munin-node.conf.Ubuntu.feisty | 1 - templates/munin-node.conf.Ubuntu.gutsy | 1 - templates/munin-node.conf.Ubuntu.hardy | 1 - 7 files changed, 4 insertions(+), 4 deletions(-) create mode 120000 templates/munin-node.conf.Debian.feisty create mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Debian.hardy delete mode 120000 templates/munin-node.conf.Ubuntu.feisty delete mode 120000 templates/munin-node.conf.Ubuntu.gutsy delete mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/manifests/client.pp b/manifests/client.pp index 69e9f2e..39d9a15 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! diff --git a/templates/munin-node.conf.Debian.feisty b/templates/munin-node.conf.Debian.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.hardy b/templates/munin-node.conf.Debian.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.feisty +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.hardy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 9fbcc8b4c693585f042ede9c4a99f147155a9218 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 14:35:15 +0000 Subject: refixed template path --- manifests/client.pp | 2 +- templates/munin-node.conf.Debian.feisty | 1 + templates/munin-node.conf.Debian.gutsy | 1 + templates/munin-node.conf.Debian.hardy | 1 + templates/munin-node.conf.Ubuntu.feisty | 1 - templates/munin-node.conf.Ubuntu.gutsy | 1 - templates/munin-node.conf.Ubuntu.hardy | 1 - 7 files changed, 4 insertions(+), 4 deletions(-) create mode 120000 templates/munin-node.conf.Debian.feisty create mode 120000 templates/munin-node.conf.Debian.gutsy create mode 120000 templates/munin-node.conf.Debian.hardy delete mode 120000 templates/munin-node.conf.Ubuntu.feisty delete mode 120000 templates/munin-node.conf.Ubuntu.gutsy delete mode 120000 templates/munin-node.conf.Ubuntu.hardy diff --git a/manifests/client.pp b/manifests/client.pp index 69e9f2e..39d9a15 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistrelease"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! diff --git a/templates/munin-node.conf.Debian.feisty b/templates/munin-node.conf.Debian.feisty new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.feisty @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.gutsy b/templates/munin-node.conf.Debian.gutsy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.gutsy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Debian.hardy b/templates/munin-node.conf.Debian.hardy new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.hardy @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.feisty b/templates/munin-node.conf.Ubuntu.feisty deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.feisty +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.gutsy b/templates/munin-node.conf.Ubuntu.gutsy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.gutsy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file diff --git a/templates/munin-node.conf.Ubuntu.hardy b/templates/munin-node.conf.Ubuntu.hardy deleted file mode 120000 index e0646b9..0000000 --- a/templates/munin-node.conf.Ubuntu.hardy +++ /dev/null @@ -1 +0,0 @@ -munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 0511449f4494f3ad81be6869a088a2b34f787ef4 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 15:03:26 +0000 Subject: fixed munin-conf on gentoo git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1258 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 39d9a15..08fc3ba 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -111,6 +111,9 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } include munin::plugins::gentoo } -- cgit v1.2.3 From 540d97e640a7b1415cdaffae922a5253f0e3790d Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 15:03:26 +0000 Subject: fixed munin-conf on gentoo git-svn-id: https://svn/ipuppet/trunk/modules/munin@1258 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 39d9a15..08fc3ba 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -111,6 +111,9 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } include munin::plugins::gentoo } -- cgit v1.2.3 From c2fc3aa408e66fe0848fef1a40d5d4f57364f331 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 24 Apr 2008 15:03:26 +0000 Subject: fixed munin-conf on gentoo --- manifests/client.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 39d9a15..08fc3ba 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -111,6 +111,9 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } include munin::plugins::gentoo } -- cgit v1.2.3 From efff17c3e98bf16ffb7993f4e695642b1e27f563 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 10:43:41 +0000 Subject: another try to fix this problem git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1261 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 08fc3ba..2208b8d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), + content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! @@ -99,6 +99,9 @@ class munin::client::debian inherits munin::client::base { # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } include munin::plugins::debian @@ -111,9 +114,7 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } - File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), - } + include munin::plugins::gentoo } -- cgit v1.2.3 From 6bc29ac288bcc25dec161a96679f1ac872f11837 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 10:43:41 +0000 Subject: another try to fix this problem git-svn-id: https://svn/ipuppet/trunk/modules/munin@1261 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 08fc3ba..2208b8d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), + content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! @@ -99,6 +99,9 @@ class munin::client::debian inherits munin::client::base { # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } include munin::plugins::debian @@ -111,9 +114,7 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } - File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), - } + include munin::plugins::gentoo } -- cgit v1.2.3 From 214e5d1a774dfa2e1c4745677f0cfce928c6167d Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 10:43:41 +0000 Subject: another try to fix this problem --- manifests/client.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 08fc3ba..2208b8d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -59,7 +59,7 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), + content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! @@ -99,6 +99,9 @@ class munin::client::debian inherits munin::client::base { # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem"), + } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } include munin::plugins::debian @@ -111,9 +114,7 @@ class munin::client::gentoo inherits munin::client::base { name => 'munin', category => 'net-analyzer', } - File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), - } + include munin::plugins::gentoo } -- cgit v1.2.3 From af24b55c6d87396d61e4946a8fa665b18f880859 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:03:45 +0000 Subject: forgot lsbdistcodename in debian git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1262 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 2208b8d..b2bad8b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,6 +1,7 @@ # client.pp - configure a munin node # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. +# Adapted and improved by admin(at)immerda.ch class munin::client { @@ -100,7 +101,7 @@ class munin::client::debian inherits munin::client::base { hasstatus => $lsbdistcodename ? { sarge => false, default => true } } File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } -- cgit v1.2.3 From 561b770f24a688842bfad68143826aefd8ab1fd0 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:03:45 +0000 Subject: forgot lsbdistcodename in debian git-svn-id: https://svn/ipuppet/trunk/modules/munin@1262 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 2208b8d..b2bad8b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,6 +1,7 @@ # client.pp - configure a munin node # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. +# Adapted and improved by admin(at)immerda.ch class munin::client { @@ -100,7 +101,7 @@ class munin::client::debian inherits munin::client::base { hasstatus => $lsbdistcodename ? { sarge => false, default => true } } File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } -- cgit v1.2.3 From b1bdb26fa56b10e78c28f7855a7e978fb1998cf6 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:03:45 +0000 Subject: forgot lsbdistcodename in debian --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 2208b8d..b2bad8b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,6 +1,7 @@ # client.pp - configure a munin node # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. +# Adapted and improved by admin(at)immerda.ch class munin::client { @@ -100,7 +101,7 @@ class munin::client::debian inherits munin::client::base { hasstatus => $lsbdistcodename ? { sarge => false, default => true } } File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } -- cgit v1.2.3 From f9d78950334f2392ecedfc3193e82f97f7af30d4 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:23:45 +0000 Subject: fixed category git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1263 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/selinux_avcstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats index 9687be0..b7d2dbb 100755 --- a/files/plugins/selinux_avcstats +++ b/files/plugins/selinux_avcstats @@ -31,7 +31,7 @@ if [ "$1" = "config" ]; then echo "graph_title SELinux's Access Vector Cache" echo 'graph_args -l 0 --base 1000' echo 'graph_vlabel AVC operations' - echo 'graph_category system' + echo 'graph_category selinux' echo 'lookups.label lookups' echo 'lookups.type DERIVE' -- cgit v1.2.3 From b312f62d11fa036c2e75d6afaafb14b03d38660b Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:23:45 +0000 Subject: fixed category git-svn-id: https://svn/ipuppet/trunk/modules/munin@1263 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/selinux_avcstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats index 9687be0..b7d2dbb 100755 --- a/files/plugins/selinux_avcstats +++ b/files/plugins/selinux_avcstats @@ -31,7 +31,7 @@ if [ "$1" = "config" ]; then echo "graph_title SELinux's Access Vector Cache" echo 'graph_args -l 0 --base 1000' echo 'graph_vlabel AVC operations' - echo 'graph_category system' + echo 'graph_category selinux' echo 'lookups.label lookups' echo 'lookups.type DERIVE' -- cgit v1.2.3 From 323fe6ec08ab758001f10b8f9a9b56656d2131cd Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:23:45 +0000 Subject: fixed category --- files/plugins/selinux_avcstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/plugins/selinux_avcstats b/files/plugins/selinux_avcstats index 9687be0..b7d2dbb 100755 --- a/files/plugins/selinux_avcstats +++ b/files/plugins/selinux_avcstats @@ -31,7 +31,7 @@ if [ "$1" = "config" ]; then echo "graph_title SELinux's Access Vector Cache" echo 'graph_args -l 0 --base 1000' echo 'graph_vlabel AVC operations' - echo 'graph_category system' + echo 'graph_category selinux' echo 'lookups.label lookups' echo 'lookups.type DERIVE' -- cgit v1.2.3 From 5f4e3cf1d1f0b7b111054e70c32fa668eba0a5a9 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:37:59 +0000 Subject: antoher try to fix the problem git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1264 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index b2bad8b..8305bf0 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -55,11 +55,11 @@ class munin::client::base { hasrestart => true, require => Package[munin-node], } - file { - "/etc/munin/": + file {"/etc/munin/": ensure => directory, mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": + } + file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can -- cgit v1.2.3 From e80b4c9f2aff54318f2f3338ef23b73a3a40a58c Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:37:59 +0000 Subject: antoher try to fix the problem git-svn-id: https://svn/ipuppet/trunk/modules/munin@1264 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index b2bad8b..8305bf0 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -55,11 +55,11 @@ class munin::client::base { hasrestart => true, require => Package[munin-node], } - file { - "/etc/munin/": + file {"/etc/munin/": ensure => directory, mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": + } + file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can -- cgit v1.2.3 From c9191ce64fe7b60fe42cfe872fcbbf3fe436d3b9 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 11:37:59 +0000 Subject: antoher try to fix the problem --- manifests/client.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index b2bad8b..8305bf0 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -55,11 +55,11 @@ class munin::client::base { hasrestart => true, require => Package[munin-node], } - file { - "/etc/munin/": + file {"/etc/munin/": ensure => directory, mode => 0755, owner => root, group => 0; - "/etc/munin/munin-node.conf": + } + file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can -- cgit v1.2.3 From 2aeaa713bc91bb6377b2dfb65eef64127aabc87e Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 14:47:46 +0000 Subject: added missing template git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1265 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian diff --git a/templates/munin-node.conf.Debian b/templates/munin-node.conf.Debian new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From a043afef5e8fb14385f59b4fee558f7f9618b050 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 14:47:46 +0000 Subject: added missing template git-svn-id: https://svn/ipuppet/trunk/modules/munin@1265 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- templates/munin-node.conf.Debian | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian diff --git a/templates/munin-node.conf.Debian b/templates/munin-node.conf.Debian new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From d1c04771e56a63d5c91cac2c8b0aa9bbdbbcffa6 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Apr 2008 14:47:46 +0000 Subject: added missing template --- templates/munin-node.conf.Debian | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian diff --git a/templates/munin-node.conf.Debian b/templates/munin-node.conf.Debian new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 876a2769f2c48979202ed03bbb7baeb0ebde14e1 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 29 Apr 2008 17:50:40 +0200 Subject: enabled munin client --- manifests/client.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/client.pp b/manifests/client.pp index 8305bf0..bee3609 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -51,6 +51,7 @@ class munin::client::base { package { "munin-node": ensure => installed } service { "munin-node": ensure => running, + enable => true, hasstatus => true, hasrestart => true, require => Package[munin-node], -- cgit v1.2.3 From 38939a4e39272232e29d7e8cda0c7fcf321171c4 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:22:49 +0000 Subject: fixed absent pluginsource git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1426 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a92c56..91b0178 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,7 +93,11 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } $real_source = $source ? { '' => "munin/plugins/$plugin_src", default => $source -- cgit v1.2.3 From c2565e972ccd7159001984e6cb351bc30a81eb51 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:22:49 +0000 Subject: fixed absent pluginsource git-svn-id: https://svn/ipuppet/trunk/modules/munin@1426 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a92c56..91b0178 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,7 +93,11 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } $real_source = $source ? { '' => "munin/plugins/$plugin_src", default => $source -- cgit v1.2.3 From aaef921ce2aae19356104872482219117288043f Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:22:49 +0000 Subject: fixed absent pluginsource --- manifests/plugin.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 6a92c56..91b0178 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -93,7 +93,11 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } } define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } $real_source = $source ? { '' => "munin/plugins/$plugin_src", default => $source -- cgit v1.2.3 From 7c8cc731ebeeff00d4a1469b8921ed6c10bc9963 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:33:08 +0000 Subject: ensure is present, absent or source git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1427 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 91b0178..e2827cd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -247,8 +247,8 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": ensure => false } - munin::plugin::deploy { "pg__locks": ensure => false } + munin::plugin::deploy { "pg__connections": ensure => 'absent' } + munin::plugin::deploy { "pg__locks": ensure => 'absent' } } class munin::plugins::nagios inherits munin::plugins::base { munin::plugin::deploy { -- cgit v1.2.3 From d7048f01be3cfdb8e588361c6987283de45a57ef Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:33:08 +0000 Subject: ensure is present, absent or source git-svn-id: https://svn/ipuppet/trunk/modules/munin@1427 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 91b0178..e2827cd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -247,8 +247,8 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": ensure => false } - munin::plugin::deploy { "pg__locks": ensure => false } + munin::plugin::deploy { "pg__connections": ensure => 'absent' } + munin::plugin::deploy { "pg__locks": ensure => 'absent' } } class munin::plugins::nagios inherits munin::plugins::base { munin::plugin::deploy { -- cgit v1.2.3 From e66f9177885ea9b5ce8e9c779b68b6f495c28362 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 13:33:08 +0000 Subject: ensure is present, absent or source --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 91b0178..e2827cd 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -247,8 +247,8 @@ class munin::plugins::selinux inherits munin::plugins::base { class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": ensure => false } - munin::plugin::deploy { "pg__locks": ensure => false } + munin::plugin::deploy { "pg__connections": ensure => 'absent' } + munin::plugin::deploy { "pg__locks": ensure => 'absent' } } class munin::plugins::nagios inherits munin::plugins::base { munin::plugin::deploy { -- cgit v1.2.3 From 931364a43a377d6b10c32fdc1bc0b224f9092424 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 14:02:11 +0000 Subject: added squid plugins git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1428 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e2827cd..d24b580 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -245,6 +245,13 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } +class munin::plugins::squid inherits munin::plugins::base { + munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} + munin::plugin{ 'squid_icp': } + munin::plugin{ 'squid_requests': } + munin::plugin{ 'squid_traffic': } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From 0449faea92a65380646c5591ee0509fcdc67ab0b Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 14:02:11 +0000 Subject: added squid plugins git-svn-id: https://svn/ipuppet/trunk/modules/munin@1428 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e2827cd..d24b580 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -245,6 +245,13 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } +class munin::plugins::squid inherits munin::plugins::base { + munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} + munin::plugin{ 'squid_icp': } + munin::plugin{ 'squid_requests': } + munin::plugin{ 'squid_traffic': } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From 0044b6581d837760c8d8bf2d1a95214a20f400c9 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 11 May 2008 14:02:11 +0000 Subject: added squid plugins --- manifests/plugin.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index e2827cd..d24b580 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -245,6 +245,13 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } +class munin::plugins::squid inherits munin::plugins::base { + munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} + munin::plugin{ 'squid_icp': } + munin::plugin{ 'squid_requests': } + munin::plugin{ 'squid_traffic': } +} + class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From d4baba70e6c5d8b1a40100497dce733d7457ab6a Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 19 May 2008 18:46:07 +0200 Subject: added require option for plugins --- manifests/plugin.pp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d24b580..1745b40 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -50,6 +50,12 @@ define munin::plugin ( require => Package['munin-node'], notify => Service['munin-node']; } + + if $require { + File[$plugin]{ + require +> $require, + } + } } } case $config { @@ -69,6 +75,11 @@ define munin::plugin ( content => "[${name}]\n$config\n", mode => 0644, owner => root, group => 0, } + if $require { + File[$plugin_conf]{ + require +> $require, + } + } } } } @@ -107,11 +118,19 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$server/$real_source", - ensure => file, + require => Package['munin-node'], mode => 0755, owner => root, group => 0; } + if $require { + File["munin_plugin_${name}"]{ + require +> $require, + } + munin::plugin{$name: ensure => $ensure, config => $config, require => $require } + } else { + munin::plugin{$name: ensure => $ensure, config => $config } + } - munin::plugin{$name: ensure => $ensure, config => $config } + } ### clases for plugins -- cgit v1.2.3 From e9910cf5749f5c3f96199cd2a91c269dbbaa5ef3 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 19 May 2008 18:50:29 +0200 Subject: removed unneeded file --- files/.git_placeholder | 1 - 1 file changed, 1 deletion(-) delete mode 100644 files/.git_placeholder diff --git a/files/.git_placeholder b/files/.git_placeholder deleted file mode 100644 index 89cb1fe..0000000 --- a/files/.git_placeholder +++ /dev/null @@ -1 +0,0 @@ -# file needed for git - don't remove it -- cgit v1.2.3 From 5d77d0429ccfb352c38ef8fee55b1a6658dab484 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 20 May 2008 12:22:53 +0200 Subject: fixed require order --- manifests/plugin.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index af2c9e0..22a8a7f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -45,17 +45,17 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + if $require { + $real_require = [ $require, Package['munin-node'] ] + } else { + $real_require = Package['munin-node'] + } file { $plugin: ensure => "${real_script_path}/${plugin_src}", - require => Package['munin-node'], + require => $require, notify => Service['munin-node']; } - if $require { - File[$plugin]{ - require +> $require, - } - } } } case $config { -- cgit v1.2.3 From 5547be2954d17040727d048d16fb245965ebe144 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 20 May 2008 12:29:07 +0200 Subject: adjusted require --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 22a8a7f..76d12a0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -52,7 +52,7 @@ define munin::plugin ( } file { $plugin: ensure => "${real_script_path}/${plugin_src}", - require => $require, + require => $real_require, notify => Service['munin-node']; } -- cgit v1.2.3 From 013317ba7744477be001bb3850f69ec37cc1540b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 26 May 2008 11:21:28 +0200 Subject: made munin_allow a lot more scalable --- README | 4 ++++ manifests/client.pp | 4 ++++ templates/munin-node.conf.Debian.etch | 6 ++++-- templates/munin-node.conf.default | 7 +++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README b/README index 762a802..4f0e2db 100644 --- a/README +++ b/README @@ -45,6 +45,10 @@ To use this module, follow these directions: connect to your individual munin-nodes (this is typically your main munin host's IP): $munin_allow = '192.168.0.1' + + If you want to define more than one host, you can seperate them by colon: + + $munin_allow = '127.0.0.1:192.168.0.1' e. In the node definition in your site.pp for your main munin host, add the following: diff --git a/manifests/client.pp b/manifests/client.pp index bee3609..59b6980 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -60,6 +60,10 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; } + $real_munin_allow = $munin_allow ? { + '' => '127.0.0.1', + default => $munin_allow + } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0f0f568..56da89d 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,5 +33,7 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> + diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index f10349e..5eed749 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -33,7 +33,6 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> -- cgit v1.2.3 From 07a5491ba8f4fb8cbf556eebf562da918548bda0 Mon Sep 17 00:00:00 2001 From: Simon Josi Date: Thu, 29 May 2008 18:39:42 +0200 Subject: added puzzle copyright notice --- manifests/init.pp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6b6cd08..b0c2ba1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,19 @@ +# +# munin module # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt -# See LICENSE for the full license granted to you. -# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# +# Copyright 2008, Puzzle ITC GmbH +# Marcel Härry haerry+puppet(at)puzzle.ch +# Simon Josi josi+puppet(at)puzzle.ch +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License version 3 as published by +# the Free Software Foundation. # -# the port is a parameter so vservers can share IP addresses and still be happy +# the port is a parameter so vservers can share +# IP addresses and still be happy # Define where the individual nodes' configs are stored $NODESDIR="/var/lib/puppet/modules/munin/nodes" -- cgit v1.2.3 From aed996efe16b24837d70873f9b6143ed3968e873 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 13 Jun 2008 20:02:00 +0000 Subject: added readme title git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1599 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 762a802..f7ecba6 100644 --- a/README +++ b/README @@ -1,3 +1,4 @@ +== Munin == Munin is a performance monitoring system which creates nice RRD graphs and has a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ -- cgit v1.2.3 From 2c530ac300a57c54ce55dce73481693f93cc6e38 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 13 Jun 2008 20:02:00 +0000 Subject: added readme title git-svn-id: https://svn/ipuppet/trunk/modules/munin@1599 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 762a802..f7ecba6 100644 --- a/README +++ b/README @@ -1,3 +1,4 @@ +== Munin == Munin is a performance monitoring system which creates nice RRD graphs and has a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ -- cgit v1.2.3 From 86977f459f20c2bb55eec6cbed9f49fc2dca25ab Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 13 Jun 2008 20:02:00 +0000 Subject: added readme title --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 762a802..f7ecba6 100644 --- a/README +++ b/README @@ -1,3 +1,4 @@ +== Munin == Munin is a performance monitoring system which creates nice RRD graphs and has a very easy plugin interface. The munin homepage is http://munin.projects.linpro.no/ -- cgit v1.2.3 From 4f8fbfcc736d02ec0528b0df571d5d4a458c261e Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 13 Jun 2008 20:02:35 +0000 Subject: Merge commit 'puzzle/development' git-svn-id: https://svn/ipuppet/trunk/modules/munin@1600 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 4 ++++ files/empty/.git_placeholder | 1 + manifests/client.pp | 5 +++++ manifests/init.pp | 16 +++++++++++++--- manifests/plugin.pp | 25 +++++++++++++++++++++---- templates/munin-node.conf.Debian.etch | 6 ++++-- templates/munin-node.conf.default | 7 +++---- 7 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 files/empty/.git_placeholder diff --git a/README b/README index f7ecba6..5384c30 100644 --- a/README +++ b/README @@ -46,6 +46,10 @@ To use this module, follow these directions: connect to your individual munin-nodes (this is typically your main munin host's IP): $munin_allow = '192.168.0.1' + + If you want to define more than one host, you can seperate them by colon: + + $munin_allow = '127.0.0.1:192.168.0.1' e. In the node definition in your site.pp for your main munin host, add the following: diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.git_placeholder @@ -0,0 +1 @@ +# just used for git diff --git a/manifests/client.pp b/manifests/client.pp index 8305bf0..59b6980 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -51,6 +51,7 @@ class munin::client::base { package { "munin-node": ensure => installed } service { "munin-node": ensure => running, + enable => true, hasstatus => true, hasrestart => true, require => Package[munin-node], @@ -59,6 +60,10 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; } + $real_munin_allow = $munin_allow ? { + '' => '127.0.0.1', + default => $munin_allow + } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, diff --git a/manifests/init.pp b/manifests/init.pp index 6b6cd08..b0c2ba1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,19 @@ +# +# munin module # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt -# See LICENSE for the full license granted to you. -# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# +# Copyright 2008, Puzzle ITC GmbH +# Marcel Härry haerry+puppet(at)puzzle.ch +# Simon Josi josi+puppet(at)puzzle.ch +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License version 3 as published by +# the Free Software Foundation. # -# the port is a parameter so vservers can share IP addresses and still be happy +# the port is a parameter so vservers can share +# IP addresses and still be happy # Define where the individual nodes' configs are stored $NODESDIR="/var/lib/puppet/modules/munin/nodes" diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d24b580..76d12a0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -45,11 +45,17 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + if $require { + $real_require = [ $require, Package['munin-node'] ] + } else { + $real_require = Package['munin-node'] + } file { $plugin: ensure => "${real_script_path}/${plugin_src}", - require => Package['munin-node'], + require => $real_require, notify => Service['munin-node']; } + } } case $config { @@ -69,6 +75,11 @@ define munin::plugin ( content => "[${name}]\n$config\n", mode => 0644, owner => root, group => 0, } + if $require { + File[$plugin_conf]{ + require +> $require, + } + } } } } @@ -107,11 +118,17 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$server/$real_source", - ensure => file, + require => Package['munin-node'], mode => 0755, owner => root, group => 0; } - - munin::plugin{$name: ensure => $ensure, config => $config } + if $require { + File["munin_plugin_${name}"]{ + require +> $require, + } + munin::plugin{$name: ensure => $ensure, config => $config, require => $require } + } else { + munin::plugin{$name: ensure => $ensure, config => $config } + } } ### clases for plugins diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0f0f568..56da89d 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,5 +33,7 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> + diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index f10349e..5eed749 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -33,7 +33,6 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> -- cgit v1.2.3 From 805d56cac760f6d047b83c470c080bee3342165f Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 13 Jun 2008 20:02:35 +0000 Subject: Merge commit 'puzzle/development' --- README | 4 ++++ files/empty/.git_placeholder | 1 + manifests/client.pp | 5 +++++ manifests/init.pp | 16 +++++++++++++--- manifests/plugin.pp | 25 +++++++++++++++++++++---- templates/munin-node.conf.Debian.etch | 6 ++++-- templates/munin-node.conf.default | 7 +++---- 7 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 files/empty/.git_placeholder diff --git a/README b/README index f7ecba6..5384c30 100644 --- a/README +++ b/README @@ -46,6 +46,10 @@ To use this module, follow these directions: connect to your individual munin-nodes (this is typically your main munin host's IP): $munin_allow = '192.168.0.1' + + If you want to define more than one host, you can seperate them by colon: + + $munin_allow = '127.0.0.1:192.168.0.1' e. In the node definition in your site.pp for your main munin host, add the following: diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.git_placeholder @@ -0,0 +1 @@ +# just used for git diff --git a/manifests/client.pp b/manifests/client.pp index 8305bf0..59b6980 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -51,6 +51,7 @@ class munin::client::base { package { "munin-node": ensure => installed } service { "munin-node": ensure => running, + enable => true, hasstatus => true, hasrestart => true, require => Package[munin-node], @@ -59,6 +60,10 @@ class munin::client::base { ensure => directory, mode => 0755, owner => root, group => 0; } + $real_munin_allow = $munin_allow ? { + '' => '127.0.0.1', + default => $munin_allow + } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), mode => 0644, owner => root, group => 0, diff --git a/manifests/init.pp b/manifests/init.pp index 6b6cd08..b0c2ba1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,19 @@ +# +# munin module # munin.pp - everything a sitewide munin installation needs # Copyright (C) 2007 David Schmitt -# See LICENSE for the full license granted to you. -# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch +# +# Copyright 2008, Puzzle ITC GmbH +# Marcel Härry haerry+puppet(at)puzzle.ch +# Simon Josi josi+puppet(at)puzzle.ch +# +# This program is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License version 3 as published by +# the Free Software Foundation. # -# the port is a parameter so vservers can share IP addresses and still be happy +# the port is a parameter so vservers can share +# IP addresses and still be happy # Define where the individual nodes' configs are stored $NODESDIR="/var/lib/puppet/modules/munin/nodes" diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d24b580..76d12a0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -45,11 +45,17 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + if $require { + $real_require = [ $require, Package['munin-node'] ] + } else { + $real_require = Package['munin-node'] + } file { $plugin: ensure => "${real_script_path}/${plugin_src}", - require => Package['munin-node'], + require => $real_require, notify => Service['munin-node']; } + } } case $config { @@ -69,6 +75,11 @@ define munin::plugin ( content => "[${name}]\n$config\n", mode => 0644, owner => root, group => 0, } + if $require { + File[$plugin_conf]{ + require +> $require, + } + } } } } @@ -107,11 +118,17 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$server/$real_source", - ensure => file, + require => Package['munin-node'], mode => 0755, owner => root, group => 0; } - - munin::plugin{$name: ensure => $ensure, config => $config } + if $require { + File["munin_plugin_${name}"]{ + require +> $require, + } + munin::plugin{$name: ensure => $ensure, config => $config, require => $require } + } else { + munin::plugin{$name: ensure => $ensure, config => $config } + } } ### clases for plugins diff --git a/templates/munin-node.conf.Debian.etch b/templates/munin-node.conf.Debian.etch index 0f0f568..56da89d 100644 --- a/templates/munin-node.conf.Debian.etch +++ b/templates/munin-node.conf.Debian.etch @@ -33,5 +33,7 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> + diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index f10349e..5eed749 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -33,7 +33,6 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like -allow ^127\.0\.0\.1$ -allow <%= munin_allow1 %> -allow <%= munin_allow2 %> - +<% real_munin_allow.split(':').each do |val| -%> +allow <%= '^'+val.gsub(/\./, '\.')+'$' %> +<% end -%> -- cgit v1.2.3 From 4a7b0491b2e9c92733098650782fc60edb57cddb Mon Sep 17 00:00:00 2001 From: duritong Date: Sat, 5 Jul 2008 12:32:22 +0200 Subject: if the munin node config file is changed it should notify the service --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 59b6980..9a7b772 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,10 +66,11 @@ class munin::client::base { } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), - mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, } munin::register { $fqdn: } include munin::plugins::base -- cgit v1.2.3 From cf63249e27ccb9a3c320d61aa3cd36d449ec2474 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 18:41:50 +0000 Subject: if the munin node config file is changed it should notify the service git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1777 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 59b6980..9a7b772 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,10 +66,11 @@ class munin::client::base { } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), - mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, } munin::register { $fqdn: } include munin::plugins::base -- cgit v1.2.3 From 12f797a7968d5adc27de20c6651a56594fb4fa36 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 18:41:50 +0000 Subject: if the munin node config file is changed it should notify the service git-svn-id: https://svn/ipuppet/trunk/modules/munin@1777 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 59b6980..9a7b772 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,10 +66,11 @@ class munin::client::base { } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), - mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, } munin::register { $fqdn: } include munin::plugins::base -- cgit v1.2.3 From 6db2a3fbbb42df462d8c9752fd13c11ee3a7a6d1 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 18:41:50 +0000 Subject: if the munin node config file is changed it should notify the service --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 59b6980..9a7b772 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,10 +66,11 @@ class munin::client::base { } file {"/etc/munin/munin-node.conf": content => template("munin/munin-node.conf.$operatingsystem"), - mode => 0644, owner => root, group => 0, # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package["munin-node"], + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, } munin::register { $fqdn: } include munin::plugins::base -- cgit v1.2.3 From 9da545785dca34eb9e76321bf3a2396521e3ac45 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 18:41:55 +0000 Subject: merged with davids and removed a case statement, which made no sense git-svn-id: https://svn/ipuppet/trunk/modules/munin@1778 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/modules_dir/.ignore | 0 manifests/plugin.pp | 41 ++++++++++++----------------------------- 2 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 files/modules_dir/.ignore diff --git a/files/modules_dir/.ignore b/files/modules_dir/.ignore new file mode 100644 index 0000000..e69de29 diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 76d12a0..2c64482 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -134,35 +134,18 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { ### clases for plugins class munin::plugins::base { - case $operatingsystem { - centos: { - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/munin/empty", - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => 0; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => 0; - } - } - - default: { - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/munin/empty", - 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'], - before => Package['munin-node']; - } - } + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$server/common/empty", + 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'], + before => Package['munin-node']; } case $kernel { linux: { -- cgit v1.2.3 From d1da2f1bc572a889534623910a86bbf3334ae615 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 18:41:55 +0000 Subject: merged with davids and removed a case statement, which made no sense --- files/modules_dir/.ignore | 0 manifests/plugin.pp | 41 ++++++++++++----------------------------- 2 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 files/modules_dir/.ignore diff --git a/files/modules_dir/.ignore b/files/modules_dir/.ignore new file mode 100644 index 0000000..e69de29 diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 76d12a0..2c64482 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -134,35 +134,18 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { ### clases for plugins class munin::plugins::base { - case $operatingsystem { - centos: { - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/munin/empty", - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => 0; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => 0; - } - } - - default: { - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/munin/empty", - 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'], - before => Package['munin-node']; - } - } + file { + [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + source => "puppet://$server/common/empty", + 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'], + before => Package['munin-node']; } case $kernel { linux: { -- cgit v1.2.3 From 5f9c7472f704104561597ab75a9f591a61f7b672 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 21:36:57 +0000 Subject: added ignore for empty git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1785 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2c64482..9111aec 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,6 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", + ignore => '.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From f15a82d411de4fa50262efa7d16e8b1d7f2b7886 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 21:36:57 +0000 Subject: added ignore for empty git-svn-id: https://svn/ipuppet/trunk/modules/munin@1785 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2c64482..9111aec 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,6 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", + ignore => '.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From b262e458a21377540d4cbfa3af402878a1bea457 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 8 Jul 2008 21:36:57 +0000 Subject: added ignore for empty --- manifests/plugin.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2c64482..9111aec 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,6 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", + ignore => '.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From a73d92553609a8195beaf6d531d5c0c20e9b5f07 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 16 Jul 2008 14:09:01 +0200 Subject: fixed xen_traffic_all plugin --- files/plugins/xen_traffic_all | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 1216a7d..73eb504 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -1,6 +1,12 @@ #!/bin/sh # Author: mario manno # Description: measure traffic for all xen hosts +# +# 16.07.2008: improved the Plugin by Puzzle ITC to +# enable the traffic monitoring for domains +# with more than 1 one interface +# If there is more than one device, the domainname +# will get the vif name appended. # #%# family=auto #%# capabilities=autoconf @@ -46,18 +52,21 @@ fi DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - dev=$( xm network-list $dom |\ + devs=$( xm network-list $dom |\ egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') - name=$( echo $dom | sed -e's/-/_/g' ) - #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ - #'{ sub(/^ */,""); if ($1 == interface) \ - #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev - awk -v name="$name" -v interface="$dev" \ - 'BEGIN { gsub(/\./, "\\.", interface) } \ - $1 ~ "^" interface ":" { - split($0, a, /: */); $0 = a[2]; \ - print name"Down.value " $1 "\n"name"Up.value " $9 \ - }' \ - /proc/net/dev + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"$dev + fi + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev + done done -- cgit v1.2.3 From aa90466bb4a4c0404321531f40311d5c0726684f Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 16 Jul 2008 16:41:05 +0200 Subject: for munin a . is a delimeter, so replacing . with _ --- files/plugins/xen_traffic_all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 73eb504..55740f0 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -58,7 +58,7 @@ for dom in $DOMAINS; do name=$real_name for dev in $devs; do if [ ${#devs} -gt 1 ]; then - name=$real_name"_"$dev + name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi awk -v name="$name" -v interface="$dev" \ 'BEGIN { gsub(/\./, "\\.", interface) } \ -- cgit v1.2.3 From 2de5b80d2686711e0d7b0d8aabee6e14919709af Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 16 Jul 2008 17:25:31 +0200 Subject: fixing config --- files/plugins/xen_traffic_all | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 55740f0..3fcb508 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -34,18 +34,26 @@ if [ "$1" = "config" ]; then echo 'graph_category xen' DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - name=$( echo $dom | sed -e's/-/_/g' ) - #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + devs=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"`echo $dev | sed 's/\./\_/'` + fi + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" - echo $name'Down.label received' - echo $name'Down.type COUNTER' - echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" - echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' - echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi -- cgit v1.2.3 From cf9b3c380fbef1ff10f5e40f22bb2d3ef436c077 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Jul 2008 12:58:47 +0000 Subject: Merge commit 'puzzle/development' git-svn-id: https://svn/ipuppet/trunk/modules/munin@1863 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/xen_traffic_all | 63 +++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 1216a7d..3fcb508 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -1,6 +1,12 @@ #!/bin/sh # Author: mario manno # Description: measure traffic for all xen hosts +# +# 16.07.2008: improved the Plugin by Puzzle ITC to +# enable the traffic monitoring for domains +# with more than 1 one interface +# If there is more than one device, the domainname +# will get the vif name appended. # #%# family=auto #%# capabilities=autoconf @@ -28,36 +34,47 @@ if [ "$1" = "config" ]; then echo 'graph_category xen' DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - name=$( echo $dom | sed -e's/-/_/g' ) - #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + devs=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"`echo $dev | sed 's/\./\_/'` + fi + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" - echo $name'Down.label received' - echo $name'Down.type COUNTER' - echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" - echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' - echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - dev=$( xm network-list $dom |\ + devs=$( xm network-list $dom |\ egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') - name=$( echo $dom | sed -e's/-/_/g' ) - #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ - #'{ sub(/^ */,""); if ($1 == interface) \ - #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev - awk -v name="$name" -v interface="$dev" \ - 'BEGIN { gsub(/\./, "\\.", interface) } \ - $1 ~ "^" interface ":" { - split($0, a, /: */); $0 = a[2]; \ - print name"Down.value " $1 "\n"name"Up.value " $9 \ - }' \ - /proc/net/dev + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"`echo $dev | sed 's/\./\_/'` + fi + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev + done done -- cgit v1.2.3 From 4e6ec49e07afe8b04defa9ef06bb2ae0b7cceb04 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Jul 2008 12:58:47 +0000 Subject: Merge commit 'puzzle/development' --- files/plugins/xen_traffic_all | 63 +++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 1216a7d..3fcb508 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -1,6 +1,12 @@ #!/bin/sh # Author: mario manno # Description: measure traffic for all xen hosts +# +# 16.07.2008: improved the Plugin by Puzzle ITC to +# enable the traffic monitoring for domains +# with more than 1 one interface +# If there is more than one device, the domainname +# will get the vif name appended. # #%# family=auto #%# capabilities=autoconf @@ -28,36 +34,47 @@ if [ "$1" = "config" ]; then echo 'graph_category xen' DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - name=$( echo $dom | sed -e's/-/_/g' ) - #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + devs=$( xm network-list $dom |\ + egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"`echo $dev | sed 's/\./\_/'` + fi + #echo $name"UP.label $name" + #echo $name"DOWN.label $name" - echo $name'Down.label received' - echo $name'Down.type COUNTER' - echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" - echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' - echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" + echo $name'Down.label received' + echo $name'Down.type COUNTER' + echo $name'Down.graph no' + echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Up.label ${name}" + echo $name'Up.type COUNTER' + echo "${name}Up.negative ${name}Down" + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)") for dom in $DOMAINS; do - dev=$( xm network-list $dom |\ + devs=$( xm network-list $dom |\ egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@') - name=$( echo $dom | sed -e's/-/_/g' ) - #awk -v name="$name" -v interface="$dev" -F'[: \t]+' \ - #'{ sub(/^ */,""); if ($1 == interface) \ - #print name"DOWN.value "$2"\n"name"UP.value "$10; }' /proc/net/dev - awk -v name="$name" -v interface="$dev" \ - 'BEGIN { gsub(/\./, "\\.", interface) } \ - $1 ~ "^" interface ":" { - split($0, a, /: */); $0 = a[2]; \ - print name"Down.value " $1 "\n"name"Up.value " $9 \ - }' \ - /proc/net/dev + real_name=$( echo $dom | sed -e's/-/_/g' ) + name=$real_name + for dev in $devs; do + if [ ${#devs} -gt 1 ]; then + name=$real_name"_"`echo $dev | sed 's/\./\_/'` + fi + awk -v name="$name" -v interface="$dev" \ + 'BEGIN { gsub(/\./, "\\.", interface) } \ + $1 ~ "^" interface ":" { + split($0, a, /: */); $0 = a[2]; \ + print name"Down.value " $1 "\n"name"Up.value " $9 \ + }' \ + /proc/net/dev + done done -- cgit v1.2.3 From cc024b9e4b4bc76e60908eefd0525a0ddf25e7fa Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Jul 2008 18:48:39 +0000 Subject: added cgi graph note git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1878 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 5384c30..12b73e8 100644 --- a/README +++ b/README @@ -86,3 +86,5 @@ To use this module, follow these directions: $munin_port = 4948 + i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto + ToDo: implement this in puppet -- cgit v1.2.3 From 205a022c2d3edcfdb59c994bcff4845e8615ba20 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Jul 2008 18:48:39 +0000 Subject: added cgi graph note git-svn-id: https://svn/ipuppet/trunk/modules/munin@1878 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 5384c30..12b73e8 100644 --- a/README +++ b/README @@ -86,3 +86,5 @@ To use this module, follow these directions: $munin_port = 4948 + i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto + ToDo: implement this in puppet -- cgit v1.2.3 From 97bc6c369695a5c67ae7bb16c1d5fbc4e35f38e6 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 17 Jul 2008 18:48:39 +0000 Subject: added cgi graph note --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 5384c30..12b73e8 100644 --- a/README +++ b/README @@ -86,3 +86,5 @@ To use this module, follow these directions: $munin_port = 4948 + i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto + ToDo: implement this in puppet -- cgit v1.2.3 From 9b3ee452abbd4b696bd0cff7e1a7844a4abccac6 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 19 Jul 2008 15:12:10 +0000 Subject: factored out squid munin plugin, cleaned up some whitespaces in xen plugin git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1909 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/xen_traffic_all | 12 ++++++------ manifests/plugin.pp | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 3fcb508..1e9b06e 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -43,17 +43,17 @@ if [ "$1" = "config" ]; then name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + #echo $name"DOWN.label $name" echo $name'Down.label received' - echo $name'Down.type COUNTER' + echo $name'Down.type COUNTER' echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Down.cdef ${name}Down,8,*" echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' + echo $name'Up.type COUNTER' echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" - done + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 9111aec..2065c79 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -246,13 +246,6 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } -class munin::plugins::squid inherits munin::plugins::base { - munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} - munin::plugin{ 'squid_icp': } - munin::plugin{ 'squid_requests': } - munin::plugin{ 'squid_traffic': } -} - class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From a0eba1c444207b6fad449e3de61d60fcdd6994d9 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 19 Jul 2008 15:12:10 +0000 Subject: factored out squid munin plugin, cleaned up some whitespaces in xen plugin git-svn-id: https://svn/ipuppet/trunk/modules/munin@1909 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/plugins/xen_traffic_all | 12 ++++++------ manifests/plugin.pp | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 3fcb508..1e9b06e 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -43,17 +43,17 @@ if [ "$1" = "config" ]; then name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + #echo $name"DOWN.label $name" echo $name'Down.label received' - echo $name'Down.type COUNTER' + echo $name'Down.type COUNTER' echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Down.cdef ${name}Down,8,*" echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' + echo $name'Up.type COUNTER' echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" - done + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 9111aec..2065c79 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -246,13 +246,6 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } -class munin::plugins::squid inherits munin::plugins::base { - munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} - munin::plugin{ 'squid_icp': } - munin::plugin{ 'squid_requests': } - munin::plugin{ 'squid_traffic': } -} - class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From edf55dda28e3642fd9fc849bcfd91f09e3844161 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 19 Jul 2008 15:12:10 +0000 Subject: factored out squid munin plugin, cleaned up some whitespaces in xen plugin --- files/plugins/xen_traffic_all | 12 ++++++------ manifests/plugin.pp | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 3fcb508..1e9b06e 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -43,17 +43,17 @@ if [ "$1" = "config" ]; then name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi #echo $name"UP.label $name" - #echo $name"DOWN.label $name" + #echo $name"DOWN.label $name" echo $name'Down.label received' - echo $name'Down.type COUNTER' + echo $name'Down.type COUNTER' echo $name'Down.graph no' - echo "${name}Down.cdef ${name}Down,8,*" + echo "${name}Down.cdef ${name}Down,8,*" echo "${name}Up.label ${name}" - echo $name'Up.type COUNTER' + echo $name'Up.type COUNTER' echo "${name}Up.negative ${name}Down" - echo "${name}Up.cdef ${name}Up,8,*" - done + echo "${name}Up.cdef ${name}Up,8,*" + done done exit 0 fi diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 9111aec..2065c79 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -246,13 +246,6 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } -class munin::plugins::squid inherits munin::plugins::base { - munin::plugin{ 'squid_cache': config => "user root\nenv.squidhost localhost\nenv.squidport 80"} - munin::plugin{ 'squid_icp': } - munin::plugin{ 'squid_requests': } - munin::plugin{ 'squid_traffic': } -} - class munin::plugins::postgres inherits munin::plugins::base { munin::plugin::deploy { "pg_conn": } munin::plugin::deploy { "pg__connections": ensure => 'absent' } -- cgit v1.2.3 From 551262955361a05b9f28c4871a89efaf51488139 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 10:32:13 +0200 Subject: implemented cgi usage for munin graphing for centso --- README | 2 +- files/config/host/logrotate.CentOS | 35 ++++++++++++++ files/config/host/munin.conf.header.CentOS | 73 ++++++++++++++++++++++++++++++ manifests/host.pp | 31 +++++++++++++ 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 files/config/host/logrotate.CentOS create mode 100644 files/config/host/munin.conf.header.CentOS diff --git a/README b/README index 12b73e8..f7da439 100644 --- a/README +++ b/README @@ -87,4 +87,4 @@ To use this module, follow these directions: $munin_port = 4948 i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto - ToDo: implement this in puppet + For CentOS this is enabled in the default header config diff --git a/files/config/host/logrotate.CentOS b/files/config/host/logrotate.CentOS new file mode 100644 index 0000000..411de3f --- /dev/null +++ b/files/config/host/logrotate.CentOS @@ -0,0 +1,35 @@ +/var/log/munin/munin-update.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-graph.log { + daily + missingok + rotate 7 + compress + notifempty + create 660 munin apache +} + +/var/log/munin/munin-html.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-limits.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS new file mode 100644 index 0000000..314a979 --- /dev/null +++ b/files/config/host/munin.conf.header.CentOS @@ -0,0 +1,73 @@ +# 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/www/munin +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 + +graph_strategy cgi + +# 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/manifests/host.pp b/manifests/host.pp index 8f79020..aeb254d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -8,6 +8,16 @@ class munin::host File <<| tag == 'munin' |>> + file{'/etc/munin/munin.conf.header': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", + "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/files/munin/config/host/munin.conf.header", + "puppet://$server/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/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 => $NODESDIR, header => "/etc/munin/munin.conf.header", @@ -20,6 +30,27 @@ class munin::host } include munin::plugins::muninhost + + case $operatingsystem { + centos: { include munin::host::cgi } + } +} + +class munin::host::cgi { + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + + file{'/etc/logrotate.d/munin' + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate" + "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/files/munin/config/host/logrotate", + "puppet://$server/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } class munin::snmp_collector -- cgit v1.2.3 From 622b2c11024163f9e7abd15a35623101e80847ef Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 10:52:42 +0200 Subject: fixed typo --- manifests/host.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index aeb254d..aeaf10f 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -43,8 +43,8 @@ class munin::host::cgi { subscribe => File['/etc/munin/munin.conf.header'], } - file{'/etc/logrotate.d/munin' - source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate" + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", "puppet://$server/files/munin/config/host/logrotate", "puppet://$server/munin/config/host/logrotate.$operatingsystem", -- cgit v1.2.3 From 921ed592e9f6d5927a6a4f4e05de97e8daf9f477 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 11:14:00 +0200 Subject: fixing locations for centos --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index aeaf10f..f086aad 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -38,7 +38,7 @@ class munin::host class munin::host::cgi { exec{'set_modes_for_cgi': - command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod g+w {} \;', + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod g+w {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], } -- cgit v1.2.3 From e1999bb72e4c4fdd39d4b6556b53d78a46ddd71c Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 16:02:48 +0200 Subject: correct naming of the placeholder --- files/empty/.git_placeholder | 1 - files/empty/.ignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 files/empty/.git_placeholder create mode 100644 files/empty/.ignore diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder deleted file mode 100644 index 91162ec..0000000 --- a/files/empty/.git_placeholder +++ /dev/null @@ -1 +0,0 @@ -# just used for git diff --git a/files/empty/.ignore b/files/empty/.ignore new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.ignore @@ -0,0 +1 @@ +# just used for git -- cgit v1.2.3 From 3c6cb0e28220543cfd91a3cc7c02623f05a0ebb8 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 16:54:58 +0200 Subject: group writing should be set recursive --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index f086aad..fdaa255 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -38,7 +38,7 @@ class munin::host class munin::host::cgi { exec{'set_modes_for_cgi': - command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod g+w {} \;', + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], } -- cgit v1.2.3 From 02fa3009703f0817a4f2f84ba53aef617391ac1d Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 21 Jul 2008 18:51:12 +0200 Subject: fixed html location for munin --- files/config/host/munin.conf.header.CentOS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS index 314a979..da05b5a 100644 --- a/files/config/host/munin.conf.header.CentOS +++ b/files/config/host/munin.conf.header.CentOS @@ -4,7 +4,7 @@ # 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/www/munin +htmldir /var/www/html/munin/ logdir /var/log/munin rundir /var/run/munin -- cgit v1.2.3 From cdecebc6cb9720e50e3a5be91ce7c38814a330bc Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 22 Jul 2008 11:51:39 +0200 Subject: regexp tryout --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2065c79..4940eaf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '.ignore', + ignore => '\.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 9579c7f3228be87d120886b1440f4eda09234bf4 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Jul 2008 21:14:46 +0000 Subject: merged with immerda git-svn-id: https://svn/ipuppet/trunk/modules/munin@1915 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- README | 6 ++- files/config/host/logrotate.CentOS | 35 ++++++++++++++ files/config/host/munin.conf.header.CentOS | 77 ++++++++++++++++++++++++++++++ files/plugins/xen_traffic_all | 2 - manifests/host.pp | 31 ++++++++++++ manifests/plugin.pp | 2 +- 6 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 files/config/host/logrotate.CentOS create mode 100644 files/config/host/munin.conf.header.CentOS diff --git a/README b/README index 12b73e8..5964b21 100644 --- a/README +++ b/README @@ -86,5 +86,7 @@ To use this module, follow these directions: $munin_port = 4948 - i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto - ToDo: implement this in puppet + i. If you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto + For CentOS this is enabled in the default header config + + j. Per default (on CentOS) munin will send warnings and critical messages to root diff --git a/files/config/host/logrotate.CentOS b/files/config/host/logrotate.CentOS new file mode 100644 index 0000000..411de3f --- /dev/null +++ b/files/config/host/logrotate.CentOS @@ -0,0 +1,35 @@ +/var/log/munin/munin-update.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-graph.log { + daily + missingok + rotate 7 + compress + notifempty + create 660 munin apache +} + +/var/log/munin/munin-html.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-limits.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS new file mode 100644 index 0000000..dcadd6b --- /dev/null +++ b/files/config/host/munin.conf.header.CentOS @@ -0,0 +1,77 @@ +# 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/www/html/munin/ +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 + +graph_strategy cgi + +# 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/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 1e9b06e..76d4ded 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -42,8 +42,6 @@ if [ "$1" = "config" ]; then if [ ${#devs} -gt 1 ]; then name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi - #echo $name"UP.label $name" - #echo $name"DOWN.label $name" echo $name'Down.label received' echo $name'Down.type COUNTER' diff --git a/manifests/host.pp b/manifests/host.pp index 8f79020..fdaa255 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -8,6 +8,16 @@ class munin::host File <<| tag == 'munin' |>> + file{'/etc/munin/munin.conf.header': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", + "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/files/munin/config/host/munin.conf.header", + "puppet://$server/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/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 => $NODESDIR, header => "/etc/munin/munin.conf.header", @@ -20,6 +30,27 @@ class munin::host } include munin::plugins::muninhost + + case $operatingsystem { + centos: { include munin::host::cgi } + } +} + +class munin::host::cgi { + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", + "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/files/munin/config/host/logrotate", + "puppet://$server/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } class munin::snmp_collector diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2065c79..4940eaf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '.ignore', + ignore => '\.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From f333f2ab43ea1c4d8abae333cff1a4f3471d90e7 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Jul 2008 21:14:46 +0000 Subject: merged with immerda --- README | 6 ++- files/config/host/logrotate.CentOS | 35 ++++++++++++++ files/config/host/munin.conf.header.CentOS | 77 ++++++++++++++++++++++++++++++ files/plugins/xen_traffic_all | 2 - manifests/host.pp | 31 ++++++++++++ manifests/plugin.pp | 2 +- 6 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 files/config/host/logrotate.CentOS create mode 100644 files/config/host/munin.conf.header.CentOS diff --git a/README b/README index 12b73e8..5964b21 100644 --- a/README +++ b/README @@ -86,5 +86,7 @@ To use this module, follow these directions: $munin_port = 4948 - i. if you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto - ToDo: implement this in puppet + i. If you'd like to do cgi graphing, please note the following page: http://munin.projects.linpro.no/wiki/CgiHowto + For CentOS this is enabled in the default header config + + j. Per default (on CentOS) munin will send warnings and critical messages to root diff --git a/files/config/host/logrotate.CentOS b/files/config/host/logrotate.CentOS new file mode 100644 index 0000000..411de3f --- /dev/null +++ b/files/config/host/logrotate.CentOS @@ -0,0 +1,35 @@ +/var/log/munin/munin-update.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-graph.log { + daily + missingok + rotate 7 + compress + notifempty + create 660 munin apache +} + +/var/log/munin/munin-html.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} + +/var/log/munin/munin-limits.log { + daily + missingok + rotate 7 + compress + notifempty + create 640 munin adm +} diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS new file mode 100644 index 0000000..dcadd6b --- /dev/null +++ b/files/config/host/munin.conf.header.CentOS @@ -0,0 +1,77 @@ +# 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/www/html/munin/ +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 + +graph_strategy cgi + +# 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/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 1e9b06e..76d4ded 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -42,8 +42,6 @@ if [ "$1" = "config" ]; then if [ ${#devs} -gt 1 ]; then name=$real_name"_"`echo $dev | sed 's/\./\_/'` fi - #echo $name"UP.label $name" - #echo $name"DOWN.label $name" echo $name'Down.label received' echo $name'Down.type COUNTER' diff --git a/manifests/host.pp b/manifests/host.pp index 8f79020..fdaa255 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -8,6 +8,16 @@ class munin::host File <<| tag == 'munin' |>> + file{'/etc/munin/munin.conf.header': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", + "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/files/munin/config/host/munin.conf.header", + "puppet://$server/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/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 => $NODESDIR, header => "/etc/munin/munin.conf.header", @@ -20,6 +30,27 @@ class munin::host } include munin::plugins::muninhost + + case $operatingsystem { + centos: { include munin::host::cgi } + } +} + +class munin::host::cgi { + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", + "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/files/munin/config/host/logrotate", + "puppet://$server/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } class munin::snmp_collector diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2065c79..4940eaf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '.ignore', + ignore => '\.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 9dedeb3b20ae001deebb33d282a6beb678f6fd95 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Jul 2008 21:14:50 +0000 Subject: finale puzzle merge git-svn-id: https://svn/ipuppet/trunk/modules/munin@1916 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/empty/.git_placeholder | 1 - files/empty/.ignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 files/empty/.git_placeholder create mode 100644 files/empty/.ignore diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder deleted file mode 100644 index 91162ec..0000000 --- a/files/empty/.git_placeholder +++ /dev/null @@ -1 +0,0 @@ -# just used for git diff --git a/files/empty/.ignore b/files/empty/.ignore new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.ignore @@ -0,0 +1 @@ +# just used for git -- cgit v1.2.3 From 422c0e53ec096d20fe5314e1cae85b5de1f18893 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Jul 2008 21:14:50 +0000 Subject: finale puzzle merge --- files/empty/.git_placeholder | 1 - files/empty/.ignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 files/empty/.git_placeholder create mode 100644 files/empty/.ignore diff --git a/files/empty/.git_placeholder b/files/empty/.git_placeholder deleted file mode 100644 index 91162ec..0000000 --- a/files/empty/.git_placeholder +++ /dev/null @@ -1 +0,0 @@ -# just used for git diff --git a/files/empty/.ignore b/files/empty/.ignore new file mode 100644 index 0000000..91162ec --- /dev/null +++ b/files/empty/.ignore @@ -0,0 +1 @@ +# just used for git -- cgit v1.2.3 From 2e0061641a88eb54eba316c47a4caa24ecbd9ce2 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 4 Aug 2008 11:35:02 +0200 Subject: adding , as a seperator, as facter 1.5 seems to seperate liket that --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4940eaf..741de30 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -168,8 +168,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From 91b8dd6c66b3bf7e7d4cd5d99d4bc7241b4f50f9 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 4 Aug 2008 09:38:17 +0000 Subject: adding , as a seperator, as facter 1.5 seems to seperate liket that git-svn-id: https://svn/ipuppet/trunk/modules/munin@2107 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4940eaf..741de30 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -168,8 +168,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From b0c793fefc5f1fcfc3f4ac646803bb8aedfbc5d9 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 4 Aug 2008 09:38:17 +0000 Subject: adding , as a seperator, as facter 1.5 seems to seperate liket that --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4940eaf..741de30 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -168,8 +168,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") munin::plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From 17fd283a948527e37f1d76937cbeb655953d40dc Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 5 Aug 2008 17:38:46 +0200 Subject: factored postgres plugins into the postgres module --- files/plugins/pg__connections | 142 ------------------------------------------ files/plugins/pg__locks | 119 ----------------------------------- files/plugins/pg_conn | 51 --------------- manifests/plugin.pp | 5 -- 4 files changed, 317 deletions(-) delete mode 100755 files/plugins/pg__connections delete mode 100755 files/plugins/pg__locks delete mode 100755 files/plugins/pg_conn diff --git a/files/plugins/pg__connections b/files/plugins/pg__connections deleted file mode 100755 index ca95f56..0000000 --- a/files/plugins/pg__connections +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/perl -w -# Plugin for monitor postgres connections. -# -# Licenced under GPL v2. -# -# Usage: -# -# Symlink into /etc/munin/plugins/ and add the monitored -# database to the filename. e.g.: -# -# ln -s /usr/share/munin/plugins/pg__connections \ -# /etc/munin/plugins/pg__connections -# This should, however, be given through autoconf and suggest. -# -# If required, give username, password and/or Postgresql server -# host through environment variables. -# -# You must also activate Postgresql statistics. See -# http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html -# for how to enable this. Specifically, the following lines must -# exist in your postgresql.conf: -# -# stats_start_collector = true -# stats_block_level = true -# -# -# Parameters: -# -# config (required) -# -# Config variables: -# -# dbhost - Which database server to use. Defaults to -# 'localhost'. -# dbname - Which database to use. Defaults to template1 -# dbuser - A Postgresql user account with read permission to -# the given database. Defaults to -# 'postgres'. Anyway, Munin must be told which user -# this plugin should be run as. -# dbpass - The corresponding password, if -# applicable. Default to undef. Remember that -# pg_hba.conf must be configured accordingly. -# -# Magic markers -#%# family=auto -#%# capabilities=autoconf - -use strict; -use DBI; - -my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; -my $dbname = $ENV{'dbname'} || 'template1'; -my $dbuser = $ENV{'dbuser'} || 'postgres'; -my $dbuserx = $ENV{'dbuserx'} || ''; -my $dbport = $ENV{'dbport'} || '5432'; -my $dbpass = $ENV{'dbpass'} || ''; - -# Check for DBD::Pg -if (! eval "require DBD::Pg;") { - print "requires DBD::Pg\n"; - exit 1; -} - -my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; -#print "$dsn\n"; -my $dbh = DBI->connect ($dsn, $dbuser, - $dbpass, - {RaiseError =>1}) || die ""; - - - -if (exists $ARGV[0]) { - if ($ARGV[0] eq 'autoconf') { - # Check for DBD::Pg - if (! eval "require DBD::Pg;") { - print "no (DBD::Pg not found)"; - exit 1; - } - if ($dbh) { - print "yes\n"; - exit 0; - } else { - print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; - exit 1; - } - } - - if ($ARGV[0] eq "config") { - my $sql_max = "SHOW max_connections;"; - my $sth_max = $dbh->prepare($sql_max); - $sth_max->execute(); - my ($max_connections) = $sth_max->fetchrow(); - my $warning = int ($max_connections * 0.7); - my $critical = int ($max_connections * 0.8); - print "graph_title PostgresSQL active connections\n"; - print "graph_args -l 0 --base 1000\n"; - print "graph_vlabel Connections\n"; - print "graph_category Postgresql\n"; - print "graph_info Shows active Postgresql connections from $dbname\n"; - - - my $sql = "select datname, count(*) from pg_stat_activity group by datname"; - my $sth = $dbh->prepare($sql); - $sth->execute(); - my $setarea = "yes"; - while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { - print "$datname.label $datname active connections\n"; - print "$datname.info $datname active connections\n"; - print "$datname.type GAUGE\n"; - if ($setarea eq "yes") { - print "$datname.draw AREA\n"; - $setarea=""; - } else { - print "$datname.draw STACK\n"; - } - } - - print "max_connections.label Max. connections\n"; - print "max_connections.info Max. connections\n"; - print "max_connections.type GAUGE\n"; - - print "warning $warning\n"; - print "critical $critical\n"; - exit 0; - } -} - - -# select datname, count(*) from pg_stat_activity group by datname -my $sql_max = "SHOW max_connections;"; -my $sth_max = $dbh->prepare($sql_max); -$sth_max->execute(); -my ($max_connections) = $sth_max->fetchrow(); - -#my $sql = "SELECT COUNT (*) FROM pg_stat_activity;"; -my $sql = "select datname, count(*) from pg_stat_activity group by datname"; -my $sth = $dbh->prepare($sql); -$sth->execute(); -while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { - print "$datname.value $curr_conn\n"; -} -print "max_connections.value $max_connections\n"; diff --git a/files/plugins/pg__locks b/files/plugins/pg__locks deleted file mode 100755 index 33a9a8a..0000000 --- a/files/plugins/pg__locks +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/perl -w -# Plugin for monitor postgres connections. -# -# Licenced under GPL v2. -# -# Usage: -# -# Symlink into /etc/munin/plugins/ and add the monitored -# database to the filename. e.g.: -# -# ln -s /usr/share/munin/plugins/pg__locks \ -# /etc/munin/plugins/pg__locks -# This should, however, be given through autoconf and suggest. -# -# If required, give username, password and/or Postgresql server -# host through environment variables. -# -# You must also activate Postgresql statistics. See -# http://www.postgresql.org/docs/8.1/interactive/monitoring-locks.html -# for how to enable this. Specifically, the following lines must -# exist in your postgresql.conf: -# -# stats_start_collector = true -# stats_block_level = true -# -# -# Parameters: -# -# config (required) -# -# Config variables: -# -# dbhost - Which database server to use. Defaults to -# 'localhost'. -# dbname - Which database to use. Defaults to template1 -# dbuser - A Postgresql user account with read permission to -# the given database. Defaults to -# 'postgres'. Anyway, Munin must be told which user -# this plugin should be run as. -# dbpass - The corresponding password, if -# applicable. Default to undef. Remember that -# pg_hba.conf must be configured accordingly. -# -# Magic markers -#%# family=auto -#%# capabilities=autoconf - -use strict; -use DBI; - -my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; -my $dbname = $ENV{'dbname'} || 'template1'; -my $dbuser = $ENV{'dbuser'} || 'postgres'; -my $dbport = $ENV{'dbport'} || '5432'; -my $dbpass = $ENV{'dbpass'} || ''; - -# Check for DBD::Pg -if (! eval "require DBD::Pg;") { - exit 1; -} - -my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; -#print "$dsn\n"; -my $dbh = DBI->connect ($dsn, $dbuser, - $dbpass, - {RaiseError =>1}) || die ""; - - - -if (exists $ARGV[0]) { - if ($ARGV[0] eq 'autoconf') { - # Check for DBD::Pg - if (! eval "require DBD::Pg;") { - print "no (DBD::Pg not found)"; - exit 1; - } - if ($dbh) { - print "yes\n"; - exit 0; - } else { - print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; - exit 1; - } - } - - if ($ARGV[0] eq "config") { - print "graph_title PostgresSQL locks\n"; - print "graph_args --base 1000\n"; - print "graph_vlabel Locks\n"; - print "graph_category Postgresql\n"; - print "graph_info Shows Postgresql locks\n"; - print "locks.label Locks\n"; - print "locks.info Locks (more info here, please... :)\n"; - print "locks.type GAUGE\n"; - print "locks.warning 5\n"; - print "locks.critical 10\n"; - print "exlocks.label Exclusive locks\n"; - print "exlocks.info Exclusive locks (here too, please... :)\n"; - print "exlocks.type GAUGE\n"; - print "exlocks.warning 5\n"; - print "exlocks.critical 10\n"; - exit 0; - } -} - -my $sql="SELECT mode,COUNT(mode) FROM pg_locks GROUP BY mode ORDER BY mode;"; -my $sth = $dbh->prepare ($sql); -$sth->execute (); -my $locks = 0; -my $exlocks = 0; -while (my ($mode, $count) = $sth->fetchrow ()) { - if ($mode =~ /exclusive/i) { - $exlocks = $exlocks + $count; - } - $locks = $locks+$count; -} -print "locks.value $locks\n"; -print "exlocks.value $exlocks\n"; - diff --git a/files/plugins/pg_conn b/files/plugins/pg_conn deleted file mode 100755 index aa2ebb7..0000000 --- a/files/plugins/pg_conn +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor PostgreSQL connections. -# -# Parameters: -# -# config (required) -# autoconf (optional - only used by munin-config) -# Based on netstat plugin -# $Log$ -# eric@ohmforce.com -# -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -#%# family=auto -#%# capabilities=autoconf - - - -if [ "$1" = "autoconf" ]; then - if ( netstat -s 2>/dev/null >/dev/null ); then - echo yes - exit 0 - else - if [ $? -eq 127 ] - then - echo "no (netstat program not found)" - exit 1 - else - echo no - exit 1 - fi - fi -fi - -if [ "$1" = "config" ]; then - - echo 'graph_title PostgreSQL' - echo 'graph_args -l 0 ' - echo 'graph_vlabel Number of PostgreSQL connections' - echo 'graph_category postgresql' - echo 'graph_period second' - echo 'graph_info This graph shows the number of opened connections on PostgreSQL.' - echo 'established.label established' - echo 'established.type GAUGE' - echo 'established.max 500' - echo 'established.info The number of currently open connections.' - exit 0 -fi -netstat -a | awk '{ print $4 }'| grep postgres | wc -l | xargs echo established.value diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 741de30..45fde08 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -246,11 +246,6 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } -class munin::plugins::postgres inherits munin::plugins::base { - munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": ensure => 'absent' } - munin::plugin::deploy { "pg__locks": ensure => 'absent' } -} class munin::plugins::nagios inherits munin::plugins::base { munin::plugin::deploy { nagios_hosts: config => 'user root'; -- cgit v1.2.3 From b4b44f82ead03b0cb26816e19e3975e8ada6b229 Mon Sep 17 00:00:00 2001 From: duritong Date: Wed, 6 Aug 2008 21:14:30 +0200 Subject: CentOS don't know yet of tls --- files/config/host/munin.conf.header.CentOS | 3 --- 1 file changed, 3 deletions(-) diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS index e252048..dcadd6b 100644 --- a/files/config/host/munin.conf.header.CentOS +++ b/files/config/host/munin.conf.header.CentOS @@ -29,9 +29,6 @@ contacts me contact.me.command mail -s "Munin notification ${var:group} :: ${var:host} :: ${var:graph_title}" root contact.me.always_send warning critical -# disable tls as we don't yet have configured it -tls disable - # a simple host tree #[localhost] # address 127.0.0.1 -- cgit v1.2.3 From 93be07edbcea844e2efe56191cda62bf44b6654c Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 10 Sep 2008 15:44:25 +0200 Subject: added uptime plugin for all --- manifests/plugin.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 45fde08..ee2cbbe 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -148,6 +148,9 @@ class munin::plugins::base { notify => Service['munin-node'], before => Package['munin-node']; } + + munin::plugin {'uptime': ensure => present, } + case $kernel { linux: { case $vserver { -- cgit v1.2.3 From 14c511f7f6791f56952bc312e5ff8cf4826bb14e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 19:54:20 +0000 Subject: tried to make munin-node installable and runable on openbsd --- files/openbsd/package/munin_openbsd.tar.gz | Bin 0 -> 97459 bytes manifests/client.pp | 79 ++++++++++++++++++++++------- manifests/plugin.pp | 57 ++++++++++++++------- 3 files changed, 99 insertions(+), 37 deletions(-) create mode 100644 files/openbsd/package/munin_openbsd.tar.gz diff --git a/files/openbsd/package/munin_openbsd.tar.gz b/files/openbsd/package/munin_openbsd.tar.gz new file mode 100644 index 0000000..76ae644 Binary files /dev/null and b/files/openbsd/package/munin_openbsd.tar.gz differ diff --git a/manifests/client.pp b/manifests/client.pp index 9a7b772..b9e0c0a 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -13,9 +13,9 @@ class munin::client { } case $operatingsystem { + openbsd: { include munin::client::openbsd } darwin: { include munin::client::darwin } - debian: { include munin::client::debian } - ubuntu: { include munin::client::ubuntu } + debian,ubuntu: { include munin::client::debian } centos: { include munin::client::centos } gentoo: { include munin::client::gentoo } default: { include munin::client::base } @@ -48,15 +48,13 @@ define munin::register_snmp() } class munin::client::base { - package { "munin-node": ensure => installed } - service { "munin-node": + service { 'munin-node': ensure => running, enable => true, hasstatus => true, hasrestart => true, - require => Package[munin-node], } - file {"/etc/munin/": + file {'/etc/munin/': ensure => directory, mode => 0755, owner => root, group => 0; } @@ -64,18 +62,53 @@ class munin::client::base { '' => '127.0.0.1', default => $munin_allow } - file {"/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.$operatingsystem"), - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package["munin-node"], - notify => Service['munin-node'], - mode => 0644, owner => root, group => 0, + file {'/etc/munin/munin-node.conf': + content => template("munin/munin-node.conf.$operatingsystem"), + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, } munin::register { $fqdn: } include munin::plugins::base } +# currently we install munin on openbsd by hand +# :( +class munin::openbsd inherits openbsd::base { + file{'/usr/src/munin_openbsd.tar.gz': + source => "puppet://$server/munin/openbsd/package/munin_openbsd.tar.gz", + owner => root, group => 0, mode => 0600; + } + package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser', + 'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined', + 'p5-Net-SSLeay', 'p5-Net-Server', 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]: + ensure => installed, + before => File['/var/run/munin'], + } + exec{'extract_openbsd': + command => 'tar xzf /usr/src/munin_openbsd.tar.gz', + unless => 'test -d /opt/munin', + require => File['/usr/src/munin_openbsd.tar.gz'], + } + file{'/var/run/munin': + ensure => directory, + require => File['/usr/src/munin_openbsd.tar.gz'], + owner => root, group => 0, mode => 0755; + } + exec{'enable_munin_on_boot': + command => 'echo "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', + unless => 'grep -q "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', + require => File['/var/run/munin'], + } + Service['munin-node']{ + restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`', + stopt => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`', + start => '/opt/munin/sbin/munin-node', + hasstatus => false, + hasrestart => false, + require => File['/var/run/munin'], + } +} + class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, @@ -98,7 +131,19 @@ class munin::client::darwin { munin::register_snmp { $fqdn: } } -class munin::client::debian inherits munin::client::base { +class munin::client::package inherits munin::client::base { + package { 'munin-node': ensure => installed } + Service['munin-node']{ + require => Package[munin-node], + } + File['/etc/munin/munin-node.conf']{ + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package['munin-node'], + } +} + +class munin::client::debian inherits munin::client::package { # the plugin will need that package { "iproute": ensure => installed } @@ -114,9 +159,7 @@ class munin::client::debian inherits munin::client::base { include munin::plugins::debian } -class munin::client::ubuntu inherits munin::client::debian {} - -class munin::client::gentoo inherits munin::client::base { +class munin::client::gentoo inherits munin::client::package { Package['munin-node'] { name => 'munin', category => 'net-analyzer', @@ -126,6 +169,6 @@ class munin::client::gentoo inherits munin::client::base { include munin::plugins::gentoo } -class munin::client::centos inherits munin::client::base { +class munin::client::centos inherits munin::client::package { include munin::plugins::centos } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 741de30..4395cef 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,18 +8,11 @@ class munin::plugin::scriptpaths { case $operatingsystem { - gentoo: { - $script_path = "/usr/libexec/munin/plugins" - } - debian: { - $script_path = "/usr/share/munin/plugins" - } - centos: { - $script_path = "/usr/share/munin/plugins" - } - default: { - $script_path = "/usr/share/munin/plugins" - } + gentoo: { $script_path = "/usr/libexec/munin/plugins" } + debian: { $script_path = "/usr/share/munin/plugins" } + centos: { $script_path = "/usr/share/munin/plugins" } + openbsd: { $script_path = "/opt/munin/lib/plugins/" } + default: { $script_path = "/usr/share/munin/plugins" } } } @@ -45,10 +38,14 @@ define munin::plugin ( } default: { debug ( "munin_plugin: making $plugin using src: $plugin_src" ) + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } if $require { - $real_require = [ $require, Package['munin-node'] ] + $real_require = [ $require, $basic_require ] } else { - $real_require = Package['munin-node'] + $real_require = $basic_require } file { $plugin: ensure => "${real_script_path}/${plugin_src}", @@ -118,13 +115,24 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", source => "puppet://$server/$real_source", - require => Package['munin-node'], mode => 0755, owner => root, group => 0; } + + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } if $require { File["munin_plugin_${name}"]{ - require +> $require, + require => [ $basic_require, $require ], + } + } else { + File["munin_plugin_${name}"]{ + require => $basic_require, } + } + # register the plugin + if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } } else { munin::plugin{$name: ensure => $ensure, config => $config } @@ -135,19 +143,30 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { class munin::plugins::base { file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: + [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: source => "puppet://$server/common/empty", ignore => '\.ignore', 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": + '/etc/munin/plugin-conf.d/munin-node': ensure => present, mode => 0644, owner => root, group => 0, notify => Service['munin-node'], - before => Package['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'], + } + } + } case $kernel { linux: { case $vserver { -- cgit v1.2.3 From 831d0c319031253b05e45e6895f4f0e676b73a6b Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:02:37 +0000 Subject: correct naming of classes --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index b9e0c0a..7f784d0 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -73,7 +73,7 @@ class munin::client::base { # currently we install munin on openbsd by hand # :( -class munin::openbsd inherits openbsd::base { +class munin::client::openbsd inherits munin::client::base { file{'/usr/src/munin_openbsd.tar.gz': source => "puppet://$server/munin/openbsd/package/munin_openbsd.tar.gz", owner => root, group => 0, mode => 0600; -- cgit v1.2.3 From 5bdf84960aaefb0ed2c496827dcca7ac020b0ada Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:27:31 +0000 Subject: added openbsd template --- templates/munin-node.conf.OpenBSD | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.OpenBSD diff --git a/templates/munin-node.conf.OpenBSD b/templates/munin-node.conf.OpenBSD new file mode 120000 index 0000000..082b30c --- /dev/null +++ b/templates/munin-node.conf.OpenBSD @@ -0,0 +1 @@ +munin-node.conf.default \ No newline at end of file -- cgit v1.2.3 From 70314baaf955865d34b9563316c9028f8b6ac018 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:34:12 +0000 Subject: fix param-name --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7f784d0..89c7b46 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -101,7 +101,7 @@ class munin::client::openbsd inherits munin::client::base { } Service['munin-node']{ restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`', - stopt => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`', + stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`', start => '/opt/munin/sbin/munin-node', hasstatus => false, hasrestart => false, -- cgit v1.2.3 From 1e8273a21b504a18ad8066ba6c5b625473ba8b52 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:41:18 +0000 Subject: adding an additional order param --- manifests/client.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/client.pp b/manifests/client.pp index 89c7b46..39119d3 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -88,6 +88,7 @@ class munin::client::openbsd inherits munin::client::base { command => 'tar xzf /usr/src/munin_openbsd.tar.gz', unless => 'test -d /opt/munin', require => File['/usr/src/munin_openbsd.tar.gz'], + before => File['/var/run/munin'], } file{'/var/run/munin': ensure => directory, -- cgit v1.2.3 From b60f432b6a09d1cb29e65f2ebef4f8564abe6b70 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:48:49 +0000 Subject: reorder dependecies --- manifests/client.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 39119d3..35ffb23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -88,16 +88,15 @@ class munin::client::openbsd inherits munin::client::base { command => 'tar xzf /usr/src/munin_openbsd.tar.gz', unless => 'test -d /opt/munin', require => File['/usr/src/munin_openbsd.tar.gz'], - before => File['/var/run/munin'], } file{'/var/run/munin': ensure => directory, - require => File['/usr/src/munin_openbsd.tar.gz'], + require => Exec['extract_openbsd'], owner => root, group => 0, mode => 0755; } exec{'enable_munin_on_boot': command => 'echo "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', - unless => 'grep -q "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', + unless => 'grep -q "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" /etc/rc.local', require => File['/var/run/munin'], } Service['munin-node']{ -- cgit v1.2.3 From 3c9e214789657bd53c6047523ae6e897cd73a144 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:51:19 +0000 Subject: switch to the / dir --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 35ffb23..4d8f0ba 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -85,7 +85,7 @@ class munin::client::openbsd inherits munin::client::base { before => File['/var/run/munin'], } exec{'extract_openbsd': - command => 'tar xzf /usr/src/munin_openbsd.tar.gz', + command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz', unless => 'test -d /opt/munin', require => File['/usr/src/munin_openbsd.tar.gz'], } -- cgit v1.2.3 From c919dd6dd636c8fff4260b26c5d3422a67e8531b Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 20:54:23 +0000 Subject: log directory also needs to be created --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 4d8f0ba..86babaa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -89,7 +89,7 @@ class munin::client::openbsd inherits munin::client::base { unless => 'test -d /opt/munin', require => File['/usr/src/munin_openbsd.tar.gz'], } - file{'/var/run/munin': + file{[ '/var/run/munin', '/var/log/munin' ]: ensure => directory, require => Exec['extract_openbsd'], owner => root, group => 0, mode => 0755; @@ -105,7 +105,7 @@ class munin::client::openbsd inherits munin::client::base { start => '/opt/munin/sbin/munin-node', hasstatus => false, hasrestart => false, - require => File['/var/run/munin'], + require => [ File['/var/run/munin'], File['/var/log/munin'] ], } } -- cgit v1.2.3 From 9e11da55d499b9b01fd1776a969aeef21e6def87 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 21:02:55 +0000 Subject: merged with puzzle --- files/plugins/pg__connections | 142 ------------------------------------------ files/plugins/pg__locks | 119 ----------------------------------- files/plugins/pg_conn | 51 --------------- manifests/plugin.pp | 8 +-- 4 files changed, 3 insertions(+), 317 deletions(-) delete mode 100755 files/plugins/pg__connections delete mode 100755 files/plugins/pg__locks delete mode 100755 files/plugins/pg_conn diff --git a/files/plugins/pg__connections b/files/plugins/pg__connections deleted file mode 100755 index ca95f56..0000000 --- a/files/plugins/pg__connections +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/perl -w -# Plugin for monitor postgres connections. -# -# Licenced under GPL v2. -# -# Usage: -# -# Symlink into /etc/munin/plugins/ and add the monitored -# database to the filename. e.g.: -# -# ln -s /usr/share/munin/plugins/pg__connections \ -# /etc/munin/plugins/pg__connections -# This should, however, be given through autoconf and suggest. -# -# If required, give username, password and/or Postgresql server -# host through environment variables. -# -# You must also activate Postgresql statistics. See -# http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html -# for how to enable this. Specifically, the following lines must -# exist in your postgresql.conf: -# -# stats_start_collector = true -# stats_block_level = true -# -# -# Parameters: -# -# config (required) -# -# Config variables: -# -# dbhost - Which database server to use. Defaults to -# 'localhost'. -# dbname - Which database to use. Defaults to template1 -# dbuser - A Postgresql user account with read permission to -# the given database. Defaults to -# 'postgres'. Anyway, Munin must be told which user -# this plugin should be run as. -# dbpass - The corresponding password, if -# applicable. Default to undef. Remember that -# pg_hba.conf must be configured accordingly. -# -# Magic markers -#%# family=auto -#%# capabilities=autoconf - -use strict; -use DBI; - -my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; -my $dbname = $ENV{'dbname'} || 'template1'; -my $dbuser = $ENV{'dbuser'} || 'postgres'; -my $dbuserx = $ENV{'dbuserx'} || ''; -my $dbport = $ENV{'dbport'} || '5432'; -my $dbpass = $ENV{'dbpass'} || ''; - -# Check for DBD::Pg -if (! eval "require DBD::Pg;") { - print "requires DBD::Pg\n"; - exit 1; -} - -my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; -#print "$dsn\n"; -my $dbh = DBI->connect ($dsn, $dbuser, - $dbpass, - {RaiseError =>1}) || die ""; - - - -if (exists $ARGV[0]) { - if ($ARGV[0] eq 'autoconf') { - # Check for DBD::Pg - if (! eval "require DBD::Pg;") { - print "no (DBD::Pg not found)"; - exit 1; - } - if ($dbh) { - print "yes\n"; - exit 0; - } else { - print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; - exit 1; - } - } - - if ($ARGV[0] eq "config") { - my $sql_max = "SHOW max_connections;"; - my $sth_max = $dbh->prepare($sql_max); - $sth_max->execute(); - my ($max_connections) = $sth_max->fetchrow(); - my $warning = int ($max_connections * 0.7); - my $critical = int ($max_connections * 0.8); - print "graph_title PostgresSQL active connections\n"; - print "graph_args -l 0 --base 1000\n"; - print "graph_vlabel Connections\n"; - print "graph_category Postgresql\n"; - print "graph_info Shows active Postgresql connections from $dbname\n"; - - - my $sql = "select datname, count(*) from pg_stat_activity group by datname"; - my $sth = $dbh->prepare($sql); - $sth->execute(); - my $setarea = "yes"; - while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { - print "$datname.label $datname active connections\n"; - print "$datname.info $datname active connections\n"; - print "$datname.type GAUGE\n"; - if ($setarea eq "yes") { - print "$datname.draw AREA\n"; - $setarea=""; - } else { - print "$datname.draw STACK\n"; - } - } - - print "max_connections.label Max. connections\n"; - print "max_connections.info Max. connections\n"; - print "max_connections.type GAUGE\n"; - - print "warning $warning\n"; - print "critical $critical\n"; - exit 0; - } -} - - -# select datname, count(*) from pg_stat_activity group by datname -my $sql_max = "SHOW max_connections;"; -my $sth_max = $dbh->prepare($sql_max); -$sth_max->execute(); -my ($max_connections) = $sth_max->fetchrow(); - -#my $sql = "SELECT COUNT (*) FROM pg_stat_activity;"; -my $sql = "select datname, count(*) from pg_stat_activity group by datname"; -my $sth = $dbh->prepare($sql); -$sth->execute(); -while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { - print "$datname.value $curr_conn\n"; -} -print "max_connections.value $max_connections\n"; diff --git a/files/plugins/pg__locks b/files/plugins/pg__locks deleted file mode 100755 index 33a9a8a..0000000 --- a/files/plugins/pg__locks +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/perl -w -# Plugin for monitor postgres connections. -# -# Licenced under GPL v2. -# -# Usage: -# -# Symlink into /etc/munin/plugins/ and add the monitored -# database to the filename. e.g.: -# -# ln -s /usr/share/munin/plugins/pg__locks \ -# /etc/munin/plugins/pg__locks -# This should, however, be given through autoconf and suggest. -# -# If required, give username, password and/or Postgresql server -# host through environment variables. -# -# You must also activate Postgresql statistics. See -# http://www.postgresql.org/docs/8.1/interactive/monitoring-locks.html -# for how to enable this. Specifically, the following lines must -# exist in your postgresql.conf: -# -# stats_start_collector = true -# stats_block_level = true -# -# -# Parameters: -# -# config (required) -# -# Config variables: -# -# dbhost - Which database server to use. Defaults to -# 'localhost'. -# dbname - Which database to use. Defaults to template1 -# dbuser - A Postgresql user account with read permission to -# the given database. Defaults to -# 'postgres'. Anyway, Munin must be told which user -# this plugin should be run as. -# dbpass - The corresponding password, if -# applicable. Default to undef. Remember that -# pg_hba.conf must be configured accordingly. -# -# Magic markers -#%# family=auto -#%# capabilities=autoconf - -use strict; -use DBI; - -my $dbhost = $ENV{'dbhost'} || '127.0.0.1'; -my $dbname = $ENV{'dbname'} || 'template1'; -my $dbuser = $ENV{'dbuser'} || 'postgres'; -my $dbport = $ENV{'dbport'} || '5432'; -my $dbpass = $ENV{'dbpass'} || ''; - -# Check for DBD::Pg -if (! eval "require DBD::Pg;") { - exit 1; -} - -my $dsn = "DBI:Pg:dbname=$dbname;host=$dbhost;port=$dbport"; -#print "$dsn\n"; -my $dbh = DBI->connect ($dsn, $dbuser, - $dbpass, - {RaiseError =>1}) || die ""; - - - -if (exists $ARGV[0]) { - if ($ARGV[0] eq 'autoconf') { - # Check for DBD::Pg - if (! eval "require DBD::Pg;") { - print "no (DBD::Pg not found)"; - exit 1; - } - if ($dbh) { - print "yes\n"; - exit 0; - } else { - print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; - exit 1; - } - } - - if ($ARGV[0] eq "config") { - print "graph_title PostgresSQL locks\n"; - print "graph_args --base 1000\n"; - print "graph_vlabel Locks\n"; - print "graph_category Postgresql\n"; - print "graph_info Shows Postgresql locks\n"; - print "locks.label Locks\n"; - print "locks.info Locks (more info here, please... :)\n"; - print "locks.type GAUGE\n"; - print "locks.warning 5\n"; - print "locks.critical 10\n"; - print "exlocks.label Exclusive locks\n"; - print "exlocks.info Exclusive locks (here too, please... :)\n"; - print "exlocks.type GAUGE\n"; - print "exlocks.warning 5\n"; - print "exlocks.critical 10\n"; - exit 0; - } -} - -my $sql="SELECT mode,COUNT(mode) FROM pg_locks GROUP BY mode ORDER BY mode;"; -my $sth = $dbh->prepare ($sql); -$sth->execute (); -my $locks = 0; -my $exlocks = 0; -while (my ($mode, $count) = $sth->fetchrow ()) { - if ($mode =~ /exclusive/i) { - $exlocks = $exlocks + $count; - } - $locks = $locks+$count; -} -print "locks.value $locks\n"; -print "exlocks.value $exlocks\n"; - diff --git a/files/plugins/pg_conn b/files/plugins/pg_conn deleted file mode 100755 index aa2ebb7..0000000 --- a/files/plugins/pg_conn +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor PostgreSQL connections. -# -# Parameters: -# -# config (required) -# autoconf (optional - only used by munin-config) -# Based on netstat plugin -# $Log$ -# eric@ohmforce.com -# -# -# Magic markers (optional - used by munin-config and some installation -# scripts): -#%# family=auto -#%# capabilities=autoconf - - - -if [ "$1" = "autoconf" ]; then - if ( netstat -s 2>/dev/null >/dev/null ); then - echo yes - exit 0 - else - if [ $? -eq 127 ] - then - echo "no (netstat program not found)" - exit 1 - else - echo no - exit 1 - fi - fi -fi - -if [ "$1" = "config" ]; then - - echo 'graph_title PostgreSQL' - echo 'graph_args -l 0 ' - echo 'graph_vlabel Number of PostgreSQL connections' - echo 'graph_category postgresql' - echo 'graph_period second' - echo 'graph_info This graph shows the number of opened connections on PostgreSQL.' - echo 'established.label established' - echo 'established.type GAUGE' - echo 'established.max 500' - echo 'established.info The number of currently open connections.' - exit 0 -fi -netstat -a | awk '{ print $4 }'| grep postgres | wc -l | xargs echo established.value diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4395cef..4e922ed 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -155,6 +155,9 @@ class munin::plugins::base { mode => 0644, owner => root, group => 0, notify => Service['munin-node'], } + + munin::plugin {'uptime': ensure => present, } + case $kernel { openbsd: { File['/etc/munin/plugin-conf.d/munin-node']{ @@ -265,11 +268,6 @@ class munin::plugins::selinux inherits munin::plugins::base { munin::plugin::deploy { "selinux_avcstats": } } -class munin::plugins::postgres inherits munin::plugins::base { - munin::plugin::deploy { "pg_conn": } - munin::plugin::deploy { "pg__connections": ensure => 'absent' } - munin::plugin::deploy { "pg__locks": ensure => 'absent' } -} class munin::plugins::nagios inherits munin::plugins::base { munin::plugin::deploy { nagios_hosts: config => 'user root'; -- cgit v1.2.3 From b7e757f96c1efd690e531c4c91e969867a2ebc91 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 21:12:17 +0000 Subject: openbsd doesn't have a group root, so we just use the gid --- templates/munin-node.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index 5eed749..47e391d 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -12,7 +12,7 @@ setseid 1 host <%= munin_host_real %> port <%= munin_port_real %> user root -group root +group 0 setsid yes # Regexps for files to ignore -- cgit v1.2.3 From f4f092398a1104ed223d94f7022671a9deccfa96 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 21:28:10 +0000 Subject: adding default plugins for openbsd, refactor the same plugins together in the base class --- manifests/plugin.pp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4e922ed..27221bc 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -156,7 +156,13 @@ class munin::plugins::base { notify => Service['munin-node'], } - munin::plugin {'uptime': ensure => present, } + munin::plugin { + [ df, cpu, interrupts, load, memory, netstat, open_files, + processes, swap, uptime, users, vmstat + ]: + ensure => present, + } + include munin::plugins::interfaces case $kernel { openbsd: { @@ -201,22 +207,31 @@ class munin::plugins::interfaces inherits munin::plugins::base { class munin::plugins::linux inherits munin::plugins::base { munin::plugin { - [ df_abs, forks, memory, processes, cpu, df_inode, irqstats, - netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, - vmstat - ]: + [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: ensure => present; acpi: ensure => $acpi_available; } - - include munin::plugins::interfaces } class munin::plugins::debian inherits munin::plugins::base { munin::plugin { apt_all: ensure => present; } } +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, + } + +} + class munin::plugins::vserver inherits munin::plugins::base { munin::plugin { [ netstat, processes ]: @@ -242,7 +257,9 @@ class munin::plugins::dom0 inherits munin::plugins::physical { } class munin::plugins::physical inherits munin::plugins::base { - munin::plugin { iostat: } + case $kernel { + linux: { munin::plugin { iostat: } } + } } class munin::plugins::muninhost inherits munin::plugins::base { -- cgit v1.2.3 From 800018f6422ad792191a1109c552fc52f87ea3df Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 21:57:15 +0000 Subject: fix rc.local adding, simplify the grep -> more errors possible, less tricky --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 86babaa..dcec13e 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -96,7 +96,7 @@ class munin::client::openbsd inherits munin::client::base { } exec{'enable_munin_on_boot': command => 'echo "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', - unless => 'grep -q "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" /etc/rc.local', + unless => 'grep -q "munin-node" /etc/rc.local', require => File['/var/run/munin'], } Service['munin-node']{ -- cgit v1.2.3 From 1a6afef5c71eb98ec357163c1e345d10ee731acc Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Oct 2008 22:20:36 +0000 Subject: use new unified adding cmd --- manifests/client.pp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index dcec13e..db5587f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -71,7 +71,7 @@ class munin::client::base { include munin::plugins::base } -# currently we install munin on openbsd by hand +# currently we install munin on openbsd by targz # :( class munin::client::openbsd inherits munin::client::base { file{'/usr/src/munin_openbsd.tar.gz': @@ -94,9 +94,8 @@ class munin::client::openbsd inherits munin::client::base { require => Exec['extract_openbsd'], owner => root, group => 0, mode => 0755; } - exec{'enable_munin_on_boot': - command => 'echo "if [ -x /opt/munin/sbin/munin-node ]; then echo -n \' munin\'; /opt/munin/sbin/munin-node; fi" >> /etc/rc.local', - unless => 'grep -q "munin-node" /etc/rc.local', + openbsd::add_to_rc_local{'munin-node': + binary => '/opt/munin/sbin/munin-node', require => File['/var/run/munin'], } Service['munin-node']{ -- cgit v1.2.3 From fb9b04497cee36428066c2e6f14b4473270a7b99 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 10 Oct 2008 18:48:10 +0000 Subject: openbsd uses if_errcoll: plugin --- manifests/plugin.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 27221bc..878221f 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -197,11 +197,23 @@ class munin::plugins::base { class munin::plugins::interfaces inherits munin::plugins::base { $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") munin::plugin { $ifs: ensure => "if_"; - $if_errs: ensure => "if_err_"; } + 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_"; + } + } + } } class munin::plugins::linux inherits munin::plugins::base { -- cgit v1.2.3 From 59963536c57f646f1b5cc66855451632dcf39b85 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 1 Nov 2008 19:25:00 +0000 Subject: updated users plugin --- files/openbsd/package/munin_openbsd.tar.gz | Bin 97459 -> 116174 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/files/openbsd/package/munin_openbsd.tar.gz b/files/openbsd/package/munin_openbsd.tar.gz index 76ae644..17ace1d 100644 Binary files a/files/openbsd/package/munin_openbsd.tar.gz and b/files/openbsd/package/munin_openbsd.tar.gz differ -- cgit v1.2.3 From 50af1520524eed3ae6cba43bf9aec0e2256954a4 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 21 Feb 2009 15:49:26 +0000 Subject: removed debug code --- manifests/plugin.pp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 878221f..82d2d27 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -28,16 +28,13 @@ define munin::plugin ( $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$munin::plugin::scriptpaths::script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { "absent": { - debug ( "munin_plugin: suppressing $plugin" ) file { $plugin: ensure => absent, } } default: { - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) case $kernel { openbsd: { $basic_require = File['/var/run/munin'] } default: { $basic_require = Package['munin-node'] } @@ -57,17 +54,14 @@ define munin::plugin ( } case $config { '': { - debug("no config for $name") file { $plugin_conf: ensure => absent } } default: { case $ensure { absent: { - debug("removing config for $name") file { $plugin_conf: ensure => absent } } default: { - debug("creating $plugin_conf") file { $plugin_conf: content => "[${name}]\n$config\n", mode => 0644, owner => root, group => 0, @@ -111,7 +105,6 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { 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://$server/$real_source", -- cgit v1.2.3 From 8b5287a7c93e071c856acd216d7e283262aec5dc Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 21 Feb 2009 15:51:11 +0000 Subject: some intendation clean ups --- manifests/plugin.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 82d2d27..c8d0bc3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -196,15 +196,15 @@ class munin::plugins::interfaces inherits munin::plugins::base { case $operatingsystem { openbsd: { $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") - munin::plugin{ - $if_errs: ensure => "if_errcoll_"; - } + munin::plugin{ + $if_errs: ensure => "if_errcoll_"; + } } default: { $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") - munin::plugin{ + munin::plugin{ $if_errs: ensure => "if_err_"; - } + } } } } -- cgit v1.2.3 From e3c2aeb6fa8aaa1c0ee123f47e316491c5022adf Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 21 Feb 2009 21:02:58 +0000 Subject: added lenny file --- templates/munin-node.conf.Debian.lenny | 1 + 1 file changed, 1 insertion(+) create mode 120000 templates/munin-node.conf.Debian.lenny diff --git a/templates/munin-node.conf.Debian.lenny b/templates/munin-node.conf.Debian.lenny new file mode 120000 index 0000000..e0646b9 --- /dev/null +++ b/templates/munin-node.conf.Debian.lenny @@ -0,0 +1 @@ +munin-node.conf.Debian.etch \ No newline at end of file -- cgit v1.2.3 From 97af5ac10fb99b97a971c101732af7de681bcd57 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 22 Feb 2009 23:20:16 +0000 Subject: added acpi command test --- plugins/facter/acpi_available.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/facter/acpi_available.rb b/plugins/facter/acpi_available.rb index e3d8dfa..576d76c 100644 --- a/plugins/facter/acpi_available.rb +++ b/plugins/facter/acpi_available.rb @@ -1,7 +1,7 @@ # return whether acpi is available -- used for deciding whether to install the munin plugin Facter.add("acpi_available") do setcode do - if `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? + if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? "absent" else "present" -- cgit v1.2.3 From 955947ce7db6d7f6a1a3b3ac53ca0932b28d1dac Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 2 Mar 2009 22:55:10 +0000 Subject: added munin logfile cleanup cron --- manifests/client.pp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index db5587f..c59369b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -106,6 +106,13 @@ class munin::client::openbsd inherits munin::client::base { hasrestart => false, require => [ File['/var/run/munin'], File['/var/log/munin'] ], } + + cron{'clean_munin_logfile': + command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`', + minute => 0, + hour => 2, + weekday => 0, + } } class munin::client::darwin { -- cgit v1.2.3 From 35c263f5ded3fbbc62b7496ddbc46a4cc11559f6 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 5 Apr 2009 12:01:21 +0000 Subject: updated to new version --- templates/munin-node.conf.default | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index 47e391d..c848f3d 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -22,6 +22,7 @@ ignore_file \.bak$ ignore_file %$ ignore_file \.dpkg-(tmp|new|old|dist)$ ignore_file \.rpm(save|new)$ +ignore_file \.pod$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 -- cgit v1.2.3 From cf52fd778bbd7c30ad445c4ff4b1014796b0804e Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 5 Apr 2009 12:32:53 +0000 Subject: disabling contacting so far --- files/config/host/munin.conf.header.CentOS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/config/host/munin.conf.header.CentOS b/files/config/host/munin.conf.header.CentOS index dcadd6b..30cf437 100644 --- a/files/config/host/munin.conf.header.CentOS +++ b/files/config/host/munin.conf.header.CentOS @@ -25,9 +25,9 @@ graph_strategy cgi # 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 +#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] -- cgit v1.2.3 From ac4b2be1fac6ec7893a166fec0a065fb943c8e5f Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:00:48 +0200 Subject: finally implemented snmp client --- manifests/client.pp | 26 ++++++++++++++++++++------ templates/snmpclient.erb | 10 ++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 templates/snmpclient.erb diff --git a/manifests/client.pp b/manifests/client.pp index 9a7b772..f2046fb 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -38,13 +38,27 @@ define munin::register() } } -define munin::register_snmp() +# snmp_testplugin: the plugin we use to test if it's set +define munin::register_snmp( + $snmpd_testplugin = 'load' +) { - @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", - ensure => present, - content => template("munin/snmpclient.erb"), - tag => 'munin', - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + exec{"register_snmp_munin_for_${name}": + command => "munin-node-configure-snmp ${name} | sh", + unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", + } + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + require => Exec["register_snmp_munin_for_${name}"], + tag => 'munin', + } } class munin::client::base { diff --git a/templates/snmpclient.erb b/templates/snmpclient.erb new file mode 100644 index 0000000..44ecc6d --- /dev/null +++ b/templates/snmpclient.erb @@ -0,0 +1,10 @@ +<% + # Downcase all information + dom = domain.downcase + host = hostname.downcase + fhost = name.downcase +%> +### This syntax can be extended, it might get better ... +#<%= dom %> snmp -> <%= fhost %> +[<%= fhost %>] # snmp box + address <%= munin_host_real %> -- cgit v1.2.3 From 3f62e41b08c30b5fd8b846c414646142f5345f3d Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:25:47 +0200 Subject: don't delete snmp plugins --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ee2cbbe..9ede2bf 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '\.ignore', + ignore => '(\.ignore|snmp_*)', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 4b26758687f544e4c9305b8fb1910c20e6084409 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:29:09 +0200 Subject: revert globbing problem --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 9ede2bf..ee2cbbe 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '(\.ignore|snmp_*)', + ignore => '\.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 6dde40efc2202cc372fc4b0c096288d373c190c7 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 16:00:00 +0200 Subject: do not delete snmp plugins --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index ee2cbbe..bb02e46 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -137,7 +137,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: source => "puppet://$server/common/empty", - ignore => '\.ignore', + ignore => [ '\.ignore', 'snmp_*' ], ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 1a65e541db574c549afccf44796be7489c37d22b Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 17:08:18 +0200 Subject: don't require the exec, as the require is exported as well --- manifests/client.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index f2046fb..4c75757 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -56,7 +56,6 @@ define munin::register_snmp( @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), - require => Exec["register_snmp_munin_for_${name}"], tag => 'munin', } } -- cgit v1.2.3 From 8442cf9262887764cfd8d66323d79953d3176cdc Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 11 May 2009 12:44:17 +0200 Subject: updated munin-node config to latest version --- templates/munin-node.conf.default | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index 5eed749..bebe038 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -5,12 +5,10 @@ log_level 4 log_file /var/log/munin/munin-node.log pid_file /var/run/munin/munin-node.pid + background 1 setseid 1 -# Which host/port to bind to; -host <%= munin_host_real %> -port <%= munin_port_real %> user root group root setsid yes @@ -22,6 +20,7 @@ ignore_file \.bak$ ignore_file %$ ignore_file \.dpkg-(tmp|new|old|dist)$ ignore_file \.rpm(save|new)$ +ignore_file \.pod$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 @@ -33,6 +32,15 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like + <% real_munin_allow.split(':').each do |val| -%> allow <%= '^'+val.gsub(/\./, '\.')+'$' %> <% end -%> + +# Which address to bind to; +host <%= munin_host_real %> +# host 127.0.0.1 + +# And which port +port <%= munin_port_real %> + -- cgit v1.2.3 From 60e94ded2bb418c532a25b9fc3a8d05aaf424b40 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 30 May 2009 20:20:54 +0200 Subject: improved enforced munin plugin --- files/plugins/selinuxenforced | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/plugins/selinuxenforced b/files/plugins/selinuxenforced index 16a3f66..e157e3d 100755 --- a/files/plugins/selinuxenforced +++ b/files/plugins/selinuxenforced @@ -23,5 +23,8 @@ if [ "$1" = "config" ]; then exit 0 fi -echo -n "enforced.value " && cat /selinux/enforce - +if [ -r /selinux/enforce ]; then + echo -n "enforced.value " && cat /selinux/enforce +else + echo "enforced.value 0" +fi -- cgit v1.2.3 From 3b2bddb45aad52669f1c680ee0b95d4c061a7590 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 1 Jun 2009 21:28:22 +0200 Subject: add cronjob to kill hanging munin-runs --- manifests/host.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifests/host.pp b/manifests/host.pp index fdaa255..b23a7e5 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -34,6 +34,12 @@ class munin::host case $operatingsystem { centos: { include munin::host::cgi } } + + # from time to time we cleanup hanging munin-runs + file{'/etc/cront.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; + } } class munin::host::cgi { -- cgit v1.2.3 From 11ff5755c2ee3929b4422a8128827a0e9967d964 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 1 Jun 2009 21:28:53 +0200 Subject: fix typo --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index b23a7e5..21cf7df 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -36,7 +36,7 @@ class munin::host } # from time to time we cleanup hanging munin-runs - file{'/etc/cront.d/munin_kill': + 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; } -- cgit v1.2.3 From 6465fd8dca9cf73c625109e1ea78fb53f2d56d50 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:00:48 +0200 Subject: finally implemented snmp client --- manifests/client.pp | 26 ++++++++++++++++++++------ templates/snmpclient.erb | 10 ++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 templates/snmpclient.erb diff --git a/manifests/client.pp b/manifests/client.pp index c59369b..9524edf 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -38,13 +38,27 @@ define munin::register() } } -define munin::register_snmp() +# snmp_testplugin: the plugin we use to test if it's set +define munin::register_snmp( + $snmpd_testplugin = 'load' +) { - @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", - ensure => present, - content => template("munin/snmpclient.erb"), - tag => 'munin', - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + exec{"register_snmp_munin_for_${name}": + command => "munin-node-configure-snmp ${name} | sh", + unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", + } + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + require => Exec["register_snmp_munin_for_${name}"], + tag => 'munin', + } } class munin::client::base { diff --git a/templates/snmpclient.erb b/templates/snmpclient.erb new file mode 100644 index 0000000..44ecc6d --- /dev/null +++ b/templates/snmpclient.erb @@ -0,0 +1,10 @@ +<% + # Downcase all information + dom = domain.downcase + host = hostname.downcase + fhost = name.downcase +%> +### This syntax can be extended, it might get better ... +#<%= dom %> snmp -> <%= fhost %> +[<%= fhost %>] # snmp box + address <%= munin_host_real %> -- cgit v1.2.3 From 1069e03ef2af42e7fa025c5085f9ce78f62b75b3 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:25:47 +0200 Subject: don't delete snmp plugins --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c8d0bc3..adc1f3c 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -138,7 +138,7 @@ class munin::plugins::base { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: source => "puppet://$server/common/empty", - ignore => '\.ignore', + ignore => '(\.ignore|snmp_*)', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 95ddca872bb45a1ae580c8e4fdc4435eecdfab05 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 12:29:09 +0200 Subject: revert globbing problem --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index adc1f3c..c8d0bc3 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -138,7 +138,7 @@ class munin::plugins::base { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: source => "puppet://$server/common/empty", - ignore => '(\.ignore|snmp_*)', + ignore => '\.ignore', ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From 56cad3194b814d24184443c954f50507217a7d7d Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 16:00:00 +0200 Subject: do not delete snmp plugins --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c8d0bc3..6dfe5f0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -138,7 +138,7 @@ class munin::plugins::base { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: source => "puppet://$server/common/empty", - ignore => '\.ignore', + ignore => [ '\.ignore', 'snmp_*' ], ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, -- cgit v1.2.3 From e90b0da899492b8f7c1d60c568cecc3dbdb88cf6 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Wed, 15 Apr 2009 17:08:18 +0200 Subject: don't require the exec, as the require is exported as well --- manifests/client.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 9524edf..48d2a22 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -56,7 +56,6 @@ define munin::register_snmp( @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", ensure => present, content => template("munin/snmpclient.erb"), - require => Exec["register_snmp_munin_for_${name}"], tag => 'munin', } } -- cgit v1.2.3 From 3b784f08508a2fdfa6fbb988c5cb4891bff5df10 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 11 May 2009 12:44:17 +0200 Subject: updated munin-node config to latest version --- templates/munin-node.conf.default | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/munin-node.conf.default b/templates/munin-node.conf.default index c848f3d..befcae4 100644 --- a/templates/munin-node.conf.default +++ b/templates/munin-node.conf.default @@ -5,12 +5,10 @@ log_level 4 log_file /var/log/munin/munin-node.log pid_file /var/run/munin/munin-node.pid + background 1 setseid 1 -# Which host/port to bind to; -host <%= munin_host_real %> -port <%= munin_port_real %> user root group 0 setsid yes @@ -34,6 +32,15 @@ host_name <%= fqdn %> # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like + <% real_munin_allow.split(':').each do |val| -%> allow <%= '^'+val.gsub(/\./, '\.')+'$' %> <% end -%> + +# Which address to bind to; +host <%= munin_host_real %> +# host 127.0.0.1 + +# And which port +port <%= munin_port_real %> + -- cgit v1.2.3 From c63a28d3c16ec2bb3a46d3d5faf6d7ef3b737b70 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:22:36 +0200 Subject: add shorewall rules --- manifests/client.pp | 3 +++ manifests/host.pp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index df9ab06..7894e2f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -20,6 +20,9 @@ class munin::client { gentoo: { include munin::client::gentoo } default: { include munin::client::base } } + if $use_shorewall { + include shorewall::rules::munin + } } define munin::register() diff --git a/manifests/host.pp b/manifests/host.pp index 21cf7df..235e07c 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -40,6 +40,9 @@ class munin::host 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 + } } class munin::host::cgi { -- cgit v1.2.3 From 1893960c1babb6a261cc6fc399231e9c0644a104 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:51:15 +0200 Subject: refactor everything into its own file --- manifests/client.pp | 171 ---------------------------- manifests/client/base.pp | 23 ++++ manifests/client/centos.pp | 3 + manifests/client/darwin.pp | 21 ++++ manifests/client/debian.pp | 15 +++ manifests/client/gentoo.pp | 9 ++ manifests/client/openbsd.pp | 43 +++++++ manifests/client/package.pp | 11 ++ manifests/host.pp | 36 +----- manifests/host/cgi.pp | 16 +++ manifests/init.pp | 7 -- manifests/plugin.pp | 236 --------------------------------------- manifests/plugins/apache.pp | 6 + manifests/plugins/base.pp | 49 ++++++++ manifests/plugins/debian.pp | 4 + manifests/plugins/deploy.pp | 37 ++++++ manifests/plugins/djbdns.pp | 3 + manifests/plugins/dom0.pp | 7 ++ manifests/plugins/gentoo.pp | 3 + manifests/plugins/interfaces.pp | 22 ++++ manifests/plugins/linux.pp | 10 ++ manifests/plugins/muninhost.pp | 4 + manifests/plugins/nagios.pp | 8 ++ manifests/plugins/openbsd.pp | 13 +++ manifests/plugins/physical.pp | 5 + manifests/plugins/scriptpaths.pp | 9 ++ manifests/plugins/selinux.pp | 4 + manifests/plugins/vserver.pp | 7 ++ manifests/register.pp | 17 +++ manifests/register_snmp.pp | 21 ++++ manifests/remoteplugin.pp | 18 +++ manifests/snmp_collector.pp | 14 +++ 32 files changed, 403 insertions(+), 449 deletions(-) create mode 100644 manifests/client/base.pp create mode 100644 manifests/client/centos.pp create mode 100644 manifests/client/darwin.pp create mode 100644 manifests/client/debian.pp create mode 100644 manifests/client/gentoo.pp create mode 100644 manifests/client/openbsd.pp create mode 100644 manifests/client/package.pp create mode 100644 manifests/host/cgi.pp create mode 100644 manifests/plugins/apache.pp create mode 100644 manifests/plugins/base.pp create mode 100644 manifests/plugins/debian.pp create mode 100644 manifests/plugins/deploy.pp create mode 100644 manifests/plugins/djbdns.pp create mode 100644 manifests/plugins/dom0.pp create mode 100644 manifests/plugins/gentoo.pp create mode 100644 manifests/plugins/interfaces.pp create mode 100644 manifests/plugins/linux.pp create mode 100644 manifests/plugins/muninhost.pp create mode 100644 manifests/plugins/nagios.pp create mode 100644 manifests/plugins/openbsd.pp create mode 100644 manifests/plugins/physical.pp create mode 100644 manifests/plugins/scriptpaths.pp create mode 100644 manifests/plugins/selinux.pp create mode 100644 manifests/plugins/vserver.pp create mode 100644 manifests/register.pp create mode 100644 manifests/register_snmp.pp create mode 100644 manifests/remoteplugin.pp create mode 100644 manifests/snmp_collector.pp diff --git a/manifests/client.pp b/manifests/client.pp index 7894e2f..bf49f44 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -16,7 +16,6 @@ class munin::client { openbsd: { include munin::client::openbsd } darwin: { include munin::client::darwin } debian,ubuntu: { include munin::client::debian } - centos: { include munin::client::centos } gentoo: { include munin::client::gentoo } default: { include munin::client::base } } @@ -24,173 +23,3 @@ class munin::client { include shorewall::rules::munin } } - -define munin::register() -{ - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, - default => $munin_host - } - - @@file { "${NODESDIR}/${name}_${munin_port_real}": - ensure => present, - content => template("munin/defaultclient.erb"), - tag => 'munin', - } -} - -# snmp_testplugin: the plugin we use to test if it's set -define munin::register_snmp( - $snmpd_testplugin = 'load' -) -{ - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => '*', - 'fqdn' => '*', - default => $munin_host - } - exec{"register_snmp_munin_for_${name}": - command => "munin-node-configure-snmp ${name} | sh", - unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", - } - @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", - ensure => present, - content => template("munin/snmpclient.erb"), - tag => 'munin', - } -} - -class munin::client::base { - service { 'munin-node': - ensure => running, - enable => true, - hasstatus => true, - hasrestart => true, - } - file {'/etc/munin/': - ensure => directory, - mode => 0755, owner => root, group => 0; - } - $real_munin_allow = $munin_allow ? { - '' => '127.0.0.1', - default => $munin_allow - } - file {'/etc/munin/munin-node.conf': - content => template("munin/munin-node.conf.$operatingsystem"), - notify => Service['munin-node'], - mode => 0644, owner => root, group => 0, - } - munin::register { $fqdn: } - include munin::plugins::base -} - -# currently we install munin on openbsd by targz -# :( -class munin::client::openbsd inherits munin::client::base { - file{'/usr/src/munin_openbsd.tar.gz': - source => "puppet://$server/munin/openbsd/package/munin_openbsd.tar.gz", - owner => root, group => 0, mode => 0600; - } - package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser', - 'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined', - 'p5-Net-SSLeay', 'p5-Net-Server', 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]: - ensure => installed, - before => File['/var/run/munin'], - } - exec{'extract_openbsd': - command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz', - unless => 'test -d /opt/munin', - require => File['/usr/src/munin_openbsd.tar.gz'], - } - file{[ '/var/run/munin', '/var/log/munin' ]: - ensure => directory, - require => Exec['extract_openbsd'], - owner => root, group => 0, mode => 0755; - } - openbsd::add_to_rc_local{'munin-node': - binary => '/opt/munin/sbin/munin-node', - require => File['/var/run/munin'], - } - 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 => '/opt/munin/sbin/munin-node', - hasstatus => false, - hasrestart => false, - require => [ File['/var/run/munin'], File['/var/log/munin'] ], - } - - cron{'clean_munin_logfile': - command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`', - minute => 0, - hour => 2, - weekday => 0, - } -} - -class munin::client::darwin { - file { "/usr/share/snmp/snmpd.conf": - mode => 744, - content => template("munin/darwin_snmpd.conf.erb"), - group => 0, - owner => root, - } - delete_matching_line{"startsnmpdno": - file => "/etc/hostconfig", - pattern => "SNMPSERVER=-NO-", - } - line { "startsnmpdyes": - file => "/etc/hostconfig", - line => "SNMPSERVER=-YES-", - notify => Exec["/sbin/SystemStarter start SNMP"], - } - exec{"/sbin/SystemStarter start SNMP": - noop => false, - } - munin::register_snmp { $fqdn: } -} - -class munin::client::package inherits munin::client::base { - package { 'munin-node': ensure => installed } - Service['munin-node']{ - require => Package[munin-node], - } - File['/etc/munin/munin-node.conf']{ - # this has to be installed before the package, so the postinst can - # boot the munin-node without failure! - before => Package['munin-node'], - } -} - -class munin::client::debian inherits munin::client::package { - # the plugin will need that - package { "iproute": ensure => installed } - - Service["munin-node"]{ - # sarge's munin-node init script has no status - hasstatus => $lsbdistcodename ? { sarge => false, default => true } - } - File["/etc/munin/munin-node.conf"]{ - content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), - } - # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } - include munin::plugins::debian -} - -class munin::client::gentoo inherits munin::client::package { - Package['munin-node'] { - name => 'munin', - category => 'net-analyzer', - } - - - include munin::plugins::gentoo -} - -class munin::client::centos inherits munin::client::package { - include munin::plugins::centos -} diff --git a/manifests/client/base.pp b/manifests/client/base.pp new file mode 100644 index 0000000..1f72e7e --- /dev/null +++ b/manifests/client/base.pp @@ -0,0 +1,23 @@ +class munin::client::base { + service { 'munin-node': + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + } + file {'/etc/munin/': + ensure => directory, + mode => 0755, owner => root, group => 0; + } + $real_munin_allow = $munin_allow ? { + '' => '127.0.0.1', + default => $munin_allow + } + file {'/etc/munin/munin-node.conf': + content => template("munin/munin-node.conf.$operatingsystem"), + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, + } + munin::register { $fqdn: } + include munin::plugins::base +} diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp new file mode 100644 index 0000000..46a7e3f --- /dev/null +++ b/manifests/client/centos.pp @@ -0,0 +1,3 @@ +class munin::client::centos inherits munin::client::package { + include munin::plugins::centos +} diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp new file mode 100644 index 0000000..f6fc95f --- /dev/null +++ b/manifests/client/darwin.pp @@ -0,0 +1,21 @@ +class munin::client::darwin { + file { "/usr/share/snmp/snmpd.conf": + mode => 744, + content => template("munin/darwin_snmpd.conf.erb"), + group => 0, + owner => root, + } + delete_matching_line{"startsnmpdno": + file => "/etc/hostconfig", + pattern => "SNMPSERVER=-NO-", + } + line { "startsnmpdyes": + file => "/etc/hostconfig", + line => "SNMPSERVER=-YES-", + notify => Exec["/sbin/SystemStarter start SNMP"], + } + exec{"/sbin/SystemStarter start SNMP": + noop => false, + } + munin::register_snmp { $fqdn: } +} diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp new file mode 100644 index 0000000..a6d677e --- /dev/null +++ b/manifests/client/debian.pp @@ -0,0 +1,15 @@ +class munin::client::debian inherits munin::client::package { + # the plugin will need that + package { "iproute": ensure => installed } + + Service["munin-node"]{ + # sarge's munin-node init script has no status + hasstatus => $lsbdistcodename ? { sarge => false, default => true } + } + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), + } + # workaround bug in munin_node_configure + plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian +} diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp new file mode 100644 index 0000000..761742e --- /dev/null +++ b/manifests/client/gentoo.pp @@ -0,0 +1,9 @@ +class munin::client::gentoo inherits munin::client::package { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', + } + + + include munin::plugins::gentoo +} diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp new file mode 100644 index 0000000..303acd7 --- /dev/null +++ b/manifests/client/openbsd.pp @@ -0,0 +1,43 @@ +# currently we install munin on openbsd by targz +# :( +class munin::client::openbsd inherits munin::client::base { + file{'/usr/src/munin_openbsd.tar.gz': + source => "puppet://$server/munin/openbsd/package/munin_openbsd.tar.gz", + owner => root, group => 0, mode => 0600; + } + package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser', + 'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined', + 'p5-Net-SSLeay', 'p5-Net-Server', 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]: + ensure => installed, + before => File['/var/run/munin'], + } + exec{'extract_openbsd': + command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz', + unless => 'test -d /opt/munin', + require => File['/usr/src/munin_openbsd.tar.gz'], + } + file{[ '/var/run/munin', '/var/log/munin' ]: + ensure => directory, + require => Exec['extract_openbsd'], + owner => root, group => 0, mode => 0755; + } + openbsd::add_to_rc_local{'munin-node': + binary => '/opt/munin/sbin/munin-node', + require => File['/var/run/munin'], + } + 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 => '/opt/munin/sbin/munin-node', + hasstatus => false, + hasrestart => false, + require => [ File['/var/run/munin'], File['/var/log/munin'] ], + } + + cron{'clean_munin_logfile': + command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`', + minute => 0, + hour => 2, + weekday => 0, + } +} diff --git a/manifests/client/package.pp b/manifests/client/package.pp new file mode 100644 index 0000000..84fcf5c --- /dev/null +++ b/manifests/client/package.pp @@ -0,0 +1,11 @@ +class munin::client::package inherits munin::client::base { + package { 'munin-node': ensure => installed } + Service['munin-node']{ + require => Package[munin-node], + } + File['/etc/munin/munin-node.conf']{ + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package['munin-node'], + } +} diff --git a/manifests/host.pp b/manifests/host.pp index 235e07c..9251516 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -19,7 +19,7 @@ class munin::host } concatenated_file { "/etc/munin/munin.conf": - dir => $NODESDIR, + dir => '/var/lib/puppet/modules/munin/nodes', header => "/etc/munin/munin.conf.header", } @@ -44,37 +44,3 @@ class munin::host include shorewall::rules::out::munin } } - -class munin::host::cgi { - exec{'set_modes_for_cgi': - command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', - refreshonly => true, - subscribe => File['/etc/munin/munin.conf.header'], - } - - file{'/etc/logrotate.d/munin': - source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", - "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/files/munin/config/host/logrotate", - "puppet://$server/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/munin/config/host/logrotate" ], - owner => root, group => 0, mode => 0644; - } -} - -class munin::snmp_collector -{ - - file { - "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$server/munin/create_snmp_links.sh", - mode => 755, owner => root, group => 0; - } - - exec { "create_snmp_links": - command => "/var/lib/puppet/modules/munin/create_snmp_links $NODESDIR", - require => File["snmp_links"], - timeout => "2048", - schedule => daily - } -} diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp new file mode 100644 index 0000000..7fdb281 --- /dev/null +++ b/manifests/host/cgi.pp @@ -0,0 +1,16 @@ +class munin::host::cgi { + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", + "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/files/munin/config/host/logrotate", + "puppet://$server/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } +} diff --git a/manifests/init.pp b/manifests/init.pp index b0c2ba1..e5a92af 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,15 +15,8 @@ # the port is a parameter so vservers can share # IP addresses and still be happy -# Define where the individual nodes' configs are stored -$NODESDIR="/var/lib/puppet/modules/munin/nodes" - modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } -import "host.pp" -import "client.pp" -import "plugin.pp" - case $operatingsystem { debian,ubuntu: { include assert_lsbdistcodename } } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 8d739a8..0e83e04 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -3,19 +3,6 @@ # See LICENSE for the full license granted to you. # adapted and improved by admin(at)immerda.ch - -### configpaths - -class munin::plugin::scriptpaths { - 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 = "/opt/munin/lib/plugins/" } - default: { $script_path = "/usr/share/munin/plugins" } - } -} - ### defines define munin::plugin ( @@ -76,226 +63,3 @@ define munin::plugin ( } } } - -define munin::remoteplugin($ensure = "present", $source, $config = '') { - case $ensure { - "absent": { munin::plugin{ $name: ensure => absent } } - default: { - file { - "/var/lib/puppet/modules/munin/plugins/${name}": - source => $source, - mode => 0755, owner => root, group => 0; - } - munin::plugin { $name: - ensure => $ensure, - config => $config, - script_path_in => "/var/lib/puppet/modules/munin/plugins", - } - } - } -} -define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { - 'present' => $name, - 'absent' => $name, - default => $ensure - } - $real_source = $source ? { - '' => "munin/plugins/$plugin_src", - default => $source - } - include munin::plugin::scriptpaths - file { "munin_plugin_${name}": - path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/$real_source", - mode => 0755, owner => root, group => 0; - } - - case $kernel { - openbsd: { $basic_require = File['/var/run/munin'] } - default: { $basic_require = Package['munin-node'] } - } - if $require { - File["munin_plugin_${name}"]{ - require => [ $basic_require, $require ], - } - } else { - File["munin_plugin_${name}"]{ - require => $basic_require, - } - } - # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } - } -} - -### clases for plugins - -class munin::plugins::base { - file { - [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - source => "puppet://$server/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 } - xenu: { include munin::plugins::domU } - } -} - -# 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_"; - } - } - } -} - -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 -} - -class munin::plugins::debian inherits munin::plugins::base { - munin::plugin { apt_all: ensure => present; } -} - -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, - } - -} - -class munin::plugins::vserver inherits munin::plugins::base { - munin::plugin { - [ netstat, processes ]: - ensure => present; - } -} - -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::centos inherits munin::plugins::base { -} - - - -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_vbd": config => "user root"} - munin::plugin::deploy { "xen_traffic_all": config => "user root"} -} - -class munin::plugins::physical inherits munin::plugins::base { - case $kernel { - linux: { munin::plugin { iostat: } } - } -} - -class munin::plugins::muninhost inherits munin::plugins::base { - munin::plugin { munin_update: } - munin::plugin { munin_graph: } -} - -class munin::plugins::domU inherits munin::plugins::base { } - -class munin::plugins::djbdns inherits munin::plugins::base { - munin::plugin::deploy { "tinydns": } -} - -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": } -} - -class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } - munin::plugin::deploy { "selinux_avcstats": } -} - -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'; - } -} 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..9f47f6b --- /dev/null +++ b/manifests/plugins/base.pp @@ -0,0 +1,49 @@ +class munin::plugins::base { + file { + [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: + source => "puppet://$server/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/deploy.pp b/manifests/plugins/deploy.pp new file mode 100644 index 0000000..24ac3d3 --- /dev/null +++ b/manifests/plugins/deploy.pp @@ -0,0 +1,37 @@ +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } + $real_source = $source ? { + '' => "munin/plugins/$plugin_src", + default => $source + } + include munin::plugin::scriptpaths + file { "munin_plugin_${name}": + path => "$munin::plugin::scriptpaths::script_path/${name}", + source => "puppet://$server/$real_source", + mode => 0755, owner => root, group => 0; + } + + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } + if $require { + File["munin_plugin_${name}"]{ + require => [ $basic_require, $require ], + } + } else { + File["munin_plugin_${name}"]{ + require => $basic_require, + } + } + # register the plugin + if $require { + munin::plugin{$name: ensure => $ensure, config => $config, require => $require } + } else { + munin::plugin{$name: ensure => $ensure, config => $config } + } +} 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..276dc9f --- /dev/null +++ b/manifests/plugins/dom0.pp @@ -0,0 +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_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..93a261c --- /dev/null +++ b/manifests/plugins/nagios.pp @@ -0,0 +1,8 @@ +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'; + } +} 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/scriptpaths.pp b/manifests/plugins/scriptpaths.pp new file mode 100644 index 0000000..ebaa6fa --- /dev/null +++ b/manifests/plugins/scriptpaths.pp @@ -0,0 +1,9 @@ +class munin::plugin::scriptpaths { + 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 = "/opt/munin/lib/plugins/" } + default: { $script_path = "/usr/share/munin/plugins" } + } +} 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; + } +} + diff --git a/manifests/register.pp b/manifests/register.pp new file mode 100644 index 0000000..e1271e1 --- /dev/null +++ b/manifests/register.pp @@ -0,0 +1,17 @@ +define munin::register() +{ + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + } + + @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + tag => 'munin', + } +} + + diff --git a/manifests/register_snmp.pp b/manifests/register_snmp.pp new file mode 100644 index 0000000..e74ba44 --- /dev/null +++ b/manifests/register_snmp.pp @@ -0,0 +1,21 @@ +# snmp_testplugin: the plugin we use to test if it's set +define munin::register_snmp( + $snmpd_testplugin = 'load' +) +{ + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + exec{"register_snmp_munin_for_${name}": + command => "munin-node-configure-snmp ${name} | sh", + unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", + } + @@file { "munin_snmp_${name}": path => "/var/lib/puppet/modules/munin/nodes/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + tag => 'munin', + } +} diff --git a/manifests/remoteplugin.pp b/manifests/remoteplugin.pp new file mode 100644 index 0000000..4bca235 --- /dev/null +++ b/manifests/remoteplugin.pp @@ -0,0 +1,18 @@ +define munin::remoteplugin($ensure = "present", $source, $config = '') { + case $ensure { + "absent": { munin::plugin{ $name: ensure => absent } } + default: { + file { + "/var/lib/puppet/modules/munin/plugins/${name}": + source => $source, + mode => 0755, owner => root, group => 0; + } + munin::plugin { $name: + ensure => $ensure, + config => $config, + script_path_in => "/var/lib/puppet/modules/munin/plugins", + } + } + } +} + diff --git a/manifests/snmp_collector.pp b/manifests/snmp_collector.pp new file mode 100644 index 0000000..53a860f --- /dev/null +++ b/manifests/snmp_collector.pp @@ -0,0 +1,14 @@ +class munin::snmp_collector{ + file { + "/var/lib/puppet/modules/munin/create_snmp_links": + source => "puppet://$server/munin/create_snmp_links.sh", + mode => 755, owner => root, group => 0; + } + + exec { "create_snmp_links": + command => "/var/lib/puppet/modules/munin/create_snmp_links /var/lib/puppet/modules/munin/nodes", + require => File["snmp_links"], + timeout => "2048", + schedule => daily + } +} -- cgit v1.2.3 From b3fa11ddcd74bd9e02d778846b31c84acad3ca40 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:52:53 +0200 Subject: put file at correct location --- manifests/plugin/deploy.pp | 37 +++++++++++++++++++++++++++++++++++++ manifests/plugins/deploy.pp | 37 ------------------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 manifests/plugin/deploy.pp delete mode 100644 manifests/plugins/deploy.pp diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp new file mode 100644 index 0000000..24ac3d3 --- /dev/null +++ b/manifests/plugin/deploy.pp @@ -0,0 +1,37 @@ +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } + $real_source = $source ? { + '' => "munin/plugins/$plugin_src", + default => $source + } + include munin::plugin::scriptpaths + file { "munin_plugin_${name}": + path => "$munin::plugin::scriptpaths::script_path/${name}", + source => "puppet://$server/$real_source", + mode => 0755, owner => root, group => 0; + } + + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } + if $require { + File["munin_plugin_${name}"]{ + require => [ $basic_require, $require ], + } + } else { + File["munin_plugin_${name}"]{ + require => $basic_require, + } + } + # register the plugin + if $require { + munin::plugin{$name: ensure => $ensure, config => $config, require => $require } + } else { + munin::plugin{$name: ensure => $ensure, config => $config } + } +} diff --git a/manifests/plugins/deploy.pp b/manifests/plugins/deploy.pp deleted file mode 100644 index 24ac3d3..0000000 --- a/manifests/plugins/deploy.pp +++ /dev/null @@ -1,37 +0,0 @@ -define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { - 'present' => $name, - 'absent' => $name, - default => $ensure - } - $real_source = $source ? { - '' => "munin/plugins/$plugin_src", - default => $source - } - include munin::plugin::scriptpaths - file { "munin_plugin_${name}": - path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/$real_source", - mode => 0755, owner => root, group => 0; - } - - case $kernel { - openbsd: { $basic_require = File['/var/run/munin'] } - default: { $basic_require = Package['munin-node'] } - } - if $require { - File["munin_plugin_${name}"]{ - require => [ $basic_require, $require ], - } - } else { - File["munin_plugin_${name}"]{ - require => $basic_require, - } - } - # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } - } -} -- cgit v1.2.3 From 4e6e9c8dc06c66b896afe8ec475833359e2798f6 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:54:32 +0200 Subject: fixed typo --- manifests/plugins/base.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index 9f47f6b..1bfed48 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -47,3 +47,4 @@ class munin::plugins::base { physical: { include munin::plugins::physical } xen0: { include munin::plugins::dom0 } } +} -- cgit v1.2.3 From 1a222875cc579d9255f5cf02ec47d80805ec5950 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:55:42 +0200 Subject: put file at correct location --- manifests/plugin/scriptpaths.pp | 9 +++++++++ manifests/plugins/scriptpaths.pp | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 manifests/plugin/scriptpaths.pp delete mode 100644 manifests/plugins/scriptpaths.pp diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp new file mode 100644 index 0000000..ebaa6fa --- /dev/null +++ b/manifests/plugin/scriptpaths.pp @@ -0,0 +1,9 @@ +class munin::plugin::scriptpaths { + 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 = "/opt/munin/lib/plugins/" } + default: { $script_path = "/usr/share/munin/plugins" } + } +} diff --git a/manifests/plugins/scriptpaths.pp b/manifests/plugins/scriptpaths.pp deleted file mode 100644 index ebaa6fa..0000000 --- a/manifests/plugins/scriptpaths.pp +++ /dev/null @@ -1,9 +0,0 @@ -class munin::plugin::scriptpaths { - 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 = "/opt/munin/lib/plugins/" } - default: { $script_path = "/usr/share/munin/plugins" } - } -} -- cgit v1.2.3 From d214a2f0ed7f37d2a40b596eab9d2c68d7c39a95 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 22:58:00 +0200 Subject: fixed typo --- manifests/plugin/deploy.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 24ac3d3..47bf796 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,4 +1,4 @@ -define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') { +define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { $plugin_src = $ensure ? { 'present' => $name, 'absent' => $name, -- cgit v1.2.3 From 4b0841f9f2bcc58cd2da1f8913d7e4f05211888d Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 23:00:38 +0200 Subject: include client stuff --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 0e83e04..01eda76 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,7 @@ define munin::plugin ( $script_path_in = '', $config = '') { - + include ::munin::client include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } -- cgit v1.2.3 From a385bc413215ac5aa6b646c3e4ebf59063230bd8 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 29 Sep 2009 23:02:47 +0200 Subject: correctly include the right client class --- manifests/client.pp | 1 + manifests/client/gentoo.pp | 9 ++++----- manifests/plugin.pp | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index bf49f44..d033c28 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -17,6 +17,7 @@ class munin::client { darwin: { include munin::client::darwin } debian,ubuntu: { include munin::client::debian } gentoo: { include munin::client::gentoo } + centos: { include munin::client::package } default: { include munin::client::base } } if $use_shorewall { diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp index 761742e..53d472b 100644 --- a/manifests/client/gentoo.pp +++ b/manifests/client/gentoo.pp @@ -1,9 +1,8 @@ class munin::client::gentoo inherits munin::client::package { - Package['munin-node'] { - name => 'munin', - category => 'net-analyzer', - } + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', + } - include munin::plugins::gentoo } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 01eda76..1fa4651 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,7 +10,6 @@ define munin::plugin ( $script_path_in = '', $config = '') { - include ::munin::client include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } -- cgit v1.2.3 From 103a4ed607d3fd6b5d8d4aa90e90a979b94f7624 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 3 Oct 2009 14:13:45 +0200 Subject: adjust define --- manifests/client/openbsd.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 303acd7..17abdbf 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -21,7 +21,7 @@ class munin::client::openbsd inherits munin::client::base { require => Exec['extract_openbsd'], owner => root, group => 0, mode => 0755; } - openbsd::add_to_rc_local{'munin-node': + openbsd::rc_local{'munin-node': binary => '/opt/munin/sbin/munin-node', require => File['/var/run/munin'], } -- cgit v1.2.3 From 2ac60fb5804ba23d61e12f3bbd5454e82ead5ac3 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 3 Oct 2009 14:46:38 +0200 Subject: add some xen munin plugins --- files/plugins/xen_mem | 77 +++++++++++++++++++++++++++++++++++++++++++++++ files/plugins/xen_vm | 67 +++++++++++++++++++++++++++++++++++++++++ manifests/plugins/dom0.pp | 2 ++ 3 files changed, 146 insertions(+) create mode 100644 files/plugins/xen_mem create mode 100644 files/plugins/xen_vm diff --git a/files/plugins/xen_mem b/files/plugins/xen_mem new file mode 100644 index 0000000..5e985a5 --- /dev/null +++ b/files/plugins/xen_mem @@ -0,0 +1,77 @@ +#!/bin/sh +# +# Copyright (C) 2006 Rodolphe Quiedeville +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# +# Script to monitor affected memory by domain +# +# $Log$ +# Revision 1.0 2006/09/08 19:20:19 rodo +# Created by Rodolphe Quiedeville +# +# Need to be run as root, add the following lines ... +# +# [xen*] +# user root +# +# to /etc/munin/plugin-conf.d/munin-node +# +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# +# Magic markers (optional - used by munin-config and installation +# scripts): +# +#%# family=auto +#%# capabilities=autoconf + +XM="/usr/sbin/xm" + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen affected memory' + echo 'graph_args --base 1024 --upper-limit 1024 -l 0' + echo 'graph_vlabel Memory' + echo 'graph_category xen' + echo 'graph_total Total' + echo 'graph_info This graph shows affected memory for each domain.' + echo 'Domain_0.label Domain-0' + echo 'Domain_0.draw AREA' +$XM list | grep -v 'Mem' | grep -v 'Domain-0' | while read i; do + name=`echo $i | awk '{ print $1 }' | sed 's/[\/.-]/_/g'` + echo -n "$name.label " + echo $i | awk '{ print $1 }' + echo "$name.draw STACK" +done + + exit 0 +fi + +$XM list | grep -v 'Mem' | while read i; do + name=`echo $i | awk '{ print $1 }' | sed 's/[\/.-]/_/g'` + echo -n "$name.value " + echo $i | awk '{ print $3 * 1024 * 1024 }' +done diff --git a/files/plugins/xen_vm b/files/plugins/xen_vm new file mode 100644 index 0000000..a0dc0b7 --- /dev/null +++ b/files/plugins/xen_vm @@ -0,0 +1,67 @@ +#!/bin/sh +# +# Copyright (C) 2006 Rodolphe Quiedeville +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# +# Monitor number of vm running on a xen dom0. +# +# $Log$ +# Revision 1.0 2006/09/08 19:20:19 rodo +# Created by Rodolphe Quiedeville +# +# Need to be run as root, add the following lines ... +# +# [xen*] +# user root +# +# to /etc/munin/plugin-conf.d/munin-node +# +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# +# Magic markers (optional - used by munin-config and installation +# scripts): +# +#%# family=auto +#%# capabilities=autoconf + +XM="/usr/sbin/xm" + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Xen Virtual Machines' + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel vm' + echo 'graph_category xen' + echo 'graph_info This graph shows how many virtual machines runs on dom0.' + echo 'domains.label vm' + exit 0 +fi + +domains=`$XM list | wc -l` + +echo -n "domains.value " +echo $(($domains-2)) diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp index 276dc9f..8d919c3 100644 --- a/manifests/plugins/dom0.pp +++ b/manifests/plugins/dom0.pp @@ -2,6 +2,8 @@ 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"} } -- cgit v1.2.3 From 23b3b3caca4b00f900ed323e7186453eb23ff6f6 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 30 Oct 2009 22:05:22 +0100 Subject: switch to new lsb way --- manifests/init.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e5a92af..983c7d5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,7 +16,3 @@ # IP addresses and still be happy modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } - -case $operatingsystem { - debian,ubuntu: { include assert_lsbdistcodename } -} -- cgit v1.2.3 From 11c66b121dbd6a9ce1cb77067d2844839b9c609f Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 31 Oct 2009 15:16:31 +0100 Subject: move plugin directory to fit new 0.25 style --- lib/facter/acpi_available.rb | 10 ++++++++++ lib/facter/interfaces.rb | 13 +++++++++++++ plugins/facter/acpi_available.rb | 10 ---------- plugins/facter/interfaces.rb | 13 ------------- 4 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 lib/facter/acpi_available.rb create mode 100755 lib/facter/interfaces.rb delete mode 100644 plugins/facter/acpi_available.rb delete mode 100755 plugins/facter/interfaces.rb diff --git a/lib/facter/acpi_available.rb b/lib/facter/acpi_available.rb new file mode 100644 index 0000000..9a0474f --- /dev/null +++ b/lib/facter/acpi_available.rb @@ -0,0 +1,10 @@ +# return whether acpi is available -- used for deciding whether to install the munin plugin +Facter.add("acpi_available") do + setcode do + if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? + "absent" + else + "present" + end + end +end diff --git a/lib/facter/interfaces.rb b/lib/facter/interfaces.rb new file mode 100755 index 0000000..a498d64 --- /dev/null +++ b/lib/facter/interfaces.rb @@ -0,0 +1,13 @@ +# return the set of active interfaces as an array +Facter.add("interfaces") do + setcode do + `ip -o link show`.split(/\n/).collect do |line| + value = nil + matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) + if !matches.nil? + value = matches[1] + end + value + end.compact.sort.join(" ") + end +end diff --git a/plugins/facter/acpi_available.rb b/plugins/facter/acpi_available.rb deleted file mode 100644 index 9a0474f..0000000 --- a/plugins/facter/acpi_available.rb +++ /dev/null @@ -1,10 +0,0 @@ -# return whether acpi is available -- used for deciding whether to install the munin plugin -Facter.add("acpi_available") do - setcode do - if not File.exist? `which acpi 2>/dev/null`.chomp or `acpi -t -B -A 2>/dev/null`.match(/\d/).nil? - "absent" - else - "present" - end - end -end diff --git a/plugins/facter/interfaces.rb b/plugins/facter/interfaces.rb deleted file mode 100755 index a498d64..0000000 --- a/plugins/facter/interfaces.rb +++ /dev/null @@ -1,13 +0,0 @@ -# return the set of active interfaces as an array -Facter.add("interfaces") do - setcode do - `ip -o link show`.split(/\n/).collect do |line| - value = nil - matches = line.match(/^\d*: ([^:]*): <(.*,)?UP(,.*)?>/) - if !matches.nil? - value = matches[1] - end - value - end.compact.sort.join(" ") - end -end -- cgit v1.2.3 From 36c07aa6cb615aad0cc5dd7d163221383d7ff9bb Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 2 Nov 2009 00:57:23 +0100 Subject: recursivly updating file path to new 0.25 style --- manifests/client/openbsd.pp | 2 +- manifests/host.pp | 4 ++-- manifests/host/cgi.pp | 4 ++-- manifests/snmp_collector.pp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 17abdbf..90bf7df 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -2,7 +2,7 @@ # :( class munin::client::openbsd inherits munin::client::base { file{'/usr/src/munin_openbsd.tar.gz': - source => "puppet://$server/munin/openbsd/package/munin_openbsd.tar.gz", + source => "puppet://$server/modules/munin/openbsd/package/munin_openbsd.tar.gz", owner => root, group => 0, mode => 0600; } package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser', diff --git a/manifests/host.pp b/manifests/host.pp index 9251516..bbfd0db 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -12,8 +12,8 @@ class munin::host source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", "puppet://$server/files/munin/config/host/munin.conf.header", - "puppet://$server/munin/config/host/munin.conf.header.$operatingsystem", - "puppet://$server/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" ], notify => Exec['concat_/etc/munin/munin.conf'], owner => root, group => 0, mode => 0644; } diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 7fdb281..6896b22 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -9,8 +9,8 @@ class munin::host::cgi { source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", "puppet://$server/files/munin/config/host/logrotate", - "puppet://$server/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/munin/config/host/logrotate" ], + "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/modules/munin/config/host/logrotate" ], owner => root, group => 0, mode => 0644; } } diff --git a/manifests/snmp_collector.pp b/manifests/snmp_collector.pp index 53a860f..4f72b95 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/munin/create_snmp_links.sh", + source => "puppet://$server/modules/munin/create_snmp_links.sh", mode => 755, owner => root, group => 0; } -- cgit v1.2.3 From 28628310d169c03f9778e22c8aee6bc926829579 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 2 Nov 2009 01:13:57 +0100 Subject: change pending module file resources to new 0.25 style --- manifests/plugins/base.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index 1bfed48..4658acc 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -1,7 +1,7 @@ class munin::plugins::base { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - source => "puppet://$server/common/empty", + source => "puppet://$server/modules/common/empty", ignore => [ '\.ignore', 'snmp_*' ], ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, -- cgit v1.2.3 From 81abf6e0558e5fd9be6c61c380083150d9c3123d Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 13:14:09 +0100 Subject: use correct path --- manifests/client/base.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client/base.pp b/manifests/client/base.pp index 1f72e7e..b3fcc4a 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -5,7 +5,7 @@ class munin::client::base { hasstatus => true, hasrestart => true, } - file {'/etc/munin/': + file {'/etc/munin': ensure => directory, mode => 0755, owner => root, group => 0; } -- cgit v1.2.3 From 53f373c61b0452488cdfb1d2779364e7865011ca Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 13:15:30 +0100 Subject: update file paths to 0.25.x style --- manifests/host.pp | 6 +++--- manifests/host/cgi.pp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/host.pp b/manifests/host.pp index bbfd0db..af78570 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -9,9 +9,9 @@ class munin::host File <<| tag == 'munin' |>> file{'/etc/munin/munin.conf.header': - source => [ "puppet://$server/files/munin/config/host/${fqdn}/munin.conf.header", - "puppet://$server/files/munin/config/host/munin.conf.header.$operatingsystem", - "puppet://$server/files/munin/config/host/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" ], notify => Exec['concat_/etc/munin/munin.conf'], diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 6896b22..aeb0cdf 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -6,9 +6,9 @@ class munin::host::cgi { } file{'/etc/logrotate.d/munin': - source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", - "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/files/munin/config/host/logrotate", + 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" ], owner => root, group => 0, mode => 0644; -- cgit v1.2.3 From f1f906dda45a652697704331737166224382d0f3 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 13:23:19 +0100 Subject: modules prefix path --- manifests/plugin/deploy.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 47bf796..29d9978 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -11,7 +11,7 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { include munin::plugin::scriptpaths file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/$real_source", + source => "puppet://$server/modlues/$real_source", mode => 0755, owner => root, group => 0; } -- cgit v1.2.3 From c2b3bc7cc42a3944b06088a2c66f77deaf3e2bd3 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 14 Nov 2009 13:33:13 +0100 Subject: fix typo --- manifests/plugin/deploy.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 29d9978..846a873 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -11,7 +11,7 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { include munin::plugin::scriptpaths file { "munin_plugin_${name}": path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/modlues/$real_source", + source => "puppet://$server/modules/$real_source", mode => 0755, owner => root, group => 0; } -- cgit v1.2.3 From 76352415fec5c2ab6975e3a8843dd4983f7cae6a Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Wed, 9 Dec 2009 17:48:41 -0500 Subject: modify nagios plugin to work with nagios2 and nagios3 --- files/plugins/nagios_hosts | 6 +++--- files/plugins/nagios_perf_ | 4 ++-- files/plugins/nagios_svc | 8 ++++---- manifests/plugins/nagios.pp | 12 ++++++++++++ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/files/plugins/nagios_hosts b/files/plugins/nagios_hosts index 04fe8ed..842ef43 100755 --- a/files/plugins/nagios_hosts +++ b/files/plugins/nagios_hosts @@ -20,9 +20,9 @@ if [ "$1" = "config" ]; then fi echo -n 'up.value ' -nagios2stats --mrtg --data NUMHSTUP +nagiostats --mrtg --data NUMHSTUP echo -n 'down.value ' -nagios2stats --mrtg --data NUMHSTDOWN +nagiostats --mrtg --data NUMHSTDOWN echo -n 'unr.value ' -nagios2stats --mrtg --data NUMHSTUNR +nagiostats --mrtg --data NUMHSTUNR diff --git a/files/plugins/nagios_perf_ b/files/plugins/nagios_perf_ index f819def..4d292c7 100755 --- a/files/plugins/nagios_perf_ +++ b/files/plugins/nagios_perf_ @@ -30,6 +30,6 @@ if [ "$1" = "config" ]; then exit 0 fi -echo "act_lat_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}LAT) -echo "act_ext_$TYPE_ABBR.value " $(nagios2stats --mrtg --data AVGACT${TYPE_ABBR}EXT) +echo "act_lat_$TYPE_ABBR.value " $(nagiostats --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $(nagiostats --mrtg --data AVGACT${TYPE_ABBR}EXT) diff --git a/files/plugins/nagios_svc b/files/plugins/nagios_svc index 3938999..86fcabf 100755 --- a/files/plugins/nagios_svc +++ b/files/plugins/nagios_svc @@ -23,11 +23,11 @@ if [ "$1" = "config" ]; then fi echo -n 'ok.value ' -nagios2stats --mrtg --data NUMSVCOK +nagiostats --mrtg --data NUMSVCOK echo -n 'warn.value ' -nagios2stats --mrtg --data NUMSVCWARN +nagiostats --mrtg --data NUMSVCWARN echo -n 'crit.value ' -nagios2stats --mrtg --data NUMSVCCRIT +nagiostats --mrtg --data NUMSVCCRIT echo -n 'unkn.value ' -nagios2stats --mrtg --data NUMSVCUNKN +nagiostats --mrtg --data NUMSVCUNKN diff --git a/manifests/plugins/nagios.pp b/manifests/plugins/nagios.pp index 93a261c..c07e99d 100644 --- a/manifests/plugins/nagios.pp +++ b/manifests/plugins/nagios.pp @@ -1,8 +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"], + } + } -- cgit v1.2.3