From 5c35440091ede3bd1537714f1f62226e68054c2c Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sat, 21 Nov 2015 01:30:05 +0200 Subject: prevent uset values when postqueue is empty --- charts.d/postfix.chart.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'charts.d/postfix.chart.sh') diff --git a/charts.d/postfix.chart.sh b/charts.d/postfix.chart.sh index 0a246da626..3762e822d8 100755 --- a/charts.d/postfix.chart.sh +++ b/charts.d/postfix.chart.sh @@ -68,6 +68,9 @@ postfix_update() { # be very carefull with eval: # prepare the script and always egrep at the end the lines that are usefull, so that # even if something goes wrong, no other code can be executed + postfix_q_emails=0 + postfix_q_size=0 + eval "`$postfix_postqueue -p |\ grep "^--" |\ sed -e "s/-- \([0-9]\+\) Kbytes in \([0-9]\+\) Requests.$/local postfix_q_size=\1\nlocal postfix_q_emails=\2/g" |\ -- cgit v1.2.3