Created
December 21, 2020 14:45
-
-
Save strayer/c3c333017f7fed92d01ab4ab602fc697 to your computer and use it in GitHub Desktop.
Generate telegraf.conf for Vigor DSL model ADSL SNMP
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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
# download http://www.circitor.fr/Mibs/Mib/A/ADSL-LINE-MIB.mib to $HOME/.snmp/mibs | |
NAMES=$(snmpwalk -m ALL -v2c -cpublic $VIGOR_IP | grep ADSL | cut -f1 -d' ') | |
for i in $NAMES; do | |
SHORTNAME=$(printf "$i" | cut -f3 -d":" | cut -f1 -d'.') | |
OID=$(snmptranslate -On "$i") | |
echo "[[inputs.snmp.field]]" | |
printf " name = '%s'\n" "$SHORTNAME" | |
printf " oid = '%s'\n" "$OID" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment