Attached you'll find a modified version of the check_mailq plugin that comes with Nagios that I have adapted to use with Postfix. This works much like the old version of and uses 'mailq' aka 'postqueue -p' to get a traditional sendmail-style mailq listing which is then parsed for values that you compare to warning and critical conditionals.
I have noticed problems with larger mailq's and this tool as calling 'postqueue -p' can be pretty resource intensive on machines that are heavily loaded. I am always open to suggestions on better ways to implement this tool.
You will need to edit the 'use lib "/usr/local/nagios/plugins" ;' line at the top of the file to get it to work in your environment. This line is looking for the directory that the utils.pm file is located in.
Hi Scott,
on the page given in the subject you offer the check_postfix_mailq
).
Nagios tool (thanks, by the way
"I have noticed problems with larger mailq's and this tool as calling
'postqueue -p' can be pretty resource intensive on machines that are
heavily loaded. I am always open to suggestions on better ways to
implement this tool."
True. Wouldn't be one way to look into the spool directories directly,
bypassing postqueue at all, like
ls -1 /var/spool/postfix/deferred/?/* 2>/dev/null | wc -l
(of course for all spool files individually...)? If so, I am looking
forward to test your new Nagios plugin
Cheers,
–
Stephan A. Rickauer