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