diff options
Diffstat (limited to 'collectors/charts.d.plugin/exim/exim.chart.sh')
-rw-r--r-- | collectors/charts.d.plugin/exim/exim.chart.sh | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/collectors/charts.d.plugin/exim/exim.chart.sh b/collectors/charts.d.plugin/exim/exim.chart.sh index 8099a724..7b0ef70d 100644 --- a/collectors/charts.d.plugin/exim/exim.chart.sh +++ b/collectors/charts.d.plugin/exim/exim.chart.sh @@ -17,14 +17,12 @@ exim_update_every=5 exim_priority=60000 exim_check() { - if [ -z "${exim_command}" ] - then - require_cmd exim || return 1 - exim_command="${EXIM_CMD}" - fi - - if [ "$(${exim_command} -bpc 2>&1 | grep -c denied)" -ne 0 ] - then + if [ -z "${exim_command}" ]; then + require_cmd exim || return 1 + exim_command="${EXIM_CMD}" + fi + + if [ "$(${exim_command} -bpc 2>&1 | grep -c denied)" -ne 0 ]; then error "permission denied - please set 'queue_list_requires_admin = false' in your exim options file" return 1 fi @@ -33,16 +31,16 @@ exim_check() { } exim_create() { - cat <<EOF + 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 + return 0 } exim_update() { - echo "BEGIN exim_local.qemails $1" - echo "SET emails = $(run "${exim_command}" -bpc)" - echo "END" - return 0 + echo "BEGIN exim_local.qemails $1" + echo "SET emails = $(run "${exim_command}" -bpc)" + echo "END" + return 0 } |