Skip to content

Instantly share code, notes, and snippets.

@fser
Created January 23, 2020 22:57
Show Gist options
  • Save fser/01c415ab8e45ef478ec8a9d43fc13c1f to your computer and use it in GitHub Desktop.
Save fser/01c415ab8e45ef478ec8a9d43fc13c1f to your computer and use it in GitHub Desktop.
Pushes number of zones from a master DNS into an influxDB. No rocket science, but keep this somewhere.
#!/usr/bin/env bash
NRZONES=$(rndc status | awk -F: '/number of zones/ { gsub(/ /, "", $2); print $2 }')
curl -s -XPOST 'http://10.0.1.1:8086/write?db=dns_stats' --data-binary "nrzones,type=master value=$NRZONES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment