root / plugins / pdns / pdns_queries @ a86de787
Historique | Voir | Annoter | Télécharger (2 ko)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
# |
| 3 |
# Script to monitor PowerDNS performance |
| 4 |
# |
| 5 |
# Parameters understood: |
| 6 |
# |
| 7 |
# config (required) |
| 8 |
# autoconf (optional - used by munin-config) |
| 9 |
#%# family=auto |
| 10 |
#%# capabilities=autoconf |
| 11 |
|
| 12 |
pdns_control="/usr/bin/pdns_control" |
| 13 |
command="/usr/bin/pdns_control list" |
| 14 |
|
| 15 |
if [ "$1" = "autoconf" ]; then |
| 16 |
if [ -e "$pdns_control" ]; then |
| 17 |
echo yes |
| 18 |
exit 0 |
| 19 |
else |
| 20 |
echo "no (missing $pdns_control)" |
| 21 |
exit 0 |
| 22 |
fi |
| 23 |
fi |
| 24 |
|
| 25 |
if [ "$1" = "config" ]; then |
| 26 |
echo 'graph_title Power DNS queries' |
| 27 |
echo 'graph_args -l 0 --base 1000' |
| 28 |
echo 'graph_vlabel numbers of' |
| 29 |
echo 'graph_category dns' |
| 30 |
echo 'graph_info This graph shows Power DNS performance on the machine.' |
| 31 |
echo 'recursing_answers.label recursing answers' |
| 32 |
echo 'recursing_answers.type DERIVE' |
| 33 |
echo 'recursing_answers.min 0' |
| 34 |
echo 'recursing_answers.info Number of recursive answers sent out' |
| 35 |
echo 'recursing_questions.label recursing queries' |
| 36 |
echo 'recursing_questions.type DERIVE' |
| 37 |
echo 'recursing_questions.min 0' |
| 38 |
echo 'recursing_questions.info Number of queries sent to recursor' |
| 39 |
echo 'tcp_answers.label tcp answers' |
| 40 |
echo 'tcp_answers.type DERIVE' |
| 41 |
echo 'tcp_answers.min 0' |
| 42 |
echo 'tcp_answers.info Number of answers sent out over TCP' |
| 43 |
echo 'tcp_queries.label tcp queries' |
| 44 |
echo 'tcp_queries.type DERIVE' |
| 45 |
echo 'tcp_queries.min 0' |
| 46 |
echo 'tcp_queries.info Number of TCP queries received' |
| 47 |
echo 'udp_answers.label udp answers' |
| 48 |
echo 'udp_answers.type DERIVE' |
| 49 |
echo 'udp_answers.min 0' |
| 50 |
echo 'udp_answers.info Number of answers sent out over UDP' |
| 51 |
echo 'udp_queries.label udp queries' |
| 52 |
echo 'udp_queries.type DERIVE' |
| 53 |
echo 'udp_queries.min 0' |
| 54 |
echo 'udp_queries.info Number of UDP queries received' |
| 55 |
exit 0 |
| 56 |
fi |
| 57 |
|
| 58 |
|
| 59 |
$command | sed 's/=\([0-9]\+\),/.value \1\n/g' | egrep "udp-|recursing|tcp" | sed 's/-/_/g' |
