diff options
Diffstat (limited to '')
-rw-r--r-- | collectors/charts.d.plugin/postfix/Makefile.inc | 13 | ||||
-rw-r--r-- | collectors/charts.d.plugin/postfix/README.md | 26 | ||||
-rw-r--r-- | collectors/charts.d.plugin/postfix/postfix.chart.sh (renamed from charts.d/postfix.chart.sh) | 13 | ||||
-rw-r--r-- | collectors/charts.d.plugin/postfix/postfix.conf (renamed from conf.d/charts.d/postfix.conf) | 0 |
4 files changed, 47 insertions, 5 deletions
diff --git a/collectors/charts.d.plugin/postfix/Makefile.inc b/collectors/charts.d.plugin/postfix/Makefile.inc new file mode 100644 index 000000000..6e148352d --- /dev/null +++ b/collectors/charts.d.plugin/postfix/Makefile.inc @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +# THIS IS NOT A COMPLETE Makefile +# IT IS INCLUDED BY ITS PARENT'S Makefile.am +# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT + +# install these files +dist_charts_DATA += postfix/postfix.chart.sh +dist_chartsconfig_DATA += postfix/postfix.conf + +# do not install these files, but include them in the distribution +dist_noinst_DATA += postfix/README.md postfix/Makefile.inc + diff --git a/collectors/charts.d.plugin/postfix/README.md b/collectors/charts.d.plugin/postfix/README.md new file mode 100644 index 000000000..5fc265d56 --- /dev/null +++ b/collectors/charts.d.plugin/postfix/README.md @@ -0,0 +1,26 @@ +> THIS MODULE IS OBSOLETE. +> USE THE PYTHON ONE - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT + +# postfix + +The plugin will collect the postfix queue size. + +It will create two charts: + +1. **queue size in emails** +2. **queue size in KB** + +### configuration + +This is the internal default for `/etc/netdata/postfix.conf` + +```sh +# the postqueue command +# if empty, it will use the one found in the system path +postfix_postqueue= + +# how frequently to collect queue size +postfix_update_every=15 +``` + +--- diff --git a/charts.d/postfix.chart.sh b/collectors/charts.d.plugin/postfix/postfix.chart.sh index 85604fcbe..8cb938ce1 100644 --- a/charts.d/postfix.chart.sh +++ b/collectors/charts.d.plugin/postfix/postfix.chart.sh @@ -1,9 +1,10 @@ +# shellcheck shell=bash disable=SC1117 # no need for shebang - this file is loaded from charts.d.plugin +# SPDX-License-Identifier: GPL-3.0-or-later # netdata # real-time performance and health monitoring, done right! # (C) 2016 Costa Tsaousis <costa@tsaousis.gr> -# GPL v3+ # # the postqueue command @@ -21,13 +22,15 @@ postfix_check() { # - 1 to disable the chart # try to find the postqueue executable - if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ] + 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" -o ! -x "$postfix_postqueue" ] + 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 fi @@ -67,10 +70,10 @@ postfix_update() { postfix_q_emails=0 postfix_q_size=0 - eval "$(run $postfix_postqueue -p |\ + 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" |\ - egrep "^local postfix_q_(emails|size)=[0-9]+$")" + grep -E "^local postfix_q_(emails|size)=[0-9]+$")" # write the result of the work. cat <<VALUESEOF diff --git a/conf.d/charts.d/postfix.conf b/collectors/charts.d.plugin/postfix/postfix.conf index b77817bd6..b77817bd6 100644 --- a/conf.d/charts.d/postfix.conf +++ b/collectors/charts.d.plugin/postfix/postfix.conf |