2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #574 from HeisSpiter/master

Use MUNIN_STATEFILE env variable to support multiple masters instead of ...
This commit is contained in:
Steve Schnepp 2015-01-22 11:32:25 +01:00
commit 341798cdc3

View File

@ -51,8 +51,6 @@ GPLv2
=cut
STAT_FILE=$MUNIN_PLUGSTATE/plugin-traffic_ipt.state
if [ "$1" == "config" ]
then
cat <<'EOF'
@ -103,12 +101,12 @@ EOF
exit 0
fi
if [ ! -r $STAT_FILE ]; then
if [ ! -r $MUNIN_STATEFILE ]; then
oldv4=0
oldv6=0
else
oldv4=$(grep IPv4 $STAT_FILE | cut -f2 -d '=')
oldv6=$(grep IPv6 $STAT_FILE | cut -f2 -d '=')
oldv4=$(grep IPv4 $MUNIN_STATEFILE | cut -f2 -d '=')
oldv6=$(grep IPv6 $MUNIN_STATEFILE | cut -f2 -d '=')
fi
ipv4=0
@ -146,8 +144,8 @@ else
diffv4=$ipv6
fi
echo "IPv4=$ipv4" > $STAT_FILE
echo "IPv6=$ipv6" >> $STAT_FILE
echo "IPv4=$ipv4" > $MUNIN_STATEFILE
echo "IPv6=$ipv6" >> $MUNIN_STATEFILE
echo "IPv4.value $diffv4"
echo "IPv6.value $diffv6"