From: Stephen Gran Date: Sun, 8 Jan 2012 16:42:34 +0000 (+0000) Subject: add some autopostgres munin stuff X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=7b4bd36615883d13b1cb2dd84562939e44777493;p=mirror%2Fdsa-puppet.git add some autopostgres munin stuff Signed-off-by: Stephen Gran --- diff --git a/manifests/site.pp b/manifests/site.pp index 6755e0c83..151faec07 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -165,7 +165,11 @@ node default { case $kernel { Linux: { include entropykey } } - + if $::postgres84 { + include postgres + } elsif $::postgres90 { + include postgres + } } # vim:set et: diff --git a/modules/debian-org/lib/facter/software.rb b/modules/debian-org/lib/facter/software.rb index 1f05d486d..598d7a194 100644 --- a/modules/debian-org/lib/facter/software.rb +++ b/modules/debian-org/lib/facter/software.rb @@ -28,6 +28,16 @@ Facter.add("postgres83") do FileTest.exist?("/usr/lib/postgresql/8.3/bin/postgres") end end +Facter.add("postgres84") do + setcode do + FileTest.exist?("/usr/lib/postgresql/8.4/bin/postgres") + end +end +Facter.add("postgres90") do + setcode do + FileTest.exist?("/usr/lib/postgresql/9.0/bin/postgres") + end +end Facter.add("postgrey") do setcode do FileTest.exist?("/usr/sbin/postgrey") diff --git a/modules/postgres/files/plugin.conf b/modules/postgres/files/plugin.conf new file mode 100644 index 000000000..bef22f902 --- /dev/null +++ b/modules/postgres/files/plugin.conf @@ -0,0 +1,14 @@ +[postgres_connections_db] +user postgres + +[postgres_size_*] +user postgres + +[postgres_cache_*] +user postgres + +[postgres_querylength_*] +user postgres + +[postgres_bgwriter] +user postgres diff --git a/modules/postgres/manifests/init.pp b/modules/postgres/manifests/init.pp new file mode 100644 index 000000000..bb2b7689e --- /dev/null +++ b/modules/postgres/manifests/init.pp @@ -0,0 +1,19 @@ +class postgres { + activate_munin_check { + "postgres_bgwriter":; + "postgres_connections_db":; + "postgres_cache_ALL": script => "postgres_cache_"; + "postgres_querylength_ALL": script => "postgres_querylength_"; + "postgres_size_ALL": script => "postgres_size_"; + } + file { + "/etc/munin/plugin-conf.d/local-postgres": + source => "puppet:///modules/postgres/plugin.conf", + ; + } +} + +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: +