[checkmk-commits] Check_MK Git: check_mk: Linux Agent, mk_postgres: Fixed database stats query to be compatible with more versions of postgres

git version control git at mathias-kettner.de
Wed Nov 21 16:59:18 CET 2012


Module: check_mk
Branch: master
Commit: 6510559ec3d666adc8c1f1eb3d7eccf5f96e6fa3
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6510559ec3d666adc8c1f1eb3d7eccf5f96e6fa3

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Wed Nov 21 16:59:25 2012 +0100

Linux Agent, mk_postgres: Fixed database stats query to be compatible with more versions of postgres

---

 ChangeLog                  |    2 ++
 agents/plugins/mk_postgres |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2abdce6..38056c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 1.2.1i4:
     Checks & Agents:
     * Linux Agent, mk_postgres: Supporting pgsql and postgres as user
+    * Linux Agent, mk_postgres: Fixed database stats query to be compatible
+      with more versions of postgres
 
     Multisite:
     * Implemented LDAP integration of Multisite. You can now authenticate your
diff --git a/agents/plugins/mk_postgres b/agents/plugins/mk_postgres
index adeb761..d98e431 100755
--- a/agents/plugins/mk_postgres
+++ b/agents/plugins/mk_postgres
@@ -13,5 +13,5 @@ echo '<<<postgres_sessions>>>'
 echo "select current_query = '<IDLE>', count(*) from pg_stat_activity group by (current_query = '<IDLE>');" | su - $USER -c "psql -d postgres -A -t -F' '"
 
 echo '<<<postgres_stat_database:sep(59)>>>'
-echo 'select datid,datname,numbackends,xact_commit,xact_rollback,blks_read,blks_hit,tup_returned,tup_fetched,tup_inserted,tup_updated,tup_deleted,conflicts, pg_database_size(datname) as "datsize" from pg_stat_database;' \
+echo 'select *, pg_database_size(datname) as "datsize" from pg_stat_database;' \
     | su - $USER -c "psql -d postgres -A -F';'" | sed '$d'



More information about the checkmk-commits mailing list