Go to All Forums

PostFix Mail Queue Statistics

Is there a way to monitor the number of messages of a Postfix mail queue and alert if it exceeds a specific value ?

Like (2) Edit Delete Reply
Replies (3)

Re: PostFix Mail Queue Statistics


Thanks for raising this request.

Please execute the following command and share the output with us to build a plugin integration:

mailq | grep -c "^[A-F0-9]"




Like (0) Reply

Re: Re: PostFix Mail Queue Statistics


The command just displays '2' which is the current number of messages on the queue, I currently have a script that runs every minute and if the queue grows larger than 10000 messages it sends a email to the administrators to investigate.

Like (0) Edit Delete Reply

Re: Re: Re: PostFix Mail Queue Statistics


Please find attached the plugin script for monitoring the Postfix mail queue count.


Plugin Installation:

Unzip and download the attachment postfix_mailq_stats.zip. Place the file in the Linux agent's plugin directory - /opt/site24x7/monagent/plugins

In the next data collection, the plugin will be added for monitoring.

Set Thresholds:

You can also configure thresholds for the metric 'mailq_count' to get alerts when the given value is breached. Follow the steps below:

  1. Log in to Site24x7 and go to Server > Plugin Integrations.
  2. Click on the plugin monitor added.
  3. Hover on the hamburger icon beside the display name and click on Edit.
  4. In the Edit Plugin Monitor page, click on the pencil icon beside Threshold and Availability.
  5. Set a threshold value for the metric 'mailq_count' and select the alert type. You can also associate automation to automatically resolve the issue when the threshold is breached. Save your changes.

Hope this helps. Let us know for questions, if any, in the below thread.




Size: 1.88 KB
Like (0) Reply

Was this post helpful?