|
#!/bin/sh
|
|
|
|
PARAM=${1:-noexistent}
|
|
|
|
case "${PARAM}" in
|
|
ipv4)
|
|
PATTERN="IPv4 requests received"
|
|
;;
|
|
ipv6)
|
|
PATTERN="IPv6 requests received"
|
|
;;
|
|
success)
|
|
PATTERN="queries resulted in successful answer"
|
|
;;
|
|
failure)
|
|
PATTERN=""
|
|
;;
|
|
nxdomain)
|
|
PATTERN="queries resulted in NXDOMAIN"
|
|
;;
|
|
nxrrset)
|
|
PATTERN="queries resulted in nxrrset"
|
|
;;
|
|
recursion)
|
|
PATTERN="queries caused recursion"
|
|
;;
|
|
referral)
|
|
PATTERN="queries resulted in non authoritative answer"
|
|
;;
|
|
*)
|
|
exit
|
|
esac
|
|
|
|
grep "${PATTERN}" /var/cache/bind/named.stats | head -n 1 | awk '{ print $1 }'
|
|
|