diff -ru greylistd-0.8.3.2/debian/changelog greylistd-0.8.3.2+mrtg/debian/changelog
--- greylistd-0.8.3.2/debian/changelog	2006-11-03 13:13:17.000000000 +0200
+++ greylistd-0.8.3.2+mrtg/debian/changelog	2006-12-21 20:37:26.000000000 +0200
@@ -1,3 +1,9 @@
+greylistd (0.8.3.2+mrtg) unstable; urgency=low
+
+  * Added MRTG stats output format
+
+ -- Norman Rasmussen <norman@rasmussen.co.za>  Thu, 21 Dec 2006 20:37:16 +0200
+
 greylistd (0.8.3.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -ru greylistd-0.8.3.2/doc/man1/greylist.1 greylistd-0.8.3.2+mrtg/doc/man1/greylist.1
--- greylistd-0.8.3.2/doc/man1/greylist.1	2005-01-06 10:11:02.000000000 +0200
+++ greylistd-0.8.3.2+mrtg/doc/man1/greylist.1	2006-12-21 20:34:02.000000000 +0200
@@ -53,6 +53,9 @@
 This operation would normally be used by mail transport agents (MTAs).
 .IP "\fBstats\fP"
 Print some statistics on greylist utilization and hits. 
+.IP "\fBmrtg\fP"
+Print statistics on greylist and whitelist hits in a format that MRTG
+can use as an External Monitoring Script.
 .IP "\fBlist\fP [\fB--white\fP] [\fB--grey\fP] [\fB--black\fP]"
 Print available (original/unhashed) data items from the corresponding
 list(s).
diff -ru greylistd-0.8.3.2/program/greylist greylistd-0.8.3.2+mrtg/program/greylist
--- greylistd-0.8.3.2/program/greylist	2004-12-30 23:37:04.000000000 +0200
+++ greylistd-0.8.3.2+mrtg/program/greylist	2006-12-21 20:34:02.000000000 +0200
@@ -45,7 +45,7 @@
 ### Commands that can be given over the socket
 commands = ("add", "delete", "check", "update",
             "stats", "list",  "clear", "save",
-            "reload")
+            "reload", "mrtg")
             
 
 
@@ -78,6 +78,9 @@
         "  stats",
         "    Show some general list statistics.",
         "",
+        "  mrtg",
+        "    Show grey and white list statistics in a format that MRTG can use directly.",
+        "",
         "  list [--white] [--grey] [--black]",
         "    Show all data items in the specified list(s).",
         "",
diff -ru greylistd-0.8.3.2/program/greylistd greylistd-0.8.3.2+mrtg/program/greylistd
--- greylistd-0.8.3.2/program/greylistd	2005-03-15 00:54:17.000000000 +0200
+++ greylistd-0.8.3.2+mrtg/program/greylistd	2006-12-21 20:34:02.000000000 +0200
@@ -29,7 +29,7 @@
 ########################################################################
 
 from time         import time, ctime, localtime, strftime
-from socket       import socket, AF_UNIX, SOCK_STREAM, error as SocketError
+from socket       import socket, AF_UNIX, SOCK_STREAM, error as SocketError, gethostname
 from os           import remove, rename, chmod, chown, getuid, getpid, isatty
 from pwd          import getpwnam
 from grp          import getgrnam
@@ -541,6 +541,25 @@
 
 
 
+def do_mrtg ():
+    text      = []
+    now       = int(time())
+    stats     = data[STATS]
+    starttime = stats.get(START, None)
+    expireKeys(now)
+
+
+    text.append(str(stats[GREY]))
+    text.append(str(stats[WHITE]))
+
+    text.append(duration(now - starttime))
+    text.append(gethostname())
+    
+    text.append('')
+    return "\n".join(text)
+
+
+
 def do_list (options, socket):
     if not config[DATA][TRIPLETFILE] or not config[DATA][SAVETRIPLETS]:
         raise CommandError, "Original triplet data is not retained."
