1 # -*- coding: utf-8 -*-
2 # Description: postfix netdata python.d plugin
3 # Author: Pawel Krupa (paulfantom)
5 from base import ExecutableService
7 # default module values (can be overridden per job in `config`)
12 # default job configuration (overridden by python.d.plugin)
13 # config = {'local': {
14 # 'update_every': update_every,
16 # 'priority': priority,
17 # 'url': 'http://localhost/stub_status'
20 # charts order (can be overridden if you want less charts, or different order)
21 ORDER = ['qemails', 'qsize']
25 'options': [None, "Postfix Queue Emails", "emails", 'queue', 'postfix.queued.emails', 'line'],
27 ['emails', None, 'absolute']
30 'options': [None, "Postfix Queue Emails Size", "emails size in KB", 'queue', 'postfix.queued.size', 'area'],
32 ["size", None, 'absolute']
37 class Service(ExecutableService):
38 def __init__(self, configuration=None, name=None):
39 ExecutableService.__init__(self, configuration=configuration, name=name)
40 self.command = "postqueue -p"
42 self.definitions = CHARTS
46 Format data received from shell command
50 raw = self._get_raw_data()[-1].split(' ')
51 return {'emails': raw[4],
53 except (ValueError, AttributeError):