2007-06-11 17:45:16 +02:00
|
|
|
config_if_err() {
|
2020-02-08 05:28:40 +01:00
|
|
|
INTERFACE=$1
|
2007-06-11 17:45:16 +02:00
|
|
|
echo "graph_order rcvd trans"
|
2020-02-08 05:28:40 +01:00
|
|
|
echo "graph_title $INTERFACE errors"
|
2007-06-11 17:45:16 +02:00
|
|
|
echo "graph_args --base 1000"
|
|
|
|
echo "graph_vlabel packets in (-) / out (+) per \${graph_period}"
|
|
|
|
echo "graph_category network"
|
2020-02-08 05:28:40 +01:00
|
|
|
echo "graph_info This graph shows the amount of errors on the $INTERFACE network interface."
|
2007-06-11 17:45:16 +02:00
|
|
|
echo "rcvd.label packets"
|
|
|
|
echo "rcvd.type COUNTER"
|
|
|
|
echo "rcvd.graph no"
|
|
|
|
echo "rcvd.warning 1"
|
|
|
|
echo "trans.label packets"
|
|
|
|
echo "trans.type COUNTER"
|
|
|
|
echo "trans.negative rcvd"
|
|
|
|
echo "trans.warning 1"
|
|
|
|
}
|
|
|
|
fetch_if_err() {
|
2020-02-08 05:28:40 +01:00
|
|
|
INTERFACE=$1
|
|
|
|
IINFO=$(grep "^ *$INTERFACE:" /proc/net/dev | cut -d ":" -f 2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
|
2020-02-07 15:15:06 +01:00
|
|
|
echo "rcvd.value" "$(echo "$IINFO" | cut -d " " -f 3)"
|
|
|
|
echo "trans.value" "$(echo "$IINFO" | cut -d " " -f 11)"
|
2007-06-11 17:45:16 +02:00
|
|
|
}
|