Skip to content

Instantly share code, notes, and snippets.

@smj10j
Last active August 23, 2016 13:07
Show Gist options
  • Save smj10j/45ea9ab1dd40c0a12bfff74d5379852b to your computer and use it in GitHub Desktop.
Save smj10j/45ea9ab1dd40c0a12bfff74d5379852b to your computer and use it in GitHub Desktop.
Get dnsmasq cache status
#!/usr/bin/env bash
# activate debugging
#set -x
# fail on any errors
set -e
# OSX
tac <(sudo killall -SIGUSR1 dnsmasq && tac /usr/local/var/log/dnsmasq/dnsmasq.log | grep -m1 -B1000 ": time ")
#sudo killall -SIGUSR1 dnsmasq && tac /usr/local/var/log/dnsmasq/dnsmasq.log | grep -m1 -B1000 ": time " | tac
# Ubuntu/Debian
#sudo service dnsmasq dump-stats && tac <(sudo killall -SIGUSR1 dnsmasq && sudo tac /var/log/syslog | grep -m1 -B1000 ": time ")
#!/usr/bin/env bash
# activate debugging
#set -x
# fail on any errors
set -e
# OSX
watch -dc -n10 'sudo killall -SIGUSR1 dnsmasq && tac /usr/local/var/log/dnsmasq/dnsmasq.log | grep -m1 -B1000 ": time " | tac'
#watch -dc -n10 ./dnsmasq-status.command
# Ubuntu/Debian
#sudo watch -dc -n10 'service dnsmasq dump-stats; killall -SIGUSR1 dnsmasq; tac /var/log/syslog | grep -m1 -B1000 ": time " | tac'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment