1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
#!/usr/bin/env bash
WWWPREFIX=.
WSIZE=800
HSIZE=250
# only recent rrds offer slope-mode:
GRAPHOPTS=--slope-mode
function makeGraphs()
{
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/questions-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Questions and answers per second" \
-v "packets" \
DEF:questions=pdns_recursor.rrd:questions:AVERAGE \
DEF:nxdomainanswers=pdns_recursor.rrd:nxdomain-answers:AVERAGE \
DEF:noerroranswers=pdns_recursor.rrd:noerror-answers:AVERAGE \
DEF:servfailanswers=pdns_recursor.rrd:servfail-answers:AVERAGE \
LINE1:questions#0000ff:"questions/s"\
AREA:noerroranswers#00ff00:"noerror answers/s" \
STACK:nxdomainanswers#ffa500:"nxdomain answers/s"\
STACK:servfailanswers#ff0000:"servfail answers/s"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/tcp-questions-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "TCP questions and answers per second, unauthorized packets/s" \
-v "packets" \
DEF:tcpquestions=pdns_recursor.rrd:tcp-questions:AVERAGE \
DEF:unauthudp=pdns_recursor.rrd:unauthorized-udp:AVERAGE \
DEF:unauthtcp=pdns_recursor.rrd:unauthorized-tcp:AVERAGE \
LINE1:tcpquestions#0000ff:"tcp questions/s" \
LINE1:unauthudp#ff0000:"udp unauth/s" \
LINE1:unauthtcp#00ff00:"tcp unauth/s"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/packet-errors-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Packet errors per second" \
-v "packets" \
DEF:clientparseerrors=pdns_recursor.rrd:client-parse-errors:AVERAGE \
DEF:serverparseerrors=pdns_recursor.rrd:server-parse-errors:AVERAGE \
DEF:unexpected=pdns_recursor.rrd:unexpected-packets:AVERAGE \
DEF:udpoverruns=pdns_recursor.rrd:udp-overruns:AVERAGE \
LINE1:clientparseerrors#0000ff:"bad packets from clients" \
LINE1:serverparseerrors#00ff00:"bad packets from servers" \
LINE1:unexpected#ff0000:"unexpected packets from servers" \
LINE1:udpoverruns#ff00ff:"udp overruns from remotes"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/limits-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Limitations per second" \
-v "events" \
DEF:resourcelimits=pdns_recursor.rrd:resource-limits:AVERAGE \
DEF:overcapacities=pdns_recursor.rrd:over-capacity-drops:AVERAGE \
LINE1:resourcelimits#ff0000:"outqueries dropped because of resource limits" \
LINE1:overcapacities#0000ff:"questions dropped because of mthread limit"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/latencies-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Questions answered within latency" \
-v "questions" \
DEF:questions=pdns_recursor.rrd:questions:AVERAGE \
DEF:answers00=pdns_recursor.rrd:packetcache-hits:AVERAGE \
DEF:answers01=pdns_recursor.rrd:answers0-1:AVERAGE \
DEF:answers110=pdns_recursor.rrd:answers1-10:AVERAGE \
DEF:answers10100=pdns_recursor.rrd:answers10-100:AVERAGE \
DEF:answers1001000=pdns_recursor.rrd:answers100-1000:AVERAGE \
DEF:answersslow=pdns_recursor.rrd:answers-slow:AVERAGE \
LINE1:questions#0000ff:"questions/s" \
AREA:answers00#00ff00:"<<1 ms" \
STACK:answers01#00fff0:"<1 ms" \
STACK:answers110#0000ff:"<10 ms" \
STACK:answers10100#ff9900:"<100 ms" \
STACK:answers1001000#ffff00:"<1000 ms" \
STACK:answersslow#ff0000:">1000 ms"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/qoutq-$2.png -w $WSIZE -h $HSIZE -l 0 \
-t "Questions/outqueries per second" \
-v "packets" \
DEF:questions=pdns_recursor.rrd:questions:AVERAGE \
DEF:alloutqueries=pdns_recursor.rrd:all-outqueries:AVERAGE \
LINE1:questions#ff0000:"questions/s"\
LINE1:alloutqueries#00ff00:"outqueries/s"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/qa-latency-$2.png -w $WSIZE -h $HSIZE -l 0 \
-t "Questions/answer latency in ms" \
-v "ms" \
DEF:qalatency=pdns_recursor.rrd:qa-latency:AVERAGE \
CDEF:mqalatency=qalatency,1000,/ \
LINE1:mqalatency#ff0000:"questions/s"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/timeouts-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Outqueries/timeouts per second" \
-v "events" \
DEF:alloutqueries=pdns_recursor.rrd:all-outqueries:AVERAGE \
DEF:outgoingtimeouts=pdns_recursor.rrd:outgoing-timeouts:AVERAGE \
DEF:throttledout=pdns_recursor.rrd:throttled-out:AVERAGE \
LINE1:alloutqueries#ff0000:"outqueries/s"\
LINE1:outgoingtimeouts#00ff00:"outgoing timeouts/s"\
LINE1:throttledout#0000ff:"throttled outqueries/s"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/caches-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Cache sizes" \
-v "entries" \
DEF:cacheentries=pdns_recursor.rrd:cache-entries:AVERAGE \
DEF:packetcacheentries=pdns_recursor.rrd:packetcache-entries:AVERAGE \
DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE \
DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE \
DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE \
LINE1:cacheentries#ff0000:"cache entries" \
LINE1:packetcacheentries#ffff00:"packet cache entries" \
LINE1:negcacheentries#0000ff:"negative cache entries" \
LINE1:nsspeedsentries#00ff00:"NS speeds entries" \
LINE1:throttleentries#00fff0:"throttle map entries"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/caches2-$2.png -w $WSIZE -h $HSIZE -l 0\
-t "Cache sizes" \
-v "entries" \
DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE \
DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE \
DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE \
LINE1:negcacheentries#0000ff:"negative cache entries" \
LINE1:nsspeedsentries#00ff00:"NS speeds entries" \
LINE1:throttleentries#ffa000:"throttle map entries"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/load-$2.png -w $WSIZE -h $HSIZE -l 0\
-v "MThreads" \
-t "Concurrent queries" \
DEF:concurrentqueries=pdns_recursor.rrd:concurrent-queries:AVERAGE \
LINE1:concurrentqueries#0000ff:"concurrent queries"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/hitrate-$2.png -w $WSIZE -h $HSIZE -l 0\
-v "percentage" \
-t "cache hits" \
DEF:cachehits=pdns_recursor.rrd:cache-hits:AVERAGE \
DEF:cachemisses=pdns_recursor.rrd:cache-misses:AVERAGE \
DEF:packetcachehits=pdns_recursor.rrd:packetcache-hits:AVERAGE \
DEF:packetcachemisses=pdns_recursor.rrd:packetcache-misses:AVERAGE \
CDEF:perc=cachehits,100,*,cachehits,cachemisses,+,/ \
CDEF:packetperc=packetcachehits,100,*,packetcachehits,packetcachemisses,+,/ \
LINE1:perc#0000ff:"percentage cache hits" \
LINE1:packetperc#ff00ff:"percentage packetcache hits" \
COMMENT:"\l" \
COMMENT:"Cache hits " \
GPRINT:perc:AVERAGE:"avg %-3.1lf%%\t" \
GPRINT:perc:LAST:"last %-3.1lf%%\t" \
GPRINT:perc:MAX:"max %-3.1lf%%" \
COMMENT:"\l" \
COMMENT:"Pkt hits " \
GPRINT:packetperc:AVERAGE:"avg %-3.1lf%%\t" \
GPRINT:packetperc:LAST:"last %-3.1lf%%\t" \
GPRINT:packetperc:MAX:"max %-3.1lf%%" \
COMMENT:"\l"
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/cpuload-$2.png -w $WSIZE -h $HSIZE -l 0\
-v "percentage" \
-t "cpu load" \
DEF:usermsec=pdns_recursor.rrd:user-msec:AVERAGE \
DEF:sysmsec=pdns_recursor.rrd:sys-msec:AVERAGE \
DEF:musermsec=pdns_recursor.rrd:user-msec:MAX \
DEF:msysmsec=pdns_recursor.rrd:sys-msec:MAX \
CDEF:userperc=usermsec,10,/ \
CDEF:sysperc=sysmsec,10,/ \
CDEF:totmperc=usermsec,sysmsec,+,10,/ \
LINE1:totmperc#ffff00:"max cpu use" \
AREA:userperc#ff0000:"user cpu percentage" \
STACK:sysperc#00ff00:"system cpu percentage" \
COMMENT:"\l" \
COMMENT:"System cpu " \
GPRINT:sysperc:AVERAGE:"avg %-3.1lf%%\t" \
GPRINT:sysperc:LAST:"last %-3.1lf%%\t" \
GPRINT:sysperc:MAX:"max %-3.1lf%%\t" \
COMMENT:"\l" \
COMMENT:"User cpu " \
GPRINT:userperc:AVERAGE:"avg %-3.1lf%%\t" \
GPRINT:userperc:LAST:"last %-3.1lf%%\t" \
GPRINT:userperc:MAX:"max %-3.1lf%%" \
COMMENT:"\l"
}
makeGraphs 6h 6h
makeGraphs 24h day
#makeGraphs 7d week
#makeGraphs 1m month
#makeGraphs 1y year
|