I want to try to control a postfix queue using monit. I gave an example from Stackoverflow people. My monit version is the latest
This is Monit version 5.10.
In /etc/monit.d
I have postfixlocal
with
check program postfixcola with path "/usr/local/bin/postfixcola.sh"
and then in /usr/local/bin/
I have postfixcola.sh
with
#!/bin/sh QUEUE=`/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'` exit $QUEUE
But Monit complains about script output every time. I did a test, setup and echo before exit
, and at the time of the test, it returned 1 (because the postfix queue was 1)
But the error remains: [CET Dec 9 11:10:07] error : 'postfixcola' '/usr/local/bin/postfixcola.sh' failed with exit status (2) -- no output
I really donβt know what the problem is, any thoughts?
source share