1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Use pdns_control utility instead of pdns init script.

The init script is not usable on systems using systemd (e.g. Debian stretch).
This commit is contained in:
Bas Couwenberg 2017-09-28 09:54:22 +02:00
parent a8d117a3f0
commit 87d30e5597
5 changed files with 53 additions and 26 deletions

View file

@ -9,11 +9,16 @@
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns dump"
command="/usr/bin/pdns_control list"
if [ "$1" = "autoconf" ]; then
if [ -e /usr/bin/pdns_control ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then

View file

@ -9,11 +9,16 @@
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
command="/usr/bin/pdns_control show"
if [ "$1" = "autoconf" ]; then
if [ -e /usr/bin/pdns_control ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
@ -31,4 +36,4 @@ fi
echo "latency.value $($command latency | awk -F= '{print $2}')"
echo "latency.value $($command latency)"

View file

@ -9,11 +9,16 @@
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
command="/usr/bin/pdns_control show"
if [ "$1" = "autoconf" ]; then
if [ -e /usr/bin/pdns_control ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
@ -31,5 +36,5 @@ fi
echo "qsize.value $($command qsize_q | awk -F= '{print $2}')"
echo "qsize.value $($command qsize-q)"

View file

@ -9,11 +9,16 @@
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns dump"
command="/usr/bin/pdns_control list"
if [ "$1" = "autoconf" ]; then
if [ -e /usr/bin/pdns_control ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then

View file

@ -9,12 +9,17 @@
#%# family=auto
#%# capabilities=autoconf
command="/etc/init.d/pdns show"
command="/usr/bin/pdns_control show"
state_file=$MUNIN_PLUGSTATE/pdns_rel.state
if [ "$1" = "autoconf" ]; then
if [ -e /usr/bin/pdns_control ]; then
echo yes
exit 0
else
echo no
exit 1
fi
fi
if [ "$1" = "config" ]; then
@ -31,10 +36,12 @@ if [ "$1" = "config" ]; then
exit 0
fi
hits=$($command packetcache-hit | awk -F= '{print $2}')
queries=$($command udp-queries | awk -F= '{print $2}')
old_hits=$(cat $state_file | head -n1)
old_queries=$(cat $state_file | tail -n1)
hits=$($command packetcache-hit)
queries=$($command udp-queries)
if [ -f $state_file ]; then
old_hits=$(cat $state_file | head -n1)
old_queries=$(cat $state_file | tail -n1)
fi
if [ -f $state_file ] && [ $(ls -l --time-style=+%s $state_file | awk '{print $6}') -gt $(date --date="7 minutes ago" +%s) ] ; then
d_hits=$(($hits - $old_hits))