From c65387824eedb7bd90dd0785d9667bb6a6137d1b Mon Sep 17 00:00:00 2001 From: paulfantom Date: Thu, 14 Jul 2016 00:42:00 +0200 Subject: [PATCH] fix postfix (no mails error) --- plugins.d/python.d.plugin | 1 - python.d/postfix.chart.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins.d/python.d.plugin b/plugins.d/python.d.plugin index bddcd6e5..f5738e6e 100755 --- a/plugins.d/python.d.plugin +++ b/plugins.d/python.d.plugin @@ -484,7 +484,6 @@ def run(): # parse passed command line arguments modules = parse_cmdline(MODULES_DIR, *sys.argv) msg.DEBUG_FLAG = DEBUG_FLAG - modules = ['postfix'] msg.info("MODULES_DIR='" + MODULES_DIR + "', CONFIG_DIR='" + CONFIG_DIR + "', UPDATE_EVERY=" + str(BASE_CONFIG['update_every']) + diff --git a/python.d/postfix.chart.py b/python.d/postfix.chart.py index 3f82715d..471d4f3f 100644 --- a/python.d/postfix.chart.py +++ b/python.d/postfix.chart.py @@ -40,6 +40,10 @@ class Service(ExecutableService): """ try: raw = self._get_raw_data()[-1].split(' ') + if raw[0] == 'Mail' and raw[1] == 'queue': + return {'emails': 0, + 'size': 0} + return {'emails': raw[4], 'size': raw[1]} except (ValueError, AttributeError): -- 2.39.2