Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add Exim Collector #55

Closed
wants to merge 1 commit into from

2 participants

@dwatson

Added an Exim Collector that fetches the current queue length.

@kormoc
Collaborator

Merged in 5bbd268

Thanks!

@kormoc kormoc closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 25, 2012
  1. @dwatson

    Add Exim Collector

    dwatson authored
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/collectors/EximCollector/EximCollector.py
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.