summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/charts.d.plugin/postfix')
-rw-r--r--collectors/charts.d.plugin/postfix/README.md8
-rw-r--r--collectors/charts.d.plugin/postfix/postfix.chart.sh14
2 files changed, 11 insertions, 11 deletions
diff --git a/collectors/charts.d.plugin/postfix/README.md b/collectors/charts.d.plugin/postfix/README.md
index 5fc265d5..e0dc6330 100644
--- a/collectors/charts.d.plugin/postfix/README.md
+++ b/collectors/charts.d.plugin/postfix/README.md
@@ -1,8 +1,8 @@
-> THIS MODULE IS OBSOLETE.
-> USE THE PYTHON ONE - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT
-
# postfix
+> THIS MODULE IS OBSOLETE.
+> USE [THE PYTHON ONE](../../python.d.plugin/postfix) - IT SUPPORTS MULTIPLE JOBS AND IT IS MORE EFFICIENT
+
The plugin will collect the postfix queue size.
It will create two charts:
@@ -24,3 +24,5 @@ postfix_update_every=15
```
---
+
+[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fpostfix%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
diff --git a/collectors/charts.d.plugin/postfix/postfix.chart.sh b/collectors/charts.d.plugin/postfix/postfix.chart.sh
index 8cb938ce..ff59db9f 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.