Module: check_mk
Branch: master
Commit: f8831b8ebffa1971660bb8bd939e3414d3be82ab
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f8831b8ebffa19…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Apr 4 11:46:28 2017 +0200
4581 FIX postgres_stats: Fixed confusion of VACUUM and ANALYSE timestamp in agent plugin
Change-Id: Icd7ace1e8ff2b6bd29c97d3e96ffee9d54a3dbc5
---
.werks/4581 | 11 +++++++++++
agents/plugins/mk_postgres | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/4581 b/.werks/4581
new file mode 100644
index 0000000..9870269
--- /dev/null
+++ b/.werks/4581
@@ -0,0 +1,11 @@
+Title: postgres_stats: Fixed confusion of VACUUM and ANALYSE timestamp in agent plugin
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1491299038
+
+
diff --git a/agents/plugins/mk_postgres b/agents/plugins/mk_postgres
index 0db8504..77837d8 100755
--- a/agents/plugins/mk_postgres
+++ b/agents/plugins/mk_postgres
@@ -93,7 +93,7 @@ FIRST=""
for db in $DATABASES ; do
LASTVACUUM="$(echo "BEGIN;SET statement_timeout=30000;COMMIT;SELECT
current_database() AS datname, nspname AS sname, relname AS tname,
CASE WHEN v IS NULL THEN -1 ELSE round(extract(epoch FROM v)) END AS vtime,
- CASE WHEN g IS NULL THEN -1 ELSE round(extract(epoch FROM v)) END AS atime
+ CASE WHEN g IS NULL THEN -1 ELSE round(extract(epoch FROM g)) END AS atime
FROM (SELECT nspname, relname, GREATEST(pg_stat_get_last_vacuum_time(c.oid),
pg_stat_get_last_autovacuum_time(c.oid)) AS v,
GREATEST(pg_stat_get_last_analyze_time(c.oid),
pg_stat_get_last_autoanalyze_time(c.oid)) AS g
FROM pg_class c, pg_namespace n