Project

General

Profile

Download (572 Bytes) Statistics
| Branch: | Revision:

root / scripts / stat_bind9 @ 865f4ff4

1
#!/bin/sh
2

    
3
PARAM=${1:-noexistent}
4

    
5
case "${PARAM}" in
6
  ipv4)
7
	PATTERN="IPv4 requests received"
8
	;;
9
  ipv6)
10
	PATTERN="IPv6 requests received"
11
	;;
12
  success)
13
	PATTERN="queries resulted in successful answer"
14
	;;
15
  failure)
16
	PATTERN=""
17
	;;
18
  nxdomain)
19
	PATTERN="queries resulted in NXDOMAIN"
20
	;;
21
  nxrrset)
22
	PATTERN="queries resulted in nxrrset"
23
	;;
24
  recursion)
25
	PATTERN="queries caused recursion"
26
	;;
27
  referral)
28
	PATTERN="queries resulted in non authoritative answer"
29
	;;
30
  *)
31
    exit
32
esac
33

    
34
grep "${PATTERN}" /var/cache/bind/named.stats | head -n 1 | awk '{ print $1 }'
35

    
(2-2/8)