From 8f711a933dbc0917b43d5e29b98da7157bd5727f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 19:48:36 -0500 Subject: fix some merge problems --- files/modules_dir/.ignore | 0 lib/facter/acpi_available.rb | 14 ++--- manifests/client.pp | 2 +- manifests/plugin.pp | 122 ------------------------------------------- templates/defaultclient.erb | 3 -- 5 files changed, 8 insertions(+), 133 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/lib/facter/acpi_available.rb b/lib/facter/acpi_available.rb index e3d8dfa..9a0474f 100644 --- a/lib/facter/acpi_available.rb +++ b/lib/facter/acpi_available.rb @@ -1,10 +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 + 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/manifests/client.pp b/manifests/client.pp index d033c28..24d84da 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -3,7 +3,7 @@ # See LICENSE for the full license granted to you. # Adapted and improved by admin(at)immerda.ch -class munin::client { +class munin::client inherits munin { $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } $munin_host_real = $munin_host ? { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 75c4423..1fa4651 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,127 +10,6 @@ define munin::plugin ( $script_path_in = '', $config = '') { -<<<<<<< HEAD - 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 { - "${module_dir_path}/munin/plugins/${name}": - source => $source, - mode => 0755, owner => root, group => root; - } - munin::plugin { $name: - ensure => $ensure, - config => $config, - script_path => "${module_dir_path}/munin/plugins", - } - } - } -} - -class munin::plugins::base { - - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/modules/common/empty", - ensure => directory, checksum => mtime, - ignore => '.ignore', - 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], - before => Package[munin-node]; - } - -} - -# handle if_ and if_err_ plugins -class munin::plugins::interfaces inherits munin::plugins::base { - - $ifs = gsub(split($munin_interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($munin_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; - } - -======= include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } @@ -182,5 +61,4 @@ class munin::plugins::vserver inherits munin::plugins::base { } } } ->>>>>>> 76352415fec5c2ab6975e3a8843dd4983f7cae6a } diff --git a/templates/defaultclient.erb b/templates/defaultclient.erb index 7d754a7..5611bf4 100644 --- a/templates/defaultclient.erb +++ b/templates/defaultclient.erb @@ -11,8 +11,5 @@ address <%= munin_host_real %> port <%= munin_port_real %> use_node_name yes -<<<<<<< HEAD -======= load.load.warning 5 load.load.critical 10 ->>>>>>> 76352415fec5c2ab6975e3a8843dd4983f7cae6a -- cgit v1.2.3