prometheus/mailbox: do not atempt to open directories
This commit is contained in:
parent
b0c126b0df
commit
1708972dba
|
@ -129,9 +129,10 @@ def packages(ctn):
|
|||
def mailboxes(ctn):
|
||||
boxes = glob.glob("/var/spool/mail/*")
|
||||
for m in boxes:
|
||||
n = m.split("/")[-1]
|
||||
c = len(mailbox.mbox(m))
|
||||
eo_mailboxes.labels(ctn, n).set(c)
|
||||
if os.path.isfile(m):
|
||||
n = m.split("/")[-1]
|
||||
c = len(mailbox.mbox(m))
|
||||
eo_mailboxes.labels(ctn, n).set(c)
|
||||
|
||||
|
||||
def postgresql(ctn):
|
||||
|
|
Loading…
Reference in New Issue