muninlite/plugins/if_err_
Kim B. Heino e6f5722a04 plugins/if: include "Interface" to graph_title for better grouping
Nowadays network interfaces have names like docker0, team0, ip_vti0, eno,
wlp61s0 and so on. Including word "Interface" in beginning of
graph_title groups these graphs together in web interface, not randomly
before/after other network-graphs (ipconntrack, firewall, ...).

See commit 70711831c44 in munin repository for similar change.
2020-10-07 18:41:47 +02:00

23 lines
809 B
Text

config_if_err() {
INTERFACE=$1
echo "graph_order rcvd trans"
echo "graph_title Interface $INTERFACE errors"
echo "graph_args --base 1000"
echo "graph_vlabel packets in (-) / out (+) per \${graph_period}"
echo "graph_category network"
echo "graph_info This graph shows the amount of errors on the $INTERFACE network interface."
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() {
INTERFACE=$1
IINFO=$(grep "^ *$INTERFACE:" /proc/net/dev | cut -d ":" -f 2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
echo "rcvd.value" "$(echo "$IINFO" | cut -d " " -f 3)"
echo "trans.value" "$(echo "$IINFO" | cut -d " " -f 11)"
}