Created
January 21, 2024 04:40
-
-
Save edavis/bec5d22be3cd3c2bf70de2769f7375b9 to your computer and use it in GitHub Desktop.
Graph rx and tx separately in munin. Taken from the core if_ plugin but simplified down.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INTERFACE="eth0" | |
case $1 in | |
config) | |
echo "graph_title $INTERFACE rx traffic" | |
echo 'graph_args --base 1000' | |
echo 'graph_category network' | |
echo 'traffic.label rx' | |
echo 'traffic.type DERIVE' | |
echo 'traffic.cdef traffic,8,*' | |
exit 0 | |
;; | |
esac | |
echo "traffic.value $(cat "/sys/class/net/$INTERFACE/statistics/rx_bytes")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INTERFACE="eth0" | |
case $1 in | |
config) | |
echo "graph_title $INTERFACE tx traffic" | |
echo 'graph_args --base 1000' | |
echo 'graph_category network' | |
echo 'traffic.label tx' | |
echo 'traffic.type DERIVE' | |
echo 'traffic.cdef traffic,8,*' | |
exit 0 | |
;; | |
esac | |
echo "traffic.value $(cat "/sys/class/net/$INTERFACE/statistics/tx_bytes")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment