I would like to share some "nasty" bash scripts to simplify generation of collectd configuration for collecting snmp statistics used in Grafana.
They are a bit hardcoded, and should maybe be done in Python. *TODO when I have the skills*.
Feel free to spit on it if you have that approach, for the rest, use it, modify it to suit your needs. Add improvements or similar things if you would like to share back to me and others. No need to re-invent the wheel...
# # This script will fetch interfaces with st0.x and prepare config to be used with colleced. # The usage is ./script.sh myfirewall.fqdn.net # A lot of settings is hardcoded in here. if you make changes, make sure to backup the data and make a copy of your own to play with. # The output filename will be myfirewall.fqdn.net.conf. Dont trust that the output is 100 percent working. but close to at least.
if [[ $# -eq 0 ]] ; then echo 'Usage: ./script.sh switch-fqdn' exit 1 fi