prevent uset values when postqueue is empty
Costa Tsaousis (ktsaou) committed
Nov 21, 2015 at 01:30 UTC
5c35440091ede3bd1537714f1f62226e68054c2c
1 file changed
+3
charts.d/postfix.chart.sh
+3
@@ -68,6 +68,9 @@ postfix_update() {
68
# be very carefull with eval:
69
# prepare the script and always egrep at the end the lines that are usefull, so that
70
# even if something goes wrong, no other code can be executed
71
+ postfix_q_emails=0
72
+ postfix_q_size=0
73
+
74
eval "`$postfix_postqueue -p |\
75
grep "^--" |\
76
sed -e "s/-- \([0-9]\+\) Kbytes in \([0-9]\+\) Requests.$/local postfix_q_size=\1\nlocal postfix_q_emails=\2/g" |\