root/trunk/pdns/pdns/tools/rrd/makegraphs @ 677

Revision 677, 6.5 KB (checked in by ahu, 7 years ago)

generally spiff up appearance, nothing real

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