I need to check the number of mails in active queue on various Postfix installations, as a Nagios alert.
My first idea is to write a small Nagios plugin that SSHs to the Postfix server and read the value that I obtain through another little script. Then, Nagios will check this value against its warning and critical levels, as set up.
Is this approach what you'd call correct? Or doing through SSH is "too much"? Should I use the 5666/tcp Nagios port instead? (if yes, I did not find any example about yet)