diff options
author | Lennart Weller <lhw@ring0.de> | 2016-09-05 08:27:26 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2016-09-05 08:27:26 +0000 |
commit | 58d9525d7fcacffe52eff7282b7a888dd0dcc1d0 (patch) | |
tree | 251a805eb38d4d75b2a7f44c2cc22e7ea4849513 /charts.d/exim.chart.sh | |
parent | Fixes for service startup and extra config files (diff) | |
parent | Imported Upstream version 1.3.0+dfsg (diff) | |
download | netdata-58d9525d7fcacffe52eff7282b7a888dd0dcc1d0.tar.xz netdata-58d9525d7fcacffe52eff7282b7a888dd0dcc1d0.zip |
Merge tag 'upstream/1.3.0+dfsg'
Upstream version 1.3.0+dfsg
Diffstat (limited to 'charts.d/exim.chart.sh')
-rw-r--r-- | charts.d/exim.chart.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/charts.d/exim.chart.sh b/charts.d/exim.chart.sh new file mode 100644 index 00000000..c60ae946 --- /dev/null +++ b/charts.d/exim.chart.sh @@ -0,0 +1,52 @@ +# no need for shebang - this file is loaded from charts.d.plugin + +exim_command= + +# how frequently to collect queue size +exim_update_every=5 + +exim_priority=60000 + +exim_check() { + if [ -z "$exim_command" -o ! -x "$exim_command" ] + then + local d= + for d in /sbin /usr/sbin /usr/local/sbin + do + if [ -x "$d/exim" ] + then + exim_command="$d/exim" + break + fi + done + fi + + if [ -z "$exim_command" -o ! -x "$exim_command" ] + then + echo >&2 "$PROGRAM_NAME: exim: cannot find exim executable. Please set 'exim_command=/path/to/exim' in $confd/exim.conf" + return 1 + fi + + if [ `$exim_command -bpc 2>&1 | grep -c denied` -ne 0 ] + then + echo >&2 "$PROGRAM_NAME: exim: permission denied. Please set 'queue_list_requires_admin = false' in your exim options file" + return 1 + fi + + return 0 +} + +exim_create() { +cat <<EOF +CHART exim_local.qemails '' "Exim Queue Emails" "emails" queue exim.queued.emails line $((exim_priority + 1)) $exim_update_every +DIMENSION emails '' absolute 1 1 +EOF +return 0 +} + +exim_update() { +echo "BEGIN exim_local.qemails $1" +echo "SET emails = " `$exim_command -bpc` +echo "END" +return 0 +} |