| 1 | #!/bin/bash |
|---|
| 2 | WWWPREFIX=. |
|---|
| 3 | WSIZE=800 |
|---|
| 4 | HSIZE=250 |
|---|
| 5 | |
|---|
| 6 | function makeGraphs() |
|---|
| 7 | { |
|---|
| 8 | rrdtool graph --start -$1 $WWWPREFIX/questions-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 9 | -t "Question and answer counts per second" \ |
|---|
| 10 | -v "packets" \ |
|---|
| 11 | DEF:questions=pdns_recursor.rrd:questions:AVERAGE \ |
|---|
| 12 | DEF:nxdomainanswers=pdns_recursor.rrd:nxdomain-answers:AVERAGE \ |
|---|
| 13 | DEF:noerroranswers=pdns_recursor.rrd:noerror-answers:AVERAGE \ |
|---|
| 14 | DEF:servfailanswers=pdns_recursor.rrd:servfail-answers:AVERAGE \ |
|---|
| 15 | LINE2:questions#0000ff:"questions/s"\ |
|---|
| 16 | AREA:noerroranswers#00ff00:"noerror answers/s" \ |
|---|
| 17 | STACK:nxdomainanswers#ffa500:"nxdomain answers/s"\ |
|---|
| 18 | STACK:servfailanswers#ff0000:"servfail answers/s" |
|---|
| 19 | |
|---|
| 20 | rrdtool graph --start -$1 $WWWPREFIX/tcp-questions-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 21 | -t "TCP question and answer counts per second" \ |
|---|
| 22 | -v "packets" \ |
|---|
| 23 | DEF:tcpquestions=pdns_recursor.rrd:tcp-questions:AVERAGE \ |
|---|
| 24 | LINE2:tcpquestions#0000ff:"questions/s"\ |
|---|
| 25 | |
|---|
| 26 | rrdtool graph --start -$1 $WWWPREFIX/latencies-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 27 | -t "Questions answered within latency" \ |
|---|
| 28 | -v "questions" \ |
|---|
| 29 | DEF:questions=pdns_recursor.rrd:questions:AVERAGE \ |
|---|
| 30 | DEF:answers01=pdns_recursor.rrd:answers0-1:AVERAGE \ |
|---|
| 31 | DEF:answers110=pdns_recursor.rrd:answers1-10:AVERAGE \ |
|---|
| 32 | DEF:answers10100=pdns_recursor.rrd:answers10-100:AVERAGE \ |
|---|
| 33 | DEF:answers1001000=pdns_recursor.rrd:answers100-1000:AVERAGE \ |
|---|
| 34 | DEF:answersslow=pdns_recursor.rrd:answers-slow:AVERAGE \ |
|---|
| 35 | LINE2:questions#0000ff:"questions/s" \ |
|---|
| 36 | AREA:answers01#00ff00:"<1 ms" \ |
|---|
| 37 | STACK:answers110#0000ff:"<10 ms" \ |
|---|
| 38 | STACK:answers10100#00ffff:"<100 ms" \ |
|---|
| 39 | STACK:answers1001000#ffff00:"<1000 ms" \ |
|---|
| 40 | STACK:answersslow#ff0000:">1000 ms" |
|---|
| 41 | |
|---|
| 42 | rrdtool graph --start -$1 $WWWPREFIX/qoutq-$2.png -w $WSIZE -h $HSIZE -l 0 \ |
|---|
| 43 | -t "Questions/outqueries counts per second" \ |
|---|
| 44 | -v "packets" \ |
|---|
| 45 | DEF:questions=pdns_recursor.rrd:questions:AVERAGE \ |
|---|
| 46 | DEF:alloutqueries=pdns_recursor.rrd:all-outqueries:AVERAGE \ |
|---|
| 47 | LINE2:questions#ff0000:"questions/s"\ |
|---|
| 48 | LINE2:alloutqueries#00ff00:"outqueries/s" |
|---|
| 49 | |
|---|
| 50 | rrdtool graph --start -$1 $WWWPREFIX/qa-latency-$2.png -w $WSIZE -h $HSIZE -l 0 \ |
|---|
| 51 | -t "Questions/answer latency in milliseconds" \ |
|---|
| 52 | -v "msec" \ |
|---|
| 53 | DEF:qalatency=pdns_recursor.rrd:qa-latency:AVERAGE \ |
|---|
| 54 | CDEF:mqalatency=qalatency,1000,/ \ |
|---|
| 55 | LINE2:mqalatency#ff0000:"questions/s" |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | rrdtool graph --start -$1 $WWWPREFIX/timeouts-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 59 | -t "Outqueries/timeouts counts per second" \ |
|---|
| 60 | -v "events" \ |
|---|
| 61 | DEF:alloutqueries=pdns_recursor.rrd:all-outqueries:AVERAGE \ |
|---|
| 62 | DEF:outgoingtimeouts=pdns_recursor.rrd:outgoing-timeouts:AVERAGE \ |
|---|
| 63 | DEF:throttledout=pdns_recursor.rrd:throttled-out:AVERAGE \ |
|---|
| 64 | LINE2:alloutqueries#ff0000:"outqueries/s"\ |
|---|
| 65 | LINE2:outgoingtimeouts#00ff00:"outgoing timeouts/s"\ |
|---|
| 66 | LINE2:throttledout#0000ff:"throttled outqueries/s" |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | rrdtool graph --start -$1 $WWWPREFIX/caches-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 70 | -t "Cache sizes" \ |
|---|
| 71 | -v "entries" \ |
|---|
| 72 | DEF:cacheentries=pdns_recursor.rrd:cache-entries:AVERAGE \ |
|---|
| 73 | DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE \ |
|---|
| 74 | DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE \ |
|---|
| 75 | DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE \ |
|---|
| 76 | LINE2:cacheentries#ff0000:"cache entries" \ |
|---|
| 77 | LINE2:negcacheentries#0000ff:"negative cache entries" \ |
|---|
| 78 | LINE2:nsspeedsentries#00ff00:"NS speeds entries" \ |
|---|
| 79 | LINE2:throttleentries#00ff00:"throttle map entries" |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | rrdtool graph --start -$1 $WWWPREFIX/caches2-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 83 | -t "Cache sizes" \ |
|---|
| 84 | -v "entries" \ |
|---|
| 85 | DEF:negcacheentries=pdns_recursor.rrd:negcache-entries:AVERAGE \ |
|---|
| 86 | DEF:nsspeedsentries=pdns_recursor.rrd:nsspeeds-entries:AVERAGE \ |
|---|
| 87 | DEF:throttleentries=pdns_recursor.rrd:throttle-entries:AVERAGE \ |
|---|
| 88 | LINE2:negcacheentries#0000ff:"negative cache entries" \ |
|---|
| 89 | LINE2:nsspeedsentries#00ff00:"NS speeds entries" \ |
|---|
| 90 | LINE2:throttleentries#ffa000:"throttle map entries" |
|---|
| 91 | |
|---|
| 92 | rrdtool graph --start -$1 $WWWPREFIX/load-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 93 | -v "MThreads" \ |
|---|
| 94 | -t "Concurrent queries" \ |
|---|
| 95 | DEF:concurrentqueries=pdns_recursor.rrd:concurrent-queries:AVERAGE \ |
|---|
| 96 | LINE2:concurrentqueries#0000ff:"concurrent queries" |
|---|
| 97 | |
|---|
| 98 | rrdtool graph --start -$1 $WWWPREFIX/hitrate-$2.png -w $WSIZE -h $HSIZE -l 0\ |
|---|
| 99 | -v "percentage" \ |
|---|
| 100 | -t "cache hits" \ |
|---|
| 101 | DEF:cachehits=pdns_recursor.rrd:cache-hits:AVERAGE \ |
|---|
| 102 | DEF:cachemisses=pdns_recursor.rrd:cache-misses:AVERAGE \ |
|---|
| 103 | DEF:usermsec=pdns_recursor.rrd:user-msec:AVERAGE \ |
|---|
| 104 | DEF:sysmsec=pdns_recursor.rrd:sys-msec:AVERAGE \ |
|---|
| 105 | DEF:musermsec=pdns_recursor.rrd:user-msec:MAX \ |
|---|
| 106 | DEF:msysmsec=pdns_recursor.rrd:sys-msec:MAX \ |
|---|
| 107 | CDEF:perc=cachehits,100,*,cachehits,cachemisses,+,/ \ |
|---|
| 108 | CDEF:userperc=usermsec,10,/ \ |
|---|
| 109 | CDEF:sysperc=sysmsec,10,/ \ |
|---|
| 110 | CDEF:totmperc=musermsec,msysmsec,+,10,/ \ |
|---|
| 111 | LINE2:perc#0000ff:"percentage cache hits" \ |
|---|
| 112 | LINE2:totmperc#ffff00:"max cpu use" \ |
|---|
| 113 | AREA:userperc#ff0000:"user cpu percentage" \ |
|---|
| 114 | STACK:sysperc#00ff00:"system cpu percentage" \ |
|---|
| 115 | COMMENT:"\l" \ |
|---|
| 116 | COMMENT:"Cache hits " \ |
|---|
| 117 | GPRINT:perc:AVERAGE:"avg %-3.1lf%%\t" \ |
|---|
| 118 | GPRINT:perc:LAST:"last %-3.1lf%%\t" \ |
|---|
| 119 | GPRINT:perc:MAX:"max %-3.1lf%%" \ |
|---|
| 120 | COMMENT:"\l" \ |
|---|
| 121 | COMMENT:"System cpu " \ |
|---|
| 122 | GPRINT:sysperc:AVERAGE:"avg %-3.1lf%%\t" \ |
|---|
| 123 | GPRINT:sysperc:LAST:"last %-3.1lf%%\t" \ |
|---|
| 124 | GPRINT:sysperc:MAX:"max %-3.1lf%%\t" \ |
|---|
| 125 | COMMENT:"\l" \ |
|---|
| 126 | COMMENT:"User cpu " \ |
|---|
| 127 | GPRINT:userperc:AVERAGE:"avg %-3.1lf%%\t" \ |
|---|
| 128 | GPRINT:userperc:LAST:"last %-3.1lf%%\t" \ |
|---|
| 129 | GPRINT:userperc:MAX:"max %-3.1lf%%" |
|---|
| 130 | |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | makeGraphs 6h 6h |
|---|
| 134 | makeGraphs 24h day |
|---|
| 135 | #makeGraphs 7d week |
|---|
| 136 | #makeGraphs 1m month |
|---|
| 137 | #makeGraphs 1y year |
|---|
| 138 | |
|---|
| 139 | |
|---|