check_mailq nullmailer problem/bug?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dudley
Posts: 1
Joined: Wed Sep 10, 2014 6:45 am

check_mailq nullmailer problem/bug?

Post by dudley »

Hey guys,

i got a problem with the nullmailer-part in check_mailq. It always reports 0 mails in queue even if there are some..

These are lines 520-525 from latest check_mailq (example output from mailq and the regex) :
while (<MAILQ>) {
#2006-06-22 16:00:00 282 bytes

if (/^[1-9][0-9]*-[01][0-9]-[0-3][0-9]\s[0-2][0-9]\:[0-2][0-9]\:[0-2][0-9]\s{2}[0-9]+\sbytes$/) {
$msg_q++ ;
First problem i see is that the regex for minutes and seconds is wrong - both only match from 00-29!? Unfortunate if your queued mail has a timestamp of 16:43:52...

Second problem that example string from mailq is a bit different on (all of) my machines. I hope someone could reproduce that. This is how mailq output looks here:
2014-09-04 21:42:36 19997323 bytes from <root@domain..>
2 small differences:
  • - there is only one space between time and size
    --> i replaced \s{2} with only \s
  • - the line doesn't end after "bytes"
    -> i replaced "$" at the end with a "*"
Can someone confirm this or tell me that i'm completely off the track ;)...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_mailq nullmailer problem/bug?

Post by sreinhardt »

Thanks for pointing it out, I'll take a look!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked