]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/postgresql.pp
Add postgresql monitoring
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / postgresql.pp
index 97ce57291b6bbf4abf9de7c2e04932b5dbe04435..edd6ea64d0e9c461d08e24add62e4c908393f7fc 100644 (file)
@@ -28,5 +28,13 @@ class profile::postgresql (
 
   profile::postgresql::base_pg_hba_rules { "default": }
 
+  @profile::monitoring::local_service { "Databases are present in postgresql":
+    sudos => {
+      "naemon-postgresql-database-public" => "naemon ALL=(postgres) NOPASSWD: /usr/bin/psql -c select\ nspname\ from\ pg_catalog.pg_namespace"
+    },
+    local => {
+      check_command => "check_command_output!psql -c 'select nspname from pg_catalog.pg_namespace'!public!-r postgres",
+    }
+  }
 }