From 8d4f58e49b9dc7d3545651023a36729de773ad86 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:22:31 +0200 Subject: Adding upstream version 1.12.0. Signed-off-by: Daniel Baumann --- .../charts.d.plugin/postfix/postfix.chart.sh | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 collectors/charts.d.plugin/postfix/postfix.chart.sh (limited to 'collectors/charts.d.plugin/postfix/postfix.chart.sh') diff --git a/collectors/charts.d.plugin/postfix/postfix.chart.sh b/collectors/charts.d.plugin/postfix/postfix.chart.sh new file mode 100644 index 0000000..ff59db9 --- /dev/null +++ b/collectors/charts.d.plugin/postfix/postfix.chart.sh @@ -0,0 +1,87 @@ +# 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 +# + +# 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 + +postfix_priority=60000 + +postfix_check() { + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart + + # try to find the postqueue executable + 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 + # shellcheck disable=SC2154 + error "cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" + return 1 + fi + + return 0 +} + +postfix_create() { + cat <