Skip to content

Instantly share code, notes, and snippets.

View thomaswr's full-sized avatar

Thomas thomaswr

  • Vienna, Austria
View GitHub Profile
@thomaswr
thomaswr / bandwidth.sh
Created April 7, 2023 20:44 — forked from lanrat/bandwidth.sh
DD-WRT SNMP bandwidth
#!/usr/bin/env bash
HOST=192.168.1.1
IFACE_ID=3
SAMPLE=5
## iface
NAME=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.2.$IFACE_ID | cut -d ' ' -f2)
echo "Bandwidth for $NAME"
## bytes
D1=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.10.$IFACE_ID | cut -d ' ' -f2)
U1=$(snmpget -v 2c -c public -O q $HOST iso.3.6.1.2.1.2.2.1.16.$IFACE_ID | cut -d ' ' -f2)