fix postfix (no mails error)
paulfantom committed
Jul 14, 2016 at 00:42 UTC
c65387824eedb7bd90dd0785d9667bb6a6137d1b
2 files changed
+4
-1
plugins.d/python.d.plugin
-1
@@ -484,7 +484,6 @@ def run():
484
# parse passed command line arguments
485
modules = parse_cmdline(MODULES_DIR, *sys.argv)
486
msg.DEBUG_FLAG = DEBUG_FLAG
487
- modules = ['postfix']
487
msg.info("MODULES_DIR='" + MODULES_DIR +
488
"', CONFIG_DIR='" + CONFIG_DIR +
489
"', UPDATE_EVERY=" + str(BASE_CONFIG['update_every']) +
python.d/postfix.chart.py
+4
@@ -40,6 +40,10 @@ class Service(ExecutableService):
40
"""
41
try:
42
raw = self._get_raw_data()[-1].split(' ')
43
+ if raw[0] == 'Mail' and raw[1] == 'queue':
44
+ return {'emails': 0,
45
+ 'size': 0}
46
+
47
return {'emails': raw[4],
48
'size': raw[1]}
49
except (ValueError, AttributeError):