diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:31:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:31:03 +0000 |
commit | 50485bedfd9818165aa1d039d0abe95a559134b7 (patch) | |
tree | 79c7b08f67edcfb0c936e7a22931653b91189b9f /collectors/charts.d.plugin/postfix/postfix.chart.sh | |
parent | Releasing debian version 1.11.1+dfsg-7. (diff) | |
download | netdata-50485bedfd9818165aa1d039d0abe95a559134b7.tar.xz netdata-50485bedfd9818165aa1d039d0abe95a559134b7.zip |
Merging upstream version 1.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin/postfix/postfix.chart.sh')
-rw-r--r-- | collectors/charts.d.plugin/postfix/postfix.chart.sh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/collectors/charts.d.plugin/postfix/postfix.chart.sh b/collectors/charts.d.plugin/postfix/postfix.chart.sh index 8cb938ce1..ff59db9fe 100644 --- a/collectors/charts.d.plugin/postfix/postfix.chart.sh +++ b/collectors/charts.d.plugin/postfix/postfix.chart.sh @@ -22,14 +22,12 @@ postfix_check() { # - 1 to disable the chart # try to find the postqueue executable - if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ] - then + if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ]; then # shellcheck disable=SC2230 postfix_postqueue="$(which postqueue 2>/dev/null || command -v postqueue 2>/dev/null)" fi - if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ] - then + if [ -z "$postfix_postqueue" ] || [ ! -x "$postfix_postqueue" ]; then # shellcheck disable=SC2154 error "cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" return 1 @@ -39,7 +37,7 @@ postfix_check() { } postfix_create() { -cat <<EOF + cat <<EOF CHART postfix_local.qemails '' "Postfix Queue Emails" "emails" queue postfix.queued.emails line $((postfix_priority + 1)) $postfix_update_every DIMENSION emails '' absolute 1 1 CHART postfix_local.qsize '' "Postfix Queue Emails Size" "emails size in KB" queue postfix.queued.size area $((postfix_priority + 2)) $postfix_update_every @@ -70,9 +68,9 @@ postfix_update() { postfix_q_emails=0 postfix_q_size=0 - eval "$(run "$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" |\ + eval "$(run "$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" | grep -E "^local postfix_q_(emails|size)=[0-9]+$")" # write the result of the work. |