-
Notifications
You must be signed in to change notification settings - Fork 3
/
pdns_rec_querylatency
executable file
·49 lines (42 loc) · 1.08 KB
/
pdns_rec_querylatency
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# pdns_recursor munin plugin.
# Written by Sean Reifschneider <[email protected]> 2009-12-03
# Placed in the public domain
#
# Requires running as root:
#
# echo '[pdns_rec_*]' >/etc/munin/plugin-conf.d/pdns_rec
# echo 'user root' >>/etc/munin/plugin-conf.d/pdns_rec
#
# Configuration variables:
#
# rec_control: Path to rec_control executable
# (default: /usr/bin/rec_control)
REC_CONTROL="${rec_control:-/usr/bin/rec_control}"
if [ "$1" = "autoconf" ]; then
if [ -e "$REC_CONTROL" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title PDNS Recursor Answer Latency'
echo 'graph_order latency'
echo 'graph_vlabel usec'
echo 'graph_info Question latency'
echo 'graph_category pdns'
echo 'graph_scale no'
echo 'latency.label usec'
echo 'latency.min 0'
echo 'latency.type GAUGE'
echo 'latency.info Answer latency'
exit 0
fi
echo latency.value `"$REC_CONTROL" get qa-latency`
#VALUE=`"$REC_CONTROL" get qa-latency`
#printf 'latency.value %d.%06d\n' $[VALUE/1000000] $[VALUE%1000000]
exit 0