Module: check_mk
Branch: master
Commit: 9209fd6fa459d5d13f8d5edb0efd824526965130
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9209fd6fa459d5…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Tue Jul 3 17:44:02 2012 +0200
PostgreSQL plugin: Make compatible with 8.3+ outputs
---
agents/plugins/mk_postgres | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/agents/plugins/mk_postgres b/agents/plugins/mk_postgres
index 722f9dd..ab69fd1 100755
--- a/agents/plugins/mk_postgres
+++ b/agents/plugins/mk_postgres
@@ -4,6 +4,8 @@ if id postgres >/dev/null ; then
echo '<<<postgres_sessions>>>'
echo "select current_query = '<IDLE>', count(*) from
pg_stat_activity group by (current_query = '<IDLE>');" | su - postgres
-c "psql -A -t -F' '"
echo '<<<postgres_stat_database>>>'
- echo 'select *, pg_database_size(datname) "datsize" from
pg_stat_database;' \
+ # The following statement might change in future for better cross-version
+ # compatibility.
+ echo 'select *, pg_database_size(datname) as "datsize" from
pg_stat_database;' \
| su - postgres -c "psql -A -F' '" | sed '$d'
fi