]> arthur.barton.de Git - netdata.git/commitdiff
fix exim.chart.py
authorpaulfantom <paulfantom@gmail.com>
Fri, 8 Jul 2016 09:52:49 +0000 (11:52 +0200)
committerpaulfantom <paulfantom@gmail.com>
Fri, 8 Jul 2016 09:52:49 +0000 (11:52 +0200)
conf.d/python.d/exim.conf
python.d/exim.chart.py
python.d/python_modules/base.py

index 2c1317974746626c713855c30151f68658c9f812..0fefb8b954fa6ea1540e8b06f1feecf351b82f0c 100644 (file)
@@ -1,4 +1,4 @@
 # Example configuration of exim.chart.py
 # YAML format
 
-update_every : 2
+update_every : 8 # executing `exim -bpc` can be very slow
index a267c2396edbdb18743f8aa34cf62d0a530c07d1..84981eadc37d021472aa0707737971e8c4b9a961 100644 (file)
@@ -34,8 +34,6 @@ class Service(ExecutableService):
         :return: dict
         """
         try:
-            raw = self._get_raw_data()[-1].split(' ')
-            return {'emails': raw[4],
-                    'size': raw[1]}
+            return {'emails': int(self._get_raw_data()[0])}
         except (ValueError, AttributeError):
             return None
index 2e43a553347a612d34b1162b1856e29bea940e74..a4c5fb3ce5fa0891bdf51d06fa58694ce442d5db 100644 (file)
@@ -437,7 +437,7 @@ class SocketService(SimpleService):
         self.host = "localhost"
         self.port = None
         self.sock = None
-        self.unix_socket = ""
+        self.unix_socket = None
         self.request = ""
         SimpleService.__init__(self, configuration=configuration, name=name)
 
@@ -448,7 +448,7 @@ class SocketService(SimpleService):
         """
         if self.sock is None:
             try:
-                if len(self.unix_socket) == 0:
+                if self.unix_socket is None:
                     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                     sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
                     sock.settimeout(self.update_every)