
Postfix
check_postfix_queue
Description:
This will display the current queue of Postfix.
Current Version
1.1
Last Release Date
2010-07-19
Compatible With
- Nagios 3.x
Owner
Project Files
File | Description |
---|---|
check_postfix_queue |
Project Notes
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)
Add a Review
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 {} +
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 {} +
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.
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.
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
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.
Page Sections
Project Stats
Rating
4.5 (12)
Favorites
0
Views
144,689