Skip to content

Instantly share code, notes, and snippets.

@strayer
Created December 21, 2020 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strayer/c3c333017f7fed92d01ab4ab602fc697 to your computer and use it in GitHub Desktop.
Save strayer/c3c333017f7fed92d01ab4ab602fc697 to your computer and use it in GitHub Desktop.
Generate telegraf.conf for Vigor DSL model ADSL SNMP
#!/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