Skip to content

Add Exim Collector #55

Closed
wants to merge 1 commit into from
+17 −0
View
17 src/collectors/EximCollector/EximCollector.py
@@ -0,0 +1,17 @@
+from diamond import *
+import diamond.collector
+import subprocess
+import os
+
+class EximCollector(diamond.collector.Collector):
+ """
+ Shells out to get the exim queue length
+ """
+
+ COMMAND = ['/usr/sbin/exim', '-bpc']
+
+ def collect(self):
+ if not os.access(EximCollector.COMMAND[0], os.X_OK):
+ return
+ queuesize = subprocess.Popen(EximCollector.COMMAND, stdout=subprocess.PIPE).communicate()[0][:-1]
+ self.publish('queuesize', queuesize)
Something went wrong with that request. Please try again.