mrtg/rc.mrtg

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 140
d51e263e607b
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

michael@130 1 #!@l_prefix@/bin/openpkg rc
michael@130 2 ##
michael@130 3 ## rc.mrtg -- Run-Commands
michael@130 4 ##
michael@130 5
michael@130 6 %config
michael@130 7 mrtg_enable="$openpkg_rc_def"
michael@140 8 mrtg_sumlog="no"
michael@140 9 mrtg_summin="10"
michael@140 10 mrtg_sumail=""
michael@140 11 mrtg_sumpat="<[Hh][1-9]>([Tt]raffic[^<]*)</[Hh][1-9]>"
michael@140 12
michael@140 13 %common
michael@140 14 mrtg_etcdir="@l_prefix@/etc/mrtg"
michael@140 15 mrtg_vardir="@l_prefix@/var/mrtg"
michael@140 16 mrtg_webdir="@l_prefix@/web/mrtg"
michael@130 17
michael@130 18 %quarterly -u @l_susr@
michael@130 19 rcService mrtg enable yes || exit 0
michael@130 20 export LANG=C
michael@130 21 @l_prefix@/bin/mrtg \
michael@140 22 --pid-file=$mrtg_vardir/mrtg.pid \
michael@140 23 --lock-file=$mrtg_vardir/mrtg.lock \
michael@140 24 --confcache-file=$mrtg_vardir/mrtg.cache \
michael@203 25 $mrtg_etcdir/mrtg.cfg \
michael@203 26 && echo >>$mrtg_vardir/mrtg.log
michael@130 27
michael@140 28 %monthly -u @l_musr@
michael@140 29 rcService mrtg enable yes || exit 0
michael@140 30 rcVarIsYes mrtg_sumlog || exit 0
michael@140 31 @l_prefix@/bin/mrtg-traffic-sum \
michael@140 32 --min $mrtg_summin \
michael@140 33 --catch $mrtg_sumpat \
michael@140 34 $mrtg_etcdir/mrtg.cfg \
michael@140 35 >>$mrtg_vardir/mrtg.log
michael@140 36 if [ ".$mrtg_sumail" != . ]; then
michael@140 37 @l_prefix@/bin/mrtg-traffic-sum \
michael@140 38 --min $mrtg_summin \
michael@140 39 --email $mrtg_sumail \
michael@140 40 --catch $mrtg_sumpat \
michael@140 41 $mrtg_etcdir/mrtg.cfg
michael@140 42 fi
michael@140 43

mercurial