-
Notifications
You must be signed in to change notification settings - Fork 108
/
create_graphs.sh
executable file
·259 lines (250 loc) · 7.94 KB
/
create_graphs.sh
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
#!/bin/bash
#
## change directory to the rrdtool script dir
cd /var/www/grafy
TOOL=`which rrdtool`
## Graphs for last 12 hours
## calls
$TOOL graph calls_graph.png \
-w 785 -h 120 -a PNG \
--start -43200 --end now \
--font DEFAULT:7: \
--title "Number of calls" \
--watermark "`date`" \
--vertical-label "calls" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
--full-size-mode \
DEF:callsmin=/var/spool/voipmonitor/rrd/db-callscounter.rrd:calls:MIN \
DEF:callsavg=/var/spool/voipmonitor/rrd/db-callscounter.rrd:calls:AVERAGE \
DEF:callsmax=/var/spool/voipmonitor/rrd/db-callscounter.rrd:calls:MAX \
AREA:callsmax#00FF00:"calls max" \
LINE1:callsavg#0000FF:"Calls avg\t" \
LINE1:callsmin#FF0000:"Calls min\t" \
GPRINT:callsmax:LAST:"Cur\: %5.0lf" \
GPRINT:callsmax:AVERAGE:"Avg\: %5.2lf" \
GPRINT:callsmax:MAX:"Max\: %5.0lf" \
GPRINT:callsmax:MIN:"Min\: %5.0lf\t\t\t"
##DROPS
$TOOL graph drop_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "Dropping packets" \
--watermark "`date`" \
--vertical-label "packets" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:exc=/var/spool/voipmonitor/rrd/db-drop.rrd:exceeded:MAX \
DEF:pck=/var/spool/voipmonitor/rrd/db-drop.rrd:packets:MAX \
LINE1:exc#0000FF:"Buffer overloaded\t" \
GPRINT:exc:LAST:"Cur\: %5.0lf\t" \
GPRINT:exc:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:exc:MAX:"Max\: %5.0lf\t" \
GPRINT:exc:MIN:"Min\: %5.0lf\n" \
LINE1:pck#00FF00:"Packets droped\t" \
GPRINT:pck:LAST:"Cur\: %5.0lf\t" \
GPRINT:pck:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:pck:MAX:"Max\: %5.0lf\t" \
GPRINT:pck:MIN:"Min\: %5.0lf\n"
##HEAP
$TOOL graph heap_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "mem heap usage" \
--watermark "`date`" \
--vertical-label "percent[%]" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:buffer=/var/spool/voipmonitor/rrd/db-heap.rrd:buffer:MAX \
DEF:trash=/var/spool/voipmonitor/rrd/db-heap.rrd:trash:MAX \
DEF:ratio=/var/spool/voipmonitor/rrd/db-heap.rrd:ratio:MAX \
LINE1:buffer#0000FF:"Buffer usage %\t" \
GPRINT:buffer:LAST:"Cur\: %5.2lf\t" \
GPRINT:buffer:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:buffer:MAX:"Max\: %5.2lf\t" \
GPRINT:buffer:MIN:"Min\: %5.2lf\n" \
LINE1:trash#00FF00:"Trash usage %\t" \
GPRINT:trash:LAST:"Cur\: %5.2lf\t" \
GPRINT:trash:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:trash:MAX:"Max\: %5.2lf\t" \
GPRINT:trash:MIN:"Min\: %5.2lf\n" \
LINE1:ratio#FF0000:"Ratio %\t" \
GPRINT:ratio:LAST:"Cur\: %5.2lf\t" \
GPRINT:ratio:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:ratio:MAX:"Max\: %5.2lf\t" \
GPRINT:ratio:MIN:"Min\: %5.2lf\n"
## PS
$TOOL graph PS_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "PS" \
--watermark "`date`" \
--vertical-label "queries" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:PSC=/var/spool/voipmonitor/rrd/db-PS.rrd:PS-C:MAX \
DEF:PSS0=/var/spool/voipmonitor/rrd/db-PS.rrd:PS-S0:MAX \
DEF:PSS1=/var/spool/voipmonitor/rrd/db-PS.rrd:PS-S1:MAX \
DEF:PSR=/var/spool/voipmonitor/rrd/db-PS.rrd:PS-R:MAX \
DEF:PSA=/var/spool/voipmonitor/rrd/db-PS.rrd:PS-A:MAX \
LINE1:PSC#0000FF:"-C\t" \
GPRINT:PSC:LAST:"Cur\: %5.0lf\t" \
GPRINT:PSC:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:PSC:MAX:"Max\: %5.0lf\t" \
GPRINT:PSC:MIN:"Min\: %5.0lf\n" \
LINE1:PSS0#00FF00:"-S0\t" \
GPRINT:PSS0:LAST:"Cur\: %5.0lf\t" \
GPRINT:PSS0:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:PSS0:MAX:"Max\: %5.0lf\t" \
GPRINT:PSS0:MIN:"Min\: %5.0lf\n" \
LINE1:PSS1#FF0000:"-S1\t" \
GPRINT:PSS1:LAST:"Cur\: %5.0lf\t" \
GPRINT:PSS1:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:PSS1:MAX:"Max\: %5.0lf\t" \
GPRINT:PSS1:MIN:"Min\: %5.0lf\n" \
LINE1:PSR#00FFFF:"-R\t" \
GPRINT:PSR:LAST:"Cur\: %5.0lf\t" \
GPRINT:PSR:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:PSR:MAX:"Max\: %5.0lf\t" \
GPRINT:PSR:MIN:"Min\: %5.0lf\n" \
LINE1:PSA#FFFF00:"-H\t" \
GPRINT:PSA:LAST:"Cur\: %5.0lf\t" \
GPRINT:PSA:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:PSA:MAX:"Max\: %5.0lf\t" \
GPRINT:PSA:MIN:"Min\: %5.0lf\n"
## mem usage (memusage)
$TOOL graph memusage_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "RSS VSZ" \
--watermark "`date`" \
--vertical-label "MB" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:rss=/var/spool/voipmonitor/rrd/db-mem.rrd:RSS:MAX \
AREA:rss#0000FF:"Mem Usage RSS\t" \
GPRINT:rss:LAST:"Cur\: %5.0lf\t" \
GPRINT:rss:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:rss:MAX:"Max\: %5.0lf\t" \
GPRINT:rss:MIN:"Min\: %5.0lf\n"
## speed mbs
$TOOL graph speed_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -86400 --end now \
--font DEFAULT:7: \
--title "bw speed" \
--watermark "`date`" \
--vertical-label "Mb/s" \
--lower-limit 0 \
--units-exponent 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
DEF:speed=/var/spool/voipmonitor/rrd/db-speedmbs.rrd:mbs:MAX \
AREA:speed#00FF00:"speed (Mb/s)" \
GPRINT:speed:LAST:"Cur\: %5.2lf" \
GPRINT:speed:AVERAGE:"Avg\: %5.2lf" \
GPRINT:speed:MAX:"Max\: %5.2lf" \
GPRINT:speed:MIN:"Min\: %5.2lf\t\t\t"
## SQLq
$TOOL graph SQLq_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "SQLq" \
--watermark "`date`" \
--vertical-label "queries" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:SQLqC=/var/spool/voipmonitor/rrd/db-SQLq.rrd:SQLq-C:MAX \
DEF:SQLqM=/var/spool/voipmonitor/rrd/db-SQLq.rrd:SQLq-M:MAX \
DEF:SQLqR=/var/spool/voipmonitor/rrd/db-SQLq.rrd:SQLq-R:MAX \
DEF:SQLqCl=/var/spool/voipmonitor/rrd/db-SQLq.rrd:SQLq-Cl:MAX \
DEF:SQLqH=/var/spool/voipmonitor/rrd/db-SQLq.rrd:SQLq-H:MAX \
LINE1:SQLqC#0000FF:"-C\t" \
GPRINT:SQLqC:LAST:"Cur\: %5.0lf\t" \
GPRINT:SQLqC:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:SQLqC:MAX:"Max\: %5.0lf\t" \
GPRINT:SQLqC:MIN:"Min\: %5.0lf\n" \
LINE1:SQLqM#00FF00:"-M\t" \
GPRINT:SQLqM:LAST:"Cur\: %5.0lf\t" \
GPRINT:SQLqM:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:SQLqM:MAX:"Max\: %5.0lf\t" \
GPRINT:SQLqM:MIN:"Min\: %5.0lf\n" \
LINE1:SQLqR#FF0000:"-R\t" \
GPRINT:SQLqR:LAST:"Cur\: %5.0lf\t" \
GPRINT:SQLqR:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:SQLqR:MAX:"Max\: %5.0lf\t" \
GPRINT:SQLqR:MIN:"Min\: %5.0lf\n" \
LINE1:SQLqCl#00FFFF:"-Cl\t" \
GPRINT:SQLqCl:LAST:"Cur\: %5.0lf\t" \
GPRINT:SQLqCl:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:SQLqCl:MAX:"Max\: %5.0lf\t" \
GPRINT:SQLqCl:MIN:"Min\: %5.0lf\n" \
LINE1:SQLqH#FFFF00:"-H\t" \
GPRINT:SQLqH:LAST:"Cur\: %5.0lf\t" \
GPRINT:SQLqH:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:SQLqH:MAX:"Max\: %5.0lf\t" \
GPRINT:SQLqH:MIN:"Min\: %5.0lf\n"
## tacCPU
$TOOL graph tacCPU_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "tac CPU" \
--watermark "`date`" \
--vertical-label "threads" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--y-grid 1:2 \
DEF:tac=/var/spool/voipmonitor/rrd/db-tacCPU.rrd:tacCPU:MAX \
LINE1:tac#0000FF:"Usage" \
GPRINT:tac:LAST:"Cur\: %5.2lf" \
GPRINT:tac:AVERAGE:"Avg\: %5.2lf" \
GPRINT:tac:MAX:"Max\: %5.2lf" \
GPRINT:tac:MIN:"Min\: %5.2lf\t\t\t"
## tCPU
$TOOL graph tCPU_graph.png \
-w 785 -h 120 -a PNG \
--slope-mode \
--start -43200 --end now \
--font DEFAULT:7: \
--title "tCPU usage" \
--watermark "`date`" \
--vertical-label "percent[%]" \
--lower-limit 0 \
--x-grid MINUTE:10:HOUR:1:MINUTE:120:0:%R \
--units-exponent 0 \
DEF:t0=/var/spool/voipmonitor/rrd/db-tCPU.rrd:tCPU-t0:MAX \
DEF:t1=/var/spool/voipmonitor/rrd/db-tCPU.rrd:tCPU-t1:MAX \
DEF:t2=/var/spool/voipmonitor/rrd/db-tCPU.rrd:tCPU-t2:MAX \
LINE1:t0#0000FF:"t0 CPU Usage %\t" \
GPRINT:t0:LAST:"Cur\: %5.2lf\t" \
GPRINT:t0:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:t0:MAX:"Max\: %5.2lf\t" \
GPRINT:t0:MIN:"Min\: %5.2lf\n" \
LINE1:t1#00FF00:"t1 CPU Usage %\t" \
GPRINT:t1:LAST:"Cur\: %5.2lf\t" \
GPRINT:t1:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:t1:MAX:"Max\: %5.2lf\t" \
GPRINT:t1:MIN:"Min\: %5.2lf\n" \
LINE1:t2#FF0000:"t2 CPU Usage %\t" \
GPRINT:t2:LAST:"Cur\: %5.2lf\t" \
GPRINT:t2:AVERAGE:"Avg\: %5.2lf\t" \
GPRINT:t2:MAX:"Max\: %5.2lf\t" \
GPRINT:t2:MIN:"Min\: %5.2lf\n"