1 # -*- coding: utf-8 -*-
2 # Description: postfix netdata python.d module
3 # Author: Pawel Krupa (paulfantom)
5 from base import ExecutableService
7 # default module values (can be overridden per job in `config`)
12 # charts order (can be overridden if you want less charts, or different order)
13 ORDER = ['qemails', 'qsize']
17 'options': [None, "Postfix Queue Emails", "emails", 'queue', 'postfix.qemails', 'line'],
19 ['emails', None, 'absolute']
22 'options': [None, "Postfix Queue Emails Size", "emails size in KB", 'queue', 'postfix.qsize', 'area'],
24 ["size", None, 'absolute']
29 class Service(ExecutableService):
30 def __init__(self, configuration=None, name=None):
31 ExecutableService.__init__(self, configuration=configuration, name=name)
32 self.command = "postqueue -p"
34 self.definitions = CHARTS
38 Format data received from shell command
42 raw = self._get_raw_data()[-1].split(' ')
43 if raw[0] == 'Mail' and raw[1] == 'queue':
47 return {'emails': raw[4],
49 except (ValueError, AttributeError):