Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / network / tinydns @ dd4afac8

Historique | Voir | Annoter | Télécharger (2,18 ko)

1
#!/bin/sh
2
#
3
# Shows DNS query statistics as gathered by tinystats by Luca Morettoni.
4
#
5
# Parameters:
6
#
7
# 	config   (required)
8
# 	autoconf (optional - used by munin-config)
9
#
10
#%# family=auto
11
#%# capabilities=autoconf
12

    
13

    
14
if [ "$1" = "autoconf" ]; then
15
	if [ -f "/var/service/tinydns/log/main/tinystats.out" ]; then
16
		echo yes;
17
	else
18
		echo no;
19
	fi
20
	exit 0;
21
fi
22

    
23
if [ "$1" = "config" ]; then
24

    
25
	cat - <<EOF
26
graph_title tinydns queries
27
graph_args --base 1000 -l 0
28
graph_vlabel queries/sec
29
graph_category network
30
graph_info This graph shows the number of queries that tinydns processed.
31
graph_total Total
32
a.label A
33
a.info The number of A queries.
34
a.type DERIVE
35
a.min 0
36
a.draw AREA
37
ns.label NS
38
ns.info The number of NS queries.
39
ns.type DERIVE
40
ns.min 0
41
ns.draw STACK
42
cname.label CNAME
43
cname.info The number of CNAME queries.
44
cname.type DERIVE
45
cname.min 0
46
cname.draw STACK
47
soa.label SOA
48
soa.info The number of SOA queries.
49
soa.type DERIVE
50
soa.min 0
51
soa.draw STACK
52
ptr.label PTR
53
ptr.info The number of PTR queries.
54
ptr.type DERIVE
55
ptr.min 0
56
ptr.draw STACK
57
hinfo.label HINFO
58
hinfo.info The number of HINFO queries.
59
hinfo.type DERIVE
60
hinfo.min 0
61
hinfo.draw STACK
62
mx.label MX
63
mx.info The number of MX queries.
64
mx.type DERIVE
65
mx.min 0
66
mx.draw STACK
67
txt.label TXT
68
txt.info The number of TXT queries.
69
txt.type DERIVE
70
txt.min 0
71
txt.draw STACK
72
rp.label RP
73
rp.info The number of RP queries.
74
rp.type DERIVE
75
rp.min 0
76
rp.draw STACK
77
sig.label SIG
78
sig.info The number of SIG queries.
79
sig.type DERIVE
80
sig.min 0
81
sig.draw STACK
82
key.label KEY
83
key.info The number of KEY queries.
84
key.type DERIVE
85
key.min 0
86
key.draw STACK
87
aaaa.label AAAA
88
aaaa.info The number of AAAA queries.
89
aaaa.type DERIVE
90
aaaa.min 0
91
aaaa.draw STACK
92
axfr.label AXFR
93
axfr.info The number of AXFR queries.
94
axfr.type DERIVE
95
axfr.min 0
96
axfr.draw STACK
97
any.label ANY
98
any.info The number of ANY queries.
99
any.type DERIVE
100
any.min 0
101
any.draw STACK
102
EOF
103
	exit 0
104
fi
105

    
106
cat /var/service/tinydns/log/main/tinystats.out | head -n 1 | awk -F: '{ printf "a.value %d\nns.value %d\ncname.value %d\nsoa.value %d\nptr.value %d\nhinfo.value %d\nmx.value %d\ntxt.value %d\nrp.value %d\nsig.value %d\nkey.value %d\naaaa.value %d\naxfr.value %d\nany.value %d\n", $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14 }'