Module: check_mk
Branch: master
Commit: 81017bbfb2427c07714635b6041e73120076ed86
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=81017bbfb2427c…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Wed Apr 24 10:57:06 2019 +0200
postgres_stats: add gen data reg test
Change-Id: Iafc2b70c5e8a287a1f7afce969a41c1f6b1ae14c
---
.../checks/generictests/datasets/postgres_stats.py | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/unit/checks/generictests/datasets/postgres_stats.py
b/tests/unit/checks/generictests/datasets/postgres_stats.py
new file mode 100644
index 0000000..5ae2a18
--- /dev/null
+++ b/tests/unit/checks/generictests/datasets/postgres_stats.py
@@ -0,0 +1,40 @@
+# yapf: disable
+
+
+checkname = 'postgres_stats'
+
+
+freeze_time = '2019-01-12 00:00:00'
+
+
+info = [[u'[databases_start]'],
+ [u'postgres'],
+ [u'adwebconnect'],
+ [u'[databases_end]'],
+ [u'datname', u'sname', u'tname', u'vtime',
u'atime'],
+ [u'postgres', u'pg_catalog', u'pg_statistic',
u'-1', u'-1'],
+ [u'adwebconnect', u'public', u'serveraktion',
u'1488881726', u'1488881726'],
+ [u'adwebconnect', u'pg_catalog', u'pg_statistic',
u'1488882719', u'-1'],
+ [u'adwebconnect', u'public', u'auftrag',
u'1489001316', u'1489001316'],
+ [u'adwebconnect', u'public', u'anrede', u'-1',
u'-1'],
+ [u'adwebconnect', u'public', u'auftrag_mediadaten',
u'-1', u'']]
+
+
+discovery = {'': [(u'ANALYZE adwebconnect', {}),
+ (u'ANALYZE postgres', {}),
+ (u'VACUUM adwebconnect', {}),
+ (u'VACUUM postgres', {})]}
+
+
+checks = {'': [(u'ANALYZE adwebconnect',
+ {},
+ [(0, u'Table: auftrag', []),
+ (0, 'Time since last vacuum 674 d', []),
+ (1, u'2 tables were never analyzed: anrede/auftrag_mediadaten',
[])]),
+ (u'ANALYZE postgres', {}, [(0, 'No never checked tables',
[])]),
+ (u'VACUUM adwebconnect',
+ {},
+ [(0, u'Table: auftrag', []),
+ (0, 'Time since last vacuum 674 d', []),
+ (1, u'2 tables were never vacuumed: anrede/auftrag_mediadaten',
[])]),
+ (u'VACUUM postgres', {}, [(0, 'No never checked tables',
[])])]}
\ No newline at end of file