]> arthur.barton.de Git - netdata.git/blobdiff - python.d/postfix.chart.py
enable checking for usable libcap and sys/capability.h
[netdata.git] / python.d / postfix.chart.py
index 70d65062ce61aefaeacc4e6ed7c8edcd45166567..ee4142aaf68752b71fb782e36937fedc5b348407 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Description: postfix netdata python.d plugin
+# Description: postfix netdata python.d module
 # Author: Pawel Krupa (paulfantom)
 
 from base import ExecutableService
@@ -7,27 +7,19 @@ from base import ExecutableService
 # default module values (can be overridden per job in `config`)
 # update_every = 2
 priority = 60000
-retries = 5
-
-# default job configuration (overridden by python.d.plugin)
-# config = {'local': {
-#             'update_every': update_every,
-#             'retries': retries,
-#             'priority': priority,
-#             'url': 'http://localhost/stub_status'
-#          }}
+retries = 60
 
 # charts order (can be overridden if you want less charts, or different order)
 ORDER = ['qemails', 'qsize']
 
 CHARTS = {
     'qemails': {
-        'options': [None, "Postfix Queue Emails", "emails", 'queue', 'postfix.queued.emails', 'line'],
+        'options': [None, "Postfix Queue Emails", "emails", 'queue', 'postfix.qemails', 'line'],
         'lines': [
             ['emails', None, 'absolute']
         ]},
     'qsize': {
-        'options': [None, "Postfix Queue Emails Size", "emails size in KB", 'queue', 'postfix.queued.size', 'area'],
+        'options': [None, "Postfix Queue Emails Size", "emails size in KB", 'queue', 'postfix.qsize', 'area'],
         'lines': [
             ["size", None, 'absolute']
         ]}
@@ -48,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):