/usr/share/dstat/dstat_sendmail.py is in dstat 0.7.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ### Author: Dag Wieers <dag@wieers.com>
### FIXME: Should read /var/log/mail/statistics or /etc/mail/statistics (format ?)
class dstat_plugin(dstat):
def __init__(self):
self.name = 'sendmail'
self.vars = ('queue',)
self.type = 'd'
self.width = 4
self.scale = 100
def check(self):
if not os.access('/var/spool/mqueue', os.R_OK):
raise Exception, 'Cannot access sendmail queue'
def extract(self):
self.val['queue'] = len(glob.glob('/var/spool/mqueue/qf*'))
# vim:ts=4:sw=4:et
|