#!/bin/bash
#
# Added --fork compatibility to support multiple control sockets
#
# Original by ahu @ pdns-dev team
# Modified by Daniel Selans <dan.s at hostdime.com>
# 09.02.07
#
UPDATE_INTERVAL=60
CHKFORK=`ps -C pdns_recursor --no-headers | wc -l`
# Quick sanity check
if [ CHKFORK = 0 ]
then
echo "pdns_recursor is not running!"
exit
fi
COUNT=0
until [ $CHKFORK = $COUNT ]
do
if [ $CHKFORK = 2 ]
then
RRDFILEEND="$COUNT.rrd"
else
RRDFILEEND="rrd"
fi
echo "rrdtool create pdns_recursor.$RRDFILEEND"
rrdtool create pdns_recursor.$RRDFILEEND -s $UPDATE_INTERVAL \
DS:questions:COUNTER:600:0:100000 \
DS:tcp-questions:COUNTER:600:0:100000 \
DS:cache-entries:GAUGE:600:0:U \
DS:throttle-entries:GAUGE:600:0:U \
DS:concurrent-queries:GAUGE:600:0:50000 \
DS:noerror-answers:COUNTER:600:0:100000 \
DS:nxdomain-answers:COUNTER:600:0:100000 \
DS:servfail-answers:COUNTER:600:0:100000 \
DS:tcp-outqueries:COUNTER:600:0:100000 \
DS:outgoing-timeouts:COUNTER:600:0:100000 \
DS:throttled-out:COUNTER:600:0:100000 \
DS:nsspeeds-entries:GAUGE:600:0:U \
DS:negcache-entries:GAUGE:600:0:U \
DS:all-outqueries:COUNTER:600:0:100000 \
DS:cache-hits:COUNTER:600:0:100000 \
DS:cache-misses:COUNTER:600:0:100000 \
DS:answers0-1:COUNTER:600:0:100000 \
DS:answers1-10:COUNTER:600:0:100000 \
DS:answers10-100:COUNTER:600:0:100000 \
DS:answers100-1000:COUNTER:600:0:100000 \
DS:answers-slow:COUNTER:600:0:100000 \
DS:qa-latency:GAUGE:600:0:10000000 \
DS:user-msec:COUNTER:600:0:2000 \
DS:client-parse-errors:COUNTER:600:0:1000000 \
DS:server-parse-errors:COUNTER:600:0:1000000 \
DS:unauthorized-udp:COUNTER:600:0:1000000 \
DS:unauthorized-tcp:COUNTER:600:0:1000000 \
DS:sys-msec:COUNTER:600:0:2000 \
RRA:AVERAGE:0.5:1:9600 \
RRA:AVERAGE:0.5:4:9600 \
RRA:AVERAGE:0.5:24:6000 \
RRA:MAX:0.5:1:9600 \
RRA:MAX:0.5:4:9600 \
RRA:MAX:0.5:24:6000
COUNT=$(($COUNT + 1))
done