Das standardmäßige eth-Skript verwendet ethtool, das bei einem ppp-Link nicht funktioniert.
Auch das eth-Skript verwendet COUNTER anstelle von DERIVE, wodurch Sie jedes Mal, wenn Sie die PPP-Verbindung wieder herstellen, schlechte Spitzen erhalten.
Hier ist mein Skript (ändern Sie up.max, down.max auf Ihre ppp links Bandbreite) ...
#!/bin/sh INTERFACE=`basename $0 | sed 's/^if_//g'` if [ "$1" = "autoconf" ]; then if [ -r /proc/net/dev ]; then echo yes exit 0 else echo "no (/proc/net/dev not found)" exit 1 fi fi if [ "$1" = "suggest" ]; then if [ -r /proc/net/dev ]; then egrep '^ *(ppp|eth|wlan|ath|ra|msh|venet|veth)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' exit 0 else exit 1 fi fi if [ "$1" = "config" ]; then echo "graph_order down up" echo "graph_title $INTERFACE traffic" echo 'graph_args --base 1000' echo 'graph_vlabel bits in (-) / out (+) per $' echo 'graph_category network' echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is unsuitable for most production environments. To avoid this problem, use the ip_ plugin instead." echo 'down.label received' echo 'down.type DERIVE' echo 'down.graph no' echo 'down.cdef down,8,*' echo 'up.label bps' echo 'up.type DERIVE' echo 'up.negative down' echo 'up.cdef up,8,*' case "$INTERFACE" in ath*|wlan*|ra*) echo -n "up.info Traffic of the $INTERFACE interface. Maximum speed is " which iwlist >/dev/null 2>/dev/null || echo "undeterminable (please install iwlist)." iwlist $INTERFACE rate 2>/dev/null | awk '/Current Bit Rate/ { split ($0, arr, "[=:]"); split (arr[2], arr2, "M"); print (arr2[1]*1000000) " bits per second.\nup.max " (arr2[1]*1000000) "\ndown.max "(arr2[1]*1000000); }' ;; *) #echo -n "up.info Traffic of the $INTERFACE interface. Maximum speed is " #which ethtool >/dev/null 2>/dev/null || echo "undeterminable (please install ethtool)." #ethtool $INTERFACE 2>/dev/null | awk '/Speed/ { split ($2, arr2, "M"); print (arr2[1]*1000000) " bits per second.\nup.max " (arr2[1]*1000000) "\ndown.max "(arr2[1]*1000000); }' echo "up.info Traffic of the $INTERFACE interface. Maximum speed is 100000000 bits per second." echo "up.min 0" echo "down.min 0" echo "up.max 100000000" echo "down.max 100000000" ;; esac exit 0 fi; # Escape dots in the interface name (eg. vlans) before using it as a regex awk -v interface="$INTERFACE" \ 'BEGIN { gsub(/\./, "\\.", interface) } \ $1 ~ "^" interface ":" { split($0, a, /: */); $0 = a[2]; \ print "down.value " $1 "\nup.value " $9 \ }' \ /proc/net/dev