Is there an available perl script or any script for checking the mail queues of each instance of sendmail? So that we can use that on nagios nrpe, since the mailq command is only designed for one instance.
-
Can you describe the setup you wish to monitor a little bit more? – adamo Jan 20 '12 at 11:55
-
i wish to monitor the mail queues of each sendmail instance – Sam Jan 21 '12 at 03:21
-
Unfortunately, your response to @adamo's comment is every bit as vague as your original question. Are you saying that you want Nagios to generate an alert when there is more than one instance running? We cannot help you if you cannot explain what you are trying to do. – Skyhawk Jan 21 '12 at 03:30
-
Since he mentioned nrpe I think that each instance is running on another computer. – Starfish Jan 21 '12 at 03:38
1 Answers
A sendmail "instance" in a host is a sendmail that is started with a configuration file. A sendmail instance is not a sendmail process. So if you see that the output of ps -auxw
contains multiple sendmail processes, this does not mean that the host is running many sendmail instances.
The normal case these days is that there exist two sendmail instances running in your host One that is started and running the configuration described in /etc/mail/sendmail.cf
and a second that is started with the configuration described in /etc/mail/submit.cf
. To see the mail queues that these two instances mailtain you execute the commands:
mailq -C /etc/mail/sendmail.cf
mailq -C /etc/mail/submit.cf
In the highly unlikely case that you have other instances running, corresponding .cf file must exist. You can view them queues then by running mailq -C configuration.cf
for them too.
You can combine in a (Perl) script the output of such commands to do whatever you want afterwards.

- 6,925
- 3
- 30
- 58