]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/red
Fix spikes in qos-graphs
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / networking / red
index 5843903ebb63abb3e0dbd8621a4d7309eda19454..debb0d20c6d33401198ba0963bc964d2c4c4d35d 100644 (file)
 
 . /etc/sysconfig/rc 
 . ${rc_functions}
+
+eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
+if [ "$RRDLOG" == "" ]; then
+       RRDLOG=/var/log/rrd
+fi
+
 eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
 TYPE="${RED_TYPE}"
@@ -357,7 +363,10 @@ case "${1}" in
                        ## Create & Enable vnstat
                        /usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1
                        /etc/rc.d/init.d/connectd start
-
+                       # Add a NaN value to ppp0 rrd to supress spikes at reconnect
+                       rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \
+                               $(date +%s)::
+                       exit 0
                fi
                ;;
 
@@ -413,6 +422,9 @@ case "${1}" in
                        rm -f /var/ipfire/red/keepconnected
                        killall -w -s TERM /usr/sbin/pppd 2>/dev/null
                        evaluate_retval
+                       # Add a NaN value to ppp0 rrd to supress spikes at reconnect
+                       rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \
+                               $(date +%s)::
                fi
 
                if [ "$DEVICE" != "${GREEN_DEV}" ] && [ "$DEVICE" != "" ]; then