]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
add some autopostgres munin stuff
authorStephen Gran <steve@lobefin.net>
Sun, 8 Jan 2012 16:42:34 +0000 (16:42 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 8 Jan 2012 16:42:34 +0000 (16:42 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
manifests/site.pp
modules/debian-org/lib/facter/software.rb
modules/postgres/files/plugin.conf [new file with mode: 0644]
modules/postgres/manifests/init.pp [new file with mode: 0644]

index 6755e0c8366b4b8005893731183f805139fffff6..151faec07d13a351abc0aca10a0092b94fe89a3e 100644 (file)
@@ -165,7 +165,11 @@ node default {
     case $kernel {
         Linux: { include entropykey }
     }
-
+    if $::postgres84 {
+        include postgres
+    } elsif $::postgres90 {
+        include postgres
+    }
 }
 
 # vim:set et:
index 1f05d486dbb1f66fde1166af69db636710b4869d..598d7a194d5ef89a087a0d2c654dbe7eb310b8fc 100644 (file)
@@ -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 (file)
index 0000000..bef22f9
--- /dev/null
@@ -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 (file)
index 0000000..bb2b768
--- /dev/null
@@ -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:
+