2007-05-22 09:33:43 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Script to monitor PowerDNS performance
|
|
|
|
#
|
|
|
|
# Parameters understood:
|
|
|
|
#
|
|
|
|
# config (required)
|
|
|
|
# autoconf (optional - used by munin-config)
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
2017-09-29 10:20:40 +02:00
|
|
|
pdns_control="/usr/bin/pdns_control"
|
|
|
|
command="$pdns_control show"
|
2007-05-22 09:33:43 +02:00
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
2017-09-29 10:20:40 +02:00
|
|
|
if [ -e "$pdns_control" ]; then
|
2017-09-28 09:54:22 +02:00
|
|
|
echo yes
|
|
|
|
exit 0
|
|
|
|
else
|
2017-09-29 10:20:40 +02:00
|
|
|
echo "no (missing $pdns_control)"
|
|
|
|
exit 0
|
2017-09-28 09:54:22 +02:00
|
|
|
fi
|
2007-05-22 09:33:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo 'graph_title Power DNS latency'
|
|
|
|
echo 'graph_args -l 0'
|
|
|
|
echo 'graph_vlabel usec'
|
2017-02-22 00:30:20 +01:00
|
|
|
echo 'graph_category dns'
|
2007-05-22 09:33:43 +02:00
|
|
|
echo 'graph_info This graph shows Power DNS latency on the machine.'
|
|
|
|
echo 'latency.label latency'
|
|
|
|
echo 'latency.info Average number of microseconds needed to answer a question'
|
|
|
|
echo 'latency.type GAUGE'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-28 09:54:22 +02:00
|
|
|
echo "latency.value $($command latency)"
|