X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=charts.d%2Fpostfix.chart.sh;h=85604fcbe2f6e2fdd30c4c16b26d253f745495c7;hb=577c339c1e606cd6935fc0fced90a31f63bf5e8d;hp=3762e822d82222d96ff4fa5e373338bdde8fc1d2;hpb=5c35440091ede3bd1537714f1f62226e68054c2c;p=netdata.git diff --git a/charts.d/postfix.chart.sh b/charts.d/postfix.chart.sh old mode 100755 new mode 100644 index 3762e822..85604fcb --- a/charts.d/postfix.chart.sh +++ b/charts.d/postfix.chart.sh @@ -1,4 +1,10 @@ -#!/bin/sh +# no need for shebang - this file is loaded from charts.d.plugin + +# netdata +# real-time performance and health monitoring, done right! +# (C) 2016 Costa Tsaousis +# GPL v3+ +# # the postqueue command # if empty, it will use the one found in the system path @@ -7,6 +13,8 @@ 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 @@ -15,24 +23,12 @@ postfix_check() { # try to find the postqueue executable if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ] then - postfix_postqueue="`which postqueue 2>/dev/null`" - if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ] - then - local d= - for d in /sbin /usr/sbin /usr/local/sbin - do - if [ -x "$d/postqueue" ] - then - postfix_postqueue="$d/postqueue" - break - fi - done - fi + postfix_postqueue="$(which postqueue 2>/dev/null || command -v postqueue 2>/dev/null)" fi if [ -z "$postfix_postqueue" -o ! -x "$postfix_postqueue" ] then - echo >&2 "$PROGRAM_NAME: postfix: cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" + error "cannot find postqueue. Please set 'postfix_postqueue=/path/to/postqueue' in $confd/postfix.conf" return 1 fi @@ -41,9 +37,9 @@ postfix_check() { postfix_create() { cat <