create
changeset 0 55d66efee4e0
equal deleted inserted replaced
-1:000000000000 0:55d66efee4e0
       
     1 #!/bin/bash
       
     2 #
       
     3 # Added --fork compatibility to support multiple control sockets
       
     4 #
       
     5 # Original by ahu @ pdns-dev team
       
     6 # Modified by Daniel Selans <dan.s at hostdime.com>
       
     7 # 09.02.07
       
     8 #
       
     9 
       
    10 UPDATE_INTERVAL=60
       
    11 CHKFORK=`ps -C pdns_recursor --no-headers | wc -l`
       
    12 
       
    13 # Quick sanity check
       
    14 if [ CHKFORK = 0 ]
       
    15 then
       
    16          echo "pdns_recursor is not running!"
       
    17          exit
       
    18 fi
       
    19 
       
    20 COUNT=0
       
    21 
       
    22 until [ $CHKFORK = $COUNT ]
       
    23 do
       
    24          if [ $CHKFORK = 2 ]
       
    25          then
       
    26                  RRDFILEEND="$COUNT.rrd"
       
    27          else
       
    28                  RRDFILEEND="rrd"
       
    29          fi
       
    30 
       
    31          echo "rrdtool create pdns_recursor.$RRDFILEEND"
       
    32          rrdtool create pdns_recursor.$RRDFILEEND -s $UPDATE_INTERVAL \
       
    33          DS:questions:COUNTER:600:0:100000 \
       
    34          DS:tcp-questions:COUNTER:600:0:100000 \
       
    35          DS:cache-entries:GAUGE:600:0:U \
       
    36          DS:throttle-entries:GAUGE:600:0:U \
       
    37          DS:concurrent-queries:GAUGE:600:0:50000 \
       
    38          DS:noerror-answers:COUNTER:600:0:100000 \
       
    39          DS:nxdomain-answers:COUNTER:600:0:100000 \
       
    40          DS:servfail-answers:COUNTER:600:0:100000 \
       
    41          DS:tcp-outqueries:COUNTER:600:0:100000 \
       
    42          DS:outgoing-timeouts:COUNTER:600:0:100000 \
       
    43          DS:throttled-out:COUNTER:600:0:100000 \
       
    44          DS:nsspeeds-entries:GAUGE:600:0:U \
       
    45          DS:negcache-entries:GAUGE:600:0:U \
       
    46          DS:all-outqueries:COUNTER:600:0:100000 \
       
    47          DS:cache-hits:COUNTER:600:0:100000 \
       
    48          DS:cache-misses:COUNTER:600:0:100000 \
       
    49          DS:answers0-1:COUNTER:600:0:100000 \
       
    50          DS:answers1-10:COUNTER:600:0:100000 \
       
    51          DS:answers10-100:COUNTER:600:0:100000 \
       
    52          DS:answers100-1000:COUNTER:600:0:100000 \
       
    53          DS:answers-slow:COUNTER:600:0:100000 \
       
    54          DS:qa-latency:GAUGE:600:0:10000000 \
       
    55          DS:user-msec:COUNTER:600:0:2000 \
       
    56          DS:client-parse-errors:COUNTER:600:0:1000000 \
       
    57          DS:server-parse-errors:COUNTER:600:0:1000000 \
       
    58          DS:unauthorized-udp:COUNTER:600:0:1000000 \
       
    59          DS:unauthorized-tcp:COUNTER:600:0:1000000 \
       
    60          DS:sys-msec:COUNTER:600:0:2000 \
       
    61          RRA:AVERAGE:0.5:1:9600  \
       
    62          RRA:AVERAGE:0.5:4:9600  \
       
    63          RRA:AVERAGE:0.5:24:6000 \
       
    64          RRA:MAX:0.5:1:9600  \
       
    65          RRA:MAX:0.5:4:9600      \
       
    66          RRA:MAX:0.5:24:6000
       
    67          COUNT=$(($COUNT + 1))
       
    68 done