Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_postfix_queue

Rating
12 votes
Favoured:
0
Current Version
1.1
Last Release Date
2010-07-19
Compatible With
  • Nagios 3.x
Owner
Hits
144445
Files:
FileDescription
check_postfix_queuecheck_postfix_queue
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This will display the current queue of Postfix.
Client configuration
====================
1) Put the script in the appropiate directory on the client. If you compile from source, it should be /usr/local/nagios/libexec.

2) Add the following to nrpe.cfg.
command[check_queue]=/usr/local/nagios/libexec/check_postfix_queue -w 20 -c 40

3) Restart nrpe.

Server configuration
====================
1) Edit an existing nrpe service and change the check_command to check_nrpe!check_queue

2) Check if the configuration is correct. /usr/bin/nagios -v /etc/nagios/nagios.cfg

3) Restart Nagios. /etc/init.d/nagios restart

Changelog

12-08-2010
==========
- Added patch to display perfdata (thanks box2)
- Edits to honour Bash coding style
- Removed unnecessary pipe to wc(8)
Reviews (9)
I think the postfix installer on debian set spermissions after each upgrade. (postfix set-permissions). So changing permission does not have a permanent effect.

If you want to use this plugin after all without changing the owner of /var/spool/postfix subdirectories - then here is what I've done:

# add user nagios to postfix group
usermod -a -G postfix nagios

# add user nagios to postdrop group
usermod -a -G postdrop nagios

# add user nagios to root group (very insecure)
usermod -a -G root nagios

# allow directory listing for all postfix directories
find /var/spool/postfix -type d -exec chmod g+x {} +
Great plugin, it works well. Thanks.

Please update to use this regex instead, as it supports both short and long postfix QIDs:

queue_id='^(?:[0-9A-F]{10,11}|[0-9A-Za-z]{14,16})!\s'
byelbui, April 23, 2014
I've just installed your nagios plugin 'check_postfix_queue' , but I don't know the log file that it checks.
I have Plesk installed in my server and the maillog path is not the default /var/log/maillog but is /usr/local/psa/var/log.
If your Plugin checks the dafault path, is there a possibility to change it ?
I would really appreciate your help.
diff check_mailq /tmp/test
16,17c16
and line usage"
byfrayber, October 24, 2012
Thank you for sharing!
Which is the best way of setting script permissions without (or minimizing) security issues?
This doesn't actually work, although you may not realise it because it *seems* to work just fine.

Postfix queue directories are only readable by root and the postfix user. NRPE commands are executed by the nagios user, which cannot see inside postfix's queue directories.


Normal user, shows 0 in all queues:
$ /usr/lib/nagios/plugins/check_postfix_queue
OK: incoming queue messages: 0 active queue messages: 0 maildrop queue messages: 0 deferred queue messages: 0 bounce queue messages: 0

Nagios user, shows 0 in all queues:
$ sudo -u nagios /usr/lib/nagios/plugins/check_postfix_queue
OK: incoming queue messages: 0 active queue messages: 0 maildrop queue messages: 0 deferred queue messages: 0 bounce queue messages: 0

As root, reports correct numbers:
$ sudo /usr/lib/nagios/plugins/check_postfix_queue
OK: incoming queue messages: 0 active queue messages: 1358 maildrop queue messages: 0 deferred queue messages: 2922 bounce queue messages: 0
Owner's reply

Funny, I may seem to imagine the last warnings Nagios complained about when the queue reached my thresholds. Futhermore,just fix your permissions (e.g. groups and adding the nagios user to the correct group.) If you use Nagios to monitor queues, you'd better be able to fix these "problems". If not, don't you even think about using Nagios. Makes me wonder how you fixed it with the other plugins available.

bymatthudson, April 20, 2011
Does what it says on the tin!
bycoffeeguy, September 29, 2010
check_postfix_queue works great. Thanks!
bybox2, August 9, 2010
1 of 1 people found this review helpful
Simple, very portable, awesome. Thanks for posting this. I wanted to make some pretty RRD graphs too so I added a perfdata section. The patch is here:

http://www.mediafire.com/?r965aj299gd09cm