10 use Fcntl (qw(:flock));
11 use Carp (qw(carp cluck confess croak));
13 our $Config = read_config ();
21 for (qw(Red Green Blue Yellow Cyan Magenta))
23 $Config->{'Colors'}{"Half$_"} = color_calculate_transparent ($Config->{'Colors'}{'Alpha'},
24 $Config->{'Colors'}{'Canvas'}, $Config->{'Colors'}{"Full$_"});
27 $Config->{'Colors'}{'HalfBlueGreen'} = color_calculate_transparent ($Config->{'Colors'}{'Alpha'},
28 $Config->{'Colors'}{'Canvas'}, $Config->{'Colors'}{'FullGreen'}, $Config->{'Colors'}{'FullBlue'});
29 $Config->{'Colors'}{'HalfRedBlue'} = color_calculate_transparent ($Config->{'Colors'}{'Alpha'},
30 $Config->{'Colors'}{'Canvas'}, $Config->{'Colors'}{'FullBlue'}, $Config->{'Colors'}{'FullRed'});
34 my $Alpha = $Config->{'Colors'}{'Alpha'};
35 my $Canvas = $Config->{'Colors'}{'Canvas'};
37 my $FullRed = $Config->{'Colors'}{'FullRed'};
38 my $FullGreen = $Config->{'Colors'}{'FullGreen'};
39 my $FullBlue = $Config->{'Colors'}{'FullBlue'};
40 my $FullYellow = $Config->{'Colors'}{'FullYellow'};
41 my $FullCyan = $Config->{'Colors'}{'FullCyan'};
42 my $FullMagenta= $Config->{'Colors'}{'FullMagenta'};
44 my $HalfRed = $Config->{'Colors'}{'HalfRed'};
45 my $HalfGreen = $Config->{'Colors'}{'HalfGreen'};
46 my $HalfBlue = $Config->{'Colors'}{'HalfBlue'};
47 my $HalfYellow = $Config->{'Colors'}{'HalfYellow'};
48 my $HalfCyan = $Config->{'Colors'}{'HalfCyan'};
49 my $HalfMagenta= $Config->{'Colors'}{'HalfMagenta'};
51 my $HalfBlueGreen = $Config->{'Colors'}{'HalfBlueGreen'};
52 my $HalfRedBlue = $Config->{'Colors'}{'HalfRedBlue'};
56 apache_bytes => ['DEF:min_raw={file}:count:MIN',
57 'DEF:avg_raw={file}:count:AVERAGE',
58 'DEF:max_raw={file}:count:MAX',
59 'CDEF:min=min_raw,8,*',
60 'CDEF:avg=avg_raw,8,*',
61 'CDEF:max=max_raw,8,*',
62 'CDEF:mytime=avg_raw,TIME,TIME,IF',
63 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
64 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
65 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
66 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
68 "LINE1:avg#$FullBlue:Bit/s",
69 'GPRINT:min:MIN:%5.1lf%s Min,',
70 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
71 'GPRINT:max:MAX:%5.1lf%s Max,',
72 'GPRINT:avg:LAST:%5.1lf%s Last',
73 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
75 apache_requests => ['DEF:min={file}:count:MIN',
76 'DEF:avg={file}:count:AVERAGE',
77 'DEF:max={file}:count:MAX',
80 "LINE1:avg#$FullBlue:Requests/s",
81 'GPRINT:min:MIN:%6.2lf Min,',
82 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
83 'GPRINT:max:MAX:%6.2lf Max,',
84 'GPRINT:avg:LAST:%6.2lf Last'
86 apache_scoreboard => ['DEF:min={file}:count:MIN',
87 'DEF:avg={file}:count:AVERAGE',
88 'DEF:max={file}:count:MAX',
91 "LINE1:avg#$FullBlue:Processes",
92 'GPRINT:min:MIN:%6.2lf Min,',
93 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
94 'GPRINT:max:MAX:%6.2lf Max,',
95 'GPRINT:avg:LAST:%6.2lf Last'
98 'DEF:avg={file}:charge:AVERAGE',
99 'DEF:min={file}:charge:MIN',
100 'DEF:max={file}:charge:MAX',
101 "AREA:max#$HalfBlue",
103 "LINE1:avg#$FullBlue:Charge",
104 'GPRINT:min:MIN:%5.1lf%sAh Min,',
105 'GPRINT:avg:AVERAGE:%5.1lf%sAh Avg,',
106 'GPRINT:max:MAX:%5.1lf%sAh Max,',
107 'GPRINT:avg:LAST:%5.1lf%sAh Last\l'
110 'DEF:avg={file}:percent:AVERAGE',
111 'DEF:min={file}:percent:MIN',
112 'DEF:max={file}:percent:MAX',
113 "AREA:max#$HalfBlue",
115 "LINE1:avg#$FullBlue:Charge",
116 'GPRINT:min:MIN:%5.1lf%s%% Min,',
117 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
118 'GPRINT:max:MAX:%5.1lf%s%% Max,',
119 'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
121 cpu => ['DEF:user_avg={file}:user:AVERAGE',
122 'DEF:user_min={file}:user:MIN',
123 'DEF:user_max={file}:user:MAX',
124 'DEF:nice_avg={file}:nice:AVERAGE',
125 'DEF:nice_min={file}:nice:MIN',
126 'DEF:nice_max={file}:nice:MAX',
127 'DEF:syst_avg={file}:syst:AVERAGE',
128 'DEF:syst_min={file}:syst:MIN',
129 'DEF:syst_max={file}:syst:MAX',
130 'DEF:idle_avg={file}:idle:AVERAGE',
131 'DEF:idle_min={file}:idle:MIN',
132 'DEF:idle_max={file}:idle:MAX',
133 'DEF:wait_avg={file}:wait:AVERAGE',
134 'DEF:wait_min={file}:wait:MIN',
135 'DEF:wait_max={file}:wait:MAX',
136 'CDEF:user_avg_notnull=user_avg,UN,0,user_avg,IF',
137 'CDEF:nice_avg_notnull=nice_avg,UN,0,nice_avg,IF',
138 'CDEF:syst_avg_notnull=syst_avg,UN,0,syst_avg,IF',
139 'CDEF:idle_avg_notnull=idle_avg,UN,0,idle_avg,IF',
140 'CDEF:wait_avg_notnull=wait_avg,UN,0,wait_avg,IF',
141 'CDEF:totl_avg_notnull=user_avg_notnull,nice_avg_notnull,+,syst_avg_notnull,+,idle_avg_notnull,+,wait_avg_notnull,+',
142 'CDEF:user_avg_pct=user_avg_notnull,100,*,totl_avg_notnull,/',
143 'CDEF:nice_avg_pct=nice_avg_notnull,100,*,totl_avg_notnull,/',
144 'CDEF:syst_avg_pct=syst_avg_notnull,100,*,totl_avg_notnull,/',
145 'CDEF:wait_avg_pct=wait_avg_notnull,100,*,totl_avg_notnull,/',
146 'CDEF:nice_acc=syst_avg_pct,wait_avg_pct,user_avg_pct,nice_avg_pct,+,+,+',
147 'CDEF:user_acc=syst_avg_pct,wait_avg_pct,user_avg_pct,+,+',
148 'CDEF:wait_acc=syst_avg_pct,wait_avg_pct,+',
149 'CDEF:syst_acc=syst_avg_pct',
150 # 'CDEF:nice_acc=syst_avg_notnull,wait_avg_notnull,user_avg_notnull,nice_avg_notnull,+,+,+',
151 # 'CDEF:user_acc=syst_avg_notnull,wait_avg_notnull,user_avg_notnull,+,+',
152 # 'CDEF:wait_acc=syst_avg_notnull,wait_avg_notnull,+',
153 # 'CDEF:syst_acc=syst_avg_notnull',
154 "AREA:nice_acc#$HalfGreen",
155 "AREA:user_acc#$HalfBlue",
156 "AREA:wait_acc#$HalfYellow",
157 "AREA:syst_acc#$HalfRed",
158 "LINE1:nice_acc#$FullGreen:Nice ",
159 'GPRINT:nice_min:MIN:%5.1lf%% Min,',
160 'GPRINT:nice_avg:AVERAGE:%5.1lf%% Avg,',
161 'GPRINT:nice_max:MAX:%5.1lf%% Max,',
162 'GPRINT:nice_avg:LAST:%5.1lf%% Last\l',
163 "LINE1:user_acc#$FullBlue:User ",
164 'GPRINT:user_min:MIN:%5.1lf%% Min,',
165 'GPRINT:user_avg:AVERAGE:%5.1lf%% Avg,',
166 'GPRINT:user_max:MAX:%5.1lf%% Max,',
167 'GPRINT:user_avg:LAST:%5.1lf%% Last\l',
168 "LINE1:wait_acc#$FullYellow:Wait-IO",
169 'GPRINT:wait_min:MIN:%5.1lf%% Min,',
170 'GPRINT:wait_avg:AVERAGE:%5.1lf%% Avg,',
171 'GPRINT:wait_max:MAX:%5.1lf%% Max,',
172 'GPRINT:wait_avg:LAST:%5.1lf%% Last\l',
173 "LINE1:syst_acc#$FullRed:System ",
174 'GPRINT:syst_min:MIN:%5.1lf%% Min,',
175 'GPRINT:syst_avg:AVERAGE:%5.1lf%% Avg,',
176 'GPRINT:syst_max:MAX:%5.1lf%% Max,',
177 'GPRINT:syst_avg:LAST:%5.1lf%% Last\l'
180 'DEF:avg={file}:current:AVERAGE',
181 'DEF:min={file}:current:MIN',
182 'DEF:max={file}:current:MAX',
183 "AREA:max#$HalfBlue",
185 "LINE1:avg#$FullBlue:Current",
186 'GPRINT:min:MIN:%5.1lf%sA Min,',
187 'GPRINT:avg:AVERAGE:%5.1lf%sA Avg,',
188 'GPRINT:max:MAX:%5.1lf%sA Max,',
189 'GPRINT:avg:LAST:%5.1lf%sA Last\l'
192 'DEF:free_avg={file}:free:AVERAGE',
193 'DEF:free_min={file}:free:MIN',
194 'DEF:free_max={file}:free:MAX',
195 'DEF:used_avg={file}:used:AVERAGE',
196 'DEF:used_min={file}:used:MIN',
197 'DEF:used_max={file}:used:MAX',
198 'CDEF:total=free_avg,used_avg,+',
199 'CDEF:free_pct=100,free_avg,*,total,/',
200 'CDEF:used_pct=100,used_avg,*,total,/',
201 'CDEF:free_acc=free_pct,used_pct,+',
202 'CDEF:used_acc=used_pct',
203 "AREA:free_acc#$HalfGreen",
204 "AREA:used_acc#$HalfRed",
205 "LINE1:free_acc#$FullGreen:Free",
206 'GPRINT:free_min:MIN:%5.1lf%sB Min,',
207 'GPRINT:free_avg:AVERAGE:%5.1lf%sB Avg,',
208 'GPRINT:free_max:MAX:%5.1lf%sB Max,',
209 'GPRINT:free_avg:LAST:%5.1lf%sB Last\l',
210 "LINE1:used_acc#$FullRed:Used",
211 'GPRINT:used_min:MIN:%5.1lf%sB Min,',
212 'GPRINT:used_avg:AVERAGE:%5.1lf%sB Avg,',
213 'GPRINT:used_max:MAX:%5.1lf%sB Max,',
214 'GPRINT:used_avg:LAST:%5.1lf%sB Last\l'
217 'DEF:rtime_avg={file}:rtime:AVERAGE',
218 'DEF:rtime_min={file}:rtime:MIN',
219 'DEF:rtime_max={file}:rtime:MAX',
220 'DEF:wtime_avg={file}:wtime:AVERAGE',
221 'DEF:wtime_min={file}:wtime:MIN',
222 'DEF:wtime_max={file}:wtime:MAX',
223 'CDEF:rtime_avg_ms=rtime_avg,1000,/',
224 'CDEF:rtime_min_ms=rtime_min,1000,/',
225 'CDEF:rtime_max_ms=rtime_max,1000,/',
226 'CDEF:wtime_avg_ms=wtime_avg,1000,/',
227 'CDEF:wtime_min_ms=wtime_min,1000,/',
228 'CDEF:wtime_max_ms=wtime_max,1000,/',
229 'CDEF:total_avg_ms=rtime_avg_ms,wtime_avg_ms,+',
230 'CDEF:total_min_ms=rtime_min_ms,wtime_min_ms,+',
231 'CDEF:total_max_ms=rtime_max_ms,wtime_max_ms,+',
232 "AREA:total_max_ms#$HalfRed",
233 "AREA:total_min_ms#$Canvas",
234 "LINE1:wtime_avg_ms#$FullGreen:Write",
235 'GPRINT:wtime_min_ms:MIN:%5.1lf%s Min,',
236 'GPRINT:wtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
237 'GPRINT:wtime_max_ms:MAX:%5.1lf%s Max,',
238 'GPRINT:wtime_avg_ms:LAST:%5.1lf%s Last\n',
239 "LINE1:rtime_avg_ms#$FullBlue:Read ",
240 'GPRINT:rtime_min_ms:MIN:%5.1lf%s Min,',
241 'GPRINT:rtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
242 'GPRINT:rtime_max_ms:MAX:%5.1lf%s Max,',
243 'GPRINT:rtime_avg_ms:LAST:%5.1lf%s Last\n',
244 "LINE1:total_avg_ms#$FullRed:Total",
245 'GPRINT:total_min_ms:MIN:%5.1lf%s Min,',
246 'GPRINT:total_avg_ms:AVERAGE:%5.1lf%s Avg,',
247 'GPRINT:total_max_ms:MAX:%5.1lf%s Max,',
248 'GPRINT:total_avg_ms:LAST:%5.1lf%s Last'
250 dns_traffic => ['DEF:rsp_min_raw={file}:responses:MIN',
251 'DEF:rsp_avg_raw={file}:responses:AVERAGE',
252 'DEF:rsp_max_raw={file}:responses:MAX',
253 'DEF:qry_min_raw={file}:queries:MIN',
254 'DEF:qry_avg_raw={file}:queries:AVERAGE',
255 'DEF:qry_max_raw={file}:queries:MAX',
256 'CDEF:rsp_min=rsp_min_raw,8,*',
257 'CDEF:rsp_avg=rsp_avg_raw,8,*',
258 'CDEF:rsp_max=rsp_max_raw,8,*',
259 'CDEF:qry_min=qry_min_raw,8,*',
260 'CDEF:qry_avg=qry_avg_raw,8,*',
261 'CDEF:qry_max=qry_max_raw,8,*',
262 'CDEF:overlap=rsp_avg,qry_avg,GT,qry_avg,rsp_avg,IF',
263 'CDEF:mytime=rsp_avg_raw,TIME,TIME,IF',
264 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
265 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
266 'CDEF:rsp_avg_sample=rsp_avg_raw,UN,0,rsp_avg_raw,IF,sample_len,*',
267 'CDEF:rsp_avg_sum=PREV,UN,0,PREV,IF,rsp_avg_sample,+',
268 'CDEF:qry_avg_sample=qry_avg_raw,UN,0,qry_avg_raw,IF,sample_len,*',
269 'CDEF:qry_avg_sum=PREV,UN,0,PREV,IF,qry_avg_sample,+',
270 "AREA:rsp_avg#$HalfGreen",
271 "AREA:qry_avg#$HalfBlue",
272 "AREA:overlap#$HalfBlueGreen",
273 "LINE1:rsp_avg#$FullGreen:Responses",
274 'GPRINT:rsp_avg:AVERAGE:%5.1lf%s Avg,',
275 'GPRINT:rsp_max:MAX:%5.1lf%s Max,',
276 'GPRINT:rsp_avg:LAST:%5.1lf%s Last',
277 'GPRINT:rsp_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
278 "LINE1:qry_avg#$FullBlue:Queries ",
279 #'GPRINT:qry_min:MIN:%5.1lf %s Min,',
280 'GPRINT:qry_avg:AVERAGE:%5.1lf%s Avg,',
281 'GPRINT:qry_max:MAX:%5.1lf%s Max,',
282 'GPRINT:qry_avg:LAST:%5.1lf%s Last',
283 'GPRINT:qry_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
286 'DEF:temp_avg={file}:value:AVERAGE',
287 'DEF:temp_min={file}:value:MIN',
288 'DEF:temp_max={file}:value:MAX',
289 "AREA:temp_max#$HalfMagenta",
290 "AREA:temp_min#$Canvas",
291 "LINE1:temp_avg#$FullMagenta:RPM",
292 'GPRINT:temp_min:MIN:%4.1lf Min,',
293 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
294 'GPRINT:temp_max:MAX:%4.1lf Max,',
295 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
297 frequency_offset => [ # NTPd
298 'DEF:ppm_avg={file}:ppm:AVERAGE',
299 'DEF:ppm_min={file}:ppm:MIN',
300 'DEF:ppm_max={file}:ppm:MAX',
301 "AREA:ppm_max#$HalfBlue",
302 "AREA:ppm_min#$Canvas",
303 "LINE1:ppm_avg#$FullBlue:{inst}",
304 'GPRINT:ppm_min:MIN:%5.2lf Min,',
305 'GPRINT:ppm_avg:AVERAGE:%5.2lf Avg,',
306 'GPRINT:ppm_max:MAX:%5.2lf Max,',
307 'GPRINT:ppm_avg:LAST:%5.2lf Last'
310 'DEF:temp_avg={file}:value:AVERAGE',
311 'DEF:temp_min={file}:value:MIN',
312 'DEF:temp_max={file}:value:MAX',
313 "AREA:temp_max#$HalfRed",
314 "AREA:temp_min#$Canvas",
315 "LINE1:temp_avg#$FullRed:Temperature",
316 'GPRINT:temp_min:MIN:%4.1lf Min,',
317 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
318 'GPRINT:temp_max:MAX:%4.1lf Max,',
319 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
321 if_packets => ['DEF:tx_min={file}:tx:MIN',
322 'DEF:tx_avg={file}:tx:AVERAGE',
323 'DEF:tx_max={file}:tx:MAX',
324 'DEF:rx_min={file}:rx:MIN',
325 'DEF:rx_avg={file}:rx:AVERAGE',
326 'DEF:rx_max={file}:rx:MAX',
327 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
328 'CDEF:mytime=tx_avg,TIME,TIME,IF',
329 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
330 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
331 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
332 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
333 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
334 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
335 "AREA:tx_avg#$HalfGreen",
336 "AREA:rx_avg#$HalfBlue",
337 "AREA:overlap#$HalfBlueGreen",
338 "LINE1:tx_avg#$FullGreen:TX",
339 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
340 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
341 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
342 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
343 "LINE1:rx_avg#$FullBlue:RX",
344 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
345 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
346 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
347 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
348 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
350 load => ['DEF:s_avg={file}:shortterm:AVERAGE',
351 'DEF:s_min={file}:shortterm:MIN',
352 'DEF:s_max={file}:shortterm:MAX',
353 'DEF:m_avg={file}:midterm:AVERAGE',
354 'DEF:m_min={file}:midterm:MIN',
355 'DEF:m_max={file}:midterm:MAX',
356 'DEF:l_avg={file}:longterm:AVERAGE',
357 'DEF:l_min={file}:longterm:MIN',
358 'DEF:l_max={file}:longterm:MAX',
359 "AREA:s_max#$HalfGreen",
360 "AREA:s_min#$Canvas",
361 "LINE1:s_avg#$FullGreen: 1m average",
362 'GPRINT:s_min:MIN:%4.2lf Min,',
363 'GPRINT:s_avg:AVERAGE:%4.2lf Avg,',
364 'GPRINT:s_max:MAX:%4.2lf Max,',
365 'GPRINT:s_avg:LAST:%4.2lf Last\n',
366 "LINE1:m_avg#$FullBlue: 5m average",
367 'GPRINT:m_min:MIN:%4.2lf Min,',
368 'GPRINT:m_avg:AVERAGE:%4.2lf Avg,',
369 'GPRINT:m_max:MAX:%4.2lf Max,',
370 'GPRINT:m_avg:LAST:%4.2lf Last\n',
371 "LINE1:l_avg#$FullRed:15m average",
372 'GPRINT:l_min:MIN:%4.2lf Min,',
373 'GPRINT:l_avg:AVERAGE:%4.2lf Avg,',
374 'GPRINT:l_max:MAX:%4.2lf Max,',
375 'GPRINT:l_avg:LAST:%4.2lf Last'
378 'DEF:avg={file}:percent:AVERAGE',
379 'DEF:min={file}:percent:MIN',
380 'DEF:max={file}:percent:MAX',
381 "AREA:max#$HalfBlue",
383 "LINE1:avg#$FullBlue:Load",
384 'GPRINT:min:MIN:%5.1lf%s%% Min,',
385 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
386 'GPRINT:max:MAX:%5.1lf%s%% Max,',
387 'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
389 mails => ['DEF:rawgood={file}:good:AVERAGE',
390 'DEF:rawspam={file}:spam:AVERAGE',
391 'CDEF:good=rawgood,UN,0,rawgood,IF',
392 'CDEF:spam=rawspam,UN,0,rawspam,IF',
393 'CDEF:negspam=spam,-1,*',
394 "AREA:good#$HalfGreen",
395 "LINE1:good#$FullGreen:Good mails",
396 'GPRINT:good:AVERAGE:%4.1lf Avg,',
397 'GPRINT:good:MAX:%4.1lf Max,',
398 'GPRINT:good:LAST:%4.1lf Last\n',
399 "AREA:negspam#$HalfRed",
400 "LINE1:negspam#$FullRed:Spam mails",
401 'GPRINT:spam:AVERAGE:%4.1lf Avg,',
402 'GPRINT:spam:MAX:%4.1lf Max,',
403 'GPRINT:spam:LAST:%4.1lf Last',
406 'DEF:used_avg={file}:used:AVERAGE',
407 'DEF:free_avg={file}:free:AVERAGE',
408 'DEF:buffers_avg={file}:buffers:AVERAGE',
409 'DEF:cached_avg={file}:cached:AVERAGE',
410 'DEF:used_min={file}:used:MIN',
411 'DEF:free_min={file}:free:MIN',
412 'DEF:buffers_min={file}:buffers:MIN',
413 'DEF:cached_min={file}:cached:MIN',
414 'DEF:used_max={file}:used:MAX',
415 'DEF:free_max={file}:free:MAX',
416 'DEF:buffers_max={file}:buffers:MAX',
417 'DEF:cached_max={file}:cached:MAX',
418 'CDEF:cached_avg_nn=cached_avg,UN,0,cached_avg,IF',
419 'CDEF:buffers_avg_nn=buffers_avg,UN,0,buffers_avg,IF',
420 'CDEF:free_cached_buffers_used=free_avg,cached_avg_nn,+,buffers_avg_nn,+,used_avg,+',
421 'CDEF:cached_buffers_used=cached_avg,buffers_avg_nn,+,used_avg,+',
422 'CDEF:buffers_used=buffers_avg,used_avg,+',
423 "AREA:free_cached_buffers_used#$HalfGreen",
424 "AREA:cached_buffers_used#$HalfBlue",
425 "AREA:buffers_used#$HalfYellow",
426 "AREA:used_avg#$HalfRed",
427 "LINE1:free_cached_buffers_used#$FullGreen:Free ",
428 'GPRINT:free_min:MIN:%5.1lf%s Min,',
429 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
430 'GPRINT:free_max:MAX:%5.1lf%s Max,',
431 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
432 "LINE1:cached_buffers_used#$FullBlue:Page cache ",
433 'GPRINT:cached_min:MIN:%5.1lf%s Min,',
434 'GPRINT:cached_avg:AVERAGE:%5.1lf%s Avg,',
435 'GPRINT:cached_max:MAX:%5.1lf%s Max,',
436 'GPRINT:cached_avg:LAST:%5.1lf%s Last\n',
437 "LINE1:buffers_used#$FullYellow:Buffer cache",
438 'GPRINT:buffers_min:MIN:%5.1lf%s Min,',
439 'GPRINT:buffers_avg:AVERAGE:%5.1lf%s Avg,',
440 'GPRINT:buffers_max:MAX:%5.1lf%s Max,',
441 'GPRINT:buffers_avg:LAST:%5.1lf%s Last\n',
442 "LINE1:used_avg#$FullRed:Used ",
443 'GPRINT:used_min:MIN:%5.1lf%s Min,',
444 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
445 'GPRINT:used_max:MAX:%5.1lf%s Max,',
446 'GPRINT:used_avg:LAST:%5.1lf%s Last'
449 "DEF:val_avg={file}:value:AVERAGE",
450 "DEF:val_min={file}:value:MIN",
451 "DEF:val_max={file}:value:MAX",
452 "AREA:val_max#$HalfBlue",
453 "AREA:val_min#$Canvas",
454 "LINE1:val_avg#$FullBlue:{inst}",
455 'GPRINT:val_min:MIN:%5.2lf Min,',
456 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
457 'GPRINT:val_max:MAX:%5.2lf Max,',
458 'GPRINT:val_avg:LAST:%5.2lf Last'
461 "DEF:val_avg={file}:value:AVERAGE",
462 "DEF:val_min={file}:value:MIN",
463 "DEF:val_max={file}:value:MAX",
464 "AREA:val_max#$HalfBlue",
465 "AREA:val_min#$Canvas",
466 "LINE1:val_avg#$FullBlue:{inst}",
467 'GPRINT:val_min:MIN:%5.2lf Min,',
468 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
469 'GPRINT:val_max:MAX:%5.2lf Max,',
470 'GPRINT:val_avg:LAST:%5.2lf Last'
473 "DEF:hits_min={file}:hits:MIN",
474 "DEF:hits_avg={file}:hits:AVERAGE",
475 "DEF:hits_max={file}:hits:MAX",
476 "DEF:inserts_min={file}:inserts:MIN",
477 "DEF:inserts_avg={file}:inserts:AVERAGE",
478 "DEF:inserts_max={file}:inserts:MAX",
479 "DEF:not_cached_min={file}:not_cached:MIN",
480 "DEF:not_cached_avg={file}:not_cached:AVERAGE",
481 "DEF:not_cached_max={file}:not_cached:MAX",
482 "DEF:lowmem_prunes_min={file}:lowmem_prunes:MIN",
483 "DEF:lowmem_prunes_avg={file}:lowmem_prunes:AVERAGE",
484 "DEF:lowmem_prunes_max={file}:lowmem_prunes:MAX",
485 "DEF:queries_min={file}:queries_in_cache:MIN",
486 "DEF:queries_avg={file}:queries_in_cache:AVERAGE",
487 "DEF:queries_max={file}:queries_in_cache:MAX",
488 "CDEF:unknown=queries_avg,UNKN,+",
489 "CDEF:not_cached_agg=hits_avg,inserts_avg,+,not_cached_avg,+",
490 "CDEF:inserts_agg=hits_avg,inserts_avg,+",
491 "CDEF:hits_agg=hits_avg",
492 "AREA:not_cached_agg#$HalfYellow",
493 "AREA:inserts_agg#$HalfBlue",
494 "AREA:hits_agg#$HalfGreen",
495 "LINE1:not_cached_agg#$FullYellow:Not Cached ",
496 'GPRINT:not_cached_min:MIN:%5.2lf Min,',
497 'GPRINT:not_cached_avg:AVERAGE:%5.2lf Avg,',
498 'GPRINT:not_cached_max:MAX:%5.2lf Max,',
499 'GPRINT:not_cached_avg:LAST:%5.2lf Last\l',
500 "LINE1:inserts_agg#$FullBlue:Inserts ",
501 'GPRINT:inserts_min:MIN:%5.2lf Min,',
502 'GPRINT:inserts_avg:AVERAGE:%5.2lf Avg,',
503 'GPRINT:inserts_max:MAX:%5.2lf Max,',
504 'GPRINT:inserts_avg:LAST:%5.2lf Last\l',
505 "LINE1:hits_agg#$FullGreen:Hits ",
506 'GPRINT:hits_min:MIN:%5.2lf Min,',
507 'GPRINT:hits_avg:AVERAGE:%5.2lf Avg,',
508 'GPRINT:hits_max:MAX:%5.2lf Max,',
509 'GPRINT:hits_avg:LAST:%5.2lf Last\l',
510 "LINE1:lowmem_prunes_avg#$FullRed:Lowmem Prunes ",
511 'GPRINT:lowmem_prunes_min:MIN:%5.2lf Min,',
512 'GPRINT:lowmem_prunes_avg:AVERAGE:%5.2lf Avg,',
513 'GPRINT:lowmem_prunes_max:MAX:%5.2lf Max,',
514 'GPRINT:lowmem_prunes_avg:LAST:%5.2lf Last\l',
515 "LINE1:unknown#$Canvas:Queries in cache",
516 'GPRINT:queries_min:MIN:%5.0lf Min,',
517 'GPRINT:queries_avg:AVERAGE:%5.0lf Avg,',
518 'GPRINT:queries_max:MAX:%5.0lf Max,',
519 'GPRINT:queries_avg:LAST:%5.0lf Last\l'
522 "DEF:running_min={file}:running:MIN",
523 "DEF:running_avg={file}:running:AVERAGE",
524 "DEF:running_max={file}:running:MAX",
525 "DEF:connected_min={file}:connected:MIN",
526 "DEF:connected_avg={file}:connected:AVERAGE",
527 "DEF:connected_max={file}:connected:MAX",
528 "DEF:cached_min={file}:cached:MIN",
529 "DEF:cached_avg={file}:cached:AVERAGE",
530 "DEF:cached_max={file}:cached:MAX",
531 "DEF:created_min={file}:created:MIN",
532 "DEF:created_avg={file}:created:AVERAGE",
533 "DEF:created_max={file}:created:MAX",
534 "CDEF:unknown=created_avg,UNKN,+",
535 "CDEF:cached_agg=connected_avg,cached_avg,+",
536 "AREA:cached_agg#$HalfGreen",
537 "AREA:connected_avg#$HalfBlue",
538 "AREA:running_avg#$HalfRed",
539 "LINE1:cached_agg#$FullGreen:Cached ",
540 'GPRINT:cached_min:MIN:%5.1lf Min,',
541 'GPRINT:cached_avg:AVERAGE:%5.1lf Avg,',
542 'GPRINT:cached_max:MAX:%5.1lf Max,',
543 'GPRINT:cached_avg:LAST:%5.1lf Last\l',
544 "LINE1:connected_avg#$FullBlue:Connected",
545 'GPRINT:connected_min:MIN:%5.1lf Min,',
546 'GPRINT:connected_avg:AVERAGE:%5.1lf Avg,',
547 'GPRINT:connected_max:MAX:%5.1lf Max,',
548 'GPRINT:connected_avg:LAST:%5.1lf Last\l',
549 "LINE1:running_avg#$FullRed:Running ",
550 'GPRINT:running_min:MIN:%5.1lf Min,',
551 'GPRINT:running_avg:AVERAGE:%5.1lf Avg,',
552 'GPRINT:running_max:MAX:%5.1lf Max,',
553 'GPRINT:running_avg:LAST:%5.1lf Last\l',
554 "LINE1:unknown#$Canvas:Created ",
555 'GPRINT:created_min:MIN:%5.0lf Min,',
556 'GPRINT:created_avg:AVERAGE:%5.0lf Avg,',
557 'GPRINT:created_max:MAX:%5.0lf Max,',
558 'GPRINT:created_avg:LAST:%5.0lf Last\l'
561 "DEF:null_avg={file}:null:AVERAGE",
562 "DEF:getattr_avg={file}:getattr:AVERAGE",
563 "DEF:setattr_avg={file}:setattr:AVERAGE",
564 "DEF:lookup_avg={file}:lookup:AVERAGE",
565 "DEF:access_avg={file}:access:AVERAGE",
566 "DEF:readlink_avg={file}:readlink:AVERAGE",
567 "DEF:read_avg={file}:read:AVERAGE",
568 "DEF:write_avg={file}:write:AVERAGE",
569 "DEF:create_avg={file}:create:AVERAGE",
570 "DEF:mkdir_avg={file}:mkdir:AVERAGE",
571 "DEF:symlink_avg={file}:symlink:AVERAGE",
572 "DEF:mknod_avg={file}:mknod:AVERAGE",
573 "DEF:remove_avg={file}:remove:AVERAGE",
574 "DEF:rmdir_avg={file}:rmdir:AVERAGE",
575 "DEF:rename_avg={file}:rename:AVERAGE",
576 "DEF:link_avg={file}:link:AVERAGE",
577 "DEF:readdir_avg={file}:readdir:AVERAGE",
578 "DEF:readdirplus_avg={file}:readdirplus:AVERAGE",
579 "DEF:fsstat_avg={file}:fsstat:AVERAGE",
580 "DEF:fsinfo_avg={file}:fsinfo:AVERAGE",
581 "DEF:pathconf_avg={file}:pathconf:AVERAGE",
582 "DEF:commit_avg={file}:commit:AVERAGE",
583 "DEF:null_max={file}:null:MAX",
584 "DEF:getattr_max={file}:getattr:MAX",
585 "DEF:setattr_max={file}:setattr:MAX",
586 "DEF:lookup_max={file}:lookup:MAX",
587 "DEF:access_max={file}:access:MAX",
588 "DEF:readlink_max={file}:readlink:MAX",
589 "DEF:read_max={file}:read:MAX",
590 "DEF:write_max={file}:write:MAX",
591 "DEF:create_max={file}:create:MAX",
592 "DEF:mkdir_max={file}:mkdir:MAX",
593 "DEF:symlink_max={file}:symlink:MAX",
594 "DEF:mknod_max={file}:mknod:MAX",
595 "DEF:remove_max={file}:remove:MAX",
596 "DEF:rmdir_max={file}:rmdir:MAX",
597 "DEF:rename_max={file}:rename:MAX",
598 "DEF:link_max={file}:link:MAX",
599 "DEF:readdir_max={file}:readdir:MAX",
600 "DEF:readdirplus_max={file}:readdirplus:MAX",
601 "DEF:fsstat_max={file}:fsstat:MAX",
602 "DEF:fsinfo_max={file}:fsinfo:MAX",
603 "DEF:pathconf_max={file}:pathconf:MAX",
604 "DEF:commit_max={file}:commit:MAX",
605 "CDEF:other_avg=null_avg,readlink_avg,create_avg,mkdir_avg,symlink_avg,mknod_avg,remove_avg,rmdir_avg,rename_avg,link_avg,readdir_avg,readdirplus_avg,fsstat_avg,fsinfo_avg,pathconf_avg,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
606 "CDEF:other_max=null_max,readlink_max,create_max,mkdir_max,symlink_max,mknod_max,remove_max,rmdir_max,rename_max,link_max,readdir_max,readdirplus_max,fsstat_max,fsinfo_max,pathconf_max,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
607 "CDEF:stack_read=read_avg",
608 "CDEF:stack_getattr=stack_read,getattr_avg,+",
609 "CDEF:stack_access=stack_getattr,access_avg,+",
610 "CDEF:stack_lookup=stack_access,lookup_avg,+",
611 "CDEF:stack_write=stack_lookup,write_avg,+",
612 "CDEF:stack_commit=stack_write,commit_avg,+",
613 "CDEF:stack_setattr=stack_commit,setattr_avg,+",
614 "CDEF:stack_other=stack_setattr,other_avg,+",
615 "AREA:stack_other#$HalfRed",
616 "AREA:stack_setattr#$HalfGreen",
617 "AREA:stack_commit#$HalfYellow",
618 "AREA:stack_write#$HalfGreen",
619 "AREA:stack_lookup#$HalfBlue",
620 "AREA:stack_access#$HalfMagenta",
621 "AREA:stack_getattr#$HalfCyan",
622 "AREA:stack_read#$HalfBlue",
623 "LINE1:stack_other#$FullRed:Other ",
624 'GPRINT:other_max:MAX:%5.1lf Max,',
625 'GPRINT:other_avg:AVERAGE:%5.1lf Avg,',
626 'GPRINT:other_avg:LAST:%5.1lf Last\l',
627 "LINE1:stack_setattr#$FullGreen:setattr",
628 'GPRINT:setattr_max:MAX:%5.1lf Max,',
629 'GPRINT:setattr_avg:AVERAGE:%5.1lf Avg,',
630 'GPRINT:setattr_avg:LAST:%5.1lf Last\l',
631 "LINE1:stack_commit#$FullYellow:commit ",
632 'GPRINT:commit_max:MAX:%5.1lf Max,',
633 'GPRINT:commit_avg:AVERAGE:%5.1lf Avg,',
634 'GPRINT:commit_avg:LAST:%5.1lf Last\l',
635 "LINE1:stack_write#$FullGreen:write ",
636 'GPRINT:write_max:MAX:%5.1lf Max,',
637 'GPRINT:write_avg:AVERAGE:%5.1lf Avg,',
638 'GPRINT:write_avg:LAST:%5.1lf Last\l',
639 "LINE1:stack_lookup#$FullBlue:lookup ",
640 'GPRINT:lookup_max:MAX:%5.1lf Max,',
641 'GPRINT:lookup_avg:AVERAGE:%5.1lf Avg,',
642 'GPRINT:lookup_avg:LAST:%5.1lf Last\l',
643 "LINE1:stack_access#$FullMagenta:access ",
644 'GPRINT:access_max:MAX:%5.1lf Max,',
645 'GPRINT:access_avg:AVERAGE:%5.1lf Avg,',
646 'GPRINT:access_avg:LAST:%5.1lf Last\l',
647 "LINE1:stack_getattr#$FullCyan:getattr",
648 'GPRINT:getattr_max:MAX:%5.1lf Max,',
649 'GPRINT:getattr_avg:AVERAGE:%5.1lf Avg,',
650 'GPRINT:getattr_avg:LAST:%5.1lf Last\l',
651 "LINE1:stack_read#$FullBlue:read ",
652 'GPRINT:read_max:MAX:%5.1lf Max,',
653 'GPRINT:read_avg:AVERAGE:%5.1lf Avg,',
654 'GPRINT:read_avg:LAST:%5.1lf Last\l'
657 'DEF:avg={file}:value:AVERAGE',
658 'DEF:min={file}:value:MIN',
659 'DEF:max={file}:value:MAX',
660 "AREA:max#$HalfBlue",
662 "LINE1:avg#$FullBlue:Queries/s",
663 'GPRINT:min:MIN:%9.3lf Min,',
664 'GPRINT:avg:AVERAGE:%9.3lf Average,',
665 'GPRINT:max:MAX:%9.3lf Max,',
666 'GPRINT:avg:LAST:%9.3lf Last\l'
669 "DEF:rbyte_avg={file}:rbytes:AVERAGE",
670 "DEF:rbyte_min={file}:rbytes:MIN",
671 "DEF:rbyte_max={file}:rbytes:MAX",
672 "DEF:wbyte_avg={file}:wbytes:AVERAGE",
673 "DEF:wbyte_min={file}:wbytes:MIN",
674 "DEF:wbyte_max={file}:wbytes:MAX",
675 'CDEF:overlap=wbyte_avg,rbyte_avg,GT,rbyte_avg,wbyte_avg,IF',
676 "AREA:wbyte_avg#$HalfGreen",
677 "AREA:rbyte_avg#$HalfBlue",
678 "AREA:overlap#$HalfBlueGreen",
679 "LINE1:wbyte_avg#$FullGreen:Write",
680 'GPRINT:wbyte_min:MIN:%5.1lf%s Min,',
681 'GPRINT:wbyte_avg:AVERAGE:%5.1lf%s Avg,',
682 'GPRINT:wbyte_max:MAX:%5.1lf%s Max,',
683 'GPRINT:wbyte_avg:LAST:%5.1lf%s Last\l',
684 "LINE1:rbyte_avg#$FullBlue:Read ",
685 'GPRINT:rbyte_min:MIN:%5.1lf%s Min,',
686 'GPRINT:rbyte_avg:AVERAGE:%5.1lf%s Avg,',
687 'GPRINT:rbyte_max:MAX:%5.1lf%s Max,',
688 'GPRINT:rbyte_avg:LAST:%5.1lf%s Last\l'
690 ping => ['DEF:ping_avg={file}:ping:AVERAGE',
691 'DEF:ping_min={file}:ping:MIN',
692 'DEF:ping_max={file}:ping:MAX',
693 "AREA:ping_max#$HalfBlue",
694 "AREA:ping_min#$Canvas",
695 "LINE1:ping_avg#$FullBlue:Ping",
696 'GPRINT:ping_min:MIN:%4.1lf ms Min,',
697 'GPRINT:ping_avg:AVERAGE:%4.1lf ms Avg,',
698 'GPRINT:ping_max:MAX:%4.1lf ms Max,',
699 'GPRINT:ping_avg:LAST:%4.1lf ms Last'],
701 "DEF:running_avg={file}:running:AVERAGE",
702 "DEF:running_min={file}:running:MIN",
703 "DEF:running_max={file}:running:MAX",
704 "DEF:sleeping_avg={file}:sleeping:AVERAGE",
705 "DEF:sleeping_min={file}:sleeping:MIN",
706 "DEF:sleeping_max={file}:sleeping:MAX",
707 "DEF:zombies_avg={file}:zombies:AVERAGE",
708 "DEF:zombies_min={file}:zombies:MIN",
709 "DEF:zombies_max={file}:zombies:MAX",
710 "DEF:stopped_avg={file}:stopped:AVERAGE",
711 "DEF:stopped_min={file}:stopped:MIN",
712 "DEF:stopped_max={file}:stopped:MAX",
713 "DEF:paging_avg={file}:paging:AVERAGE",
714 "DEF:paging_min={file}:paging:MIN",
715 "DEF:paging_max={file}:paging:MAX",
716 "DEF:blocked_avg={file}:blocked:AVERAGE",
717 "DEF:blocked_min={file}:blocked:MIN",
718 "DEF:blocked_max={file}:blocked:MAX",
719 'CDEF:paging_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,paging_avg,+,+,+,+,+',
720 'CDEF:blocked_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,+,+,+,+',
721 'CDEF:zombies_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,+,+,+',
722 'CDEF:stopped_acc=sleeping_avg,running_avg,stopped_avg,+,+',
723 'CDEF:running_acc=sleeping_avg,running_avg,+',
724 'CDEF:sleeping_acc=sleeping_avg',
725 "AREA:paging_acc#$HalfYellow",
726 "AREA:blocked_acc#$HalfCyan",
727 "AREA:zombies_acc#$HalfRed",
728 "AREA:stopped_acc#$HalfMagenta",
729 "AREA:running_acc#$HalfGreen",
730 "AREA:sleeping_acc#$HalfBlue",
731 "LINE1:paging_acc#$FullYellow:Paging ",
732 'GPRINT:paging_min:MIN:%5.1lf Min,',
733 'GPRINT:paging_avg:AVERAGE:%5.1lf Average,',
734 'GPRINT:paging_max:MAX:%5.1lf Max,',
735 'GPRINT:paging_avg:LAST:%5.1lf Last\l',
736 "LINE1:blocked_acc#$FullCyan:Blocked ",
737 'GPRINT:blocked_min:MIN:%5.1lf Min,',
738 'GPRINT:blocked_avg:AVERAGE:%5.1lf Average,',
739 'GPRINT:blocked_max:MAX:%5.1lf Max,',
740 'GPRINT:blocked_avg:LAST:%5.1lf Last\l',
741 "LINE1:zombies_acc#$FullRed:Zombies ",
742 'GPRINT:zombies_min:MIN:%5.1lf Min,',
743 'GPRINT:zombies_avg:AVERAGE:%5.1lf Average,',
744 'GPRINT:zombies_max:MAX:%5.1lf Max,',
745 'GPRINT:zombies_avg:LAST:%5.1lf Last\l',
746 "LINE1:stopped_acc#$FullMagenta:Stopped ",
747 'GPRINT:stopped_min:MIN:%5.1lf Min,',
748 'GPRINT:stopped_avg:AVERAGE:%5.1lf Average,',
749 'GPRINT:stopped_max:MAX:%5.1lf Max,',
750 'GPRINT:stopped_avg:LAST:%5.1lf Last\l',
751 "LINE1:running_acc#$FullGreen:Running ",
752 'GPRINT:running_min:MIN:%5.1lf Min,',
753 'GPRINT:running_avg:AVERAGE:%5.1lf Average,',
754 'GPRINT:running_max:MAX:%5.1lf Max,',
755 'GPRINT:running_avg:LAST:%5.1lf Last\l',
756 "LINE1:sleeping_acc#$FullBlue:Sleeping",
757 'GPRINT:sleeping_min:MIN:%5.1lf Min,',
758 'GPRINT:sleeping_avg:AVERAGE:%5.1lf Average,',
759 'GPRINT:sleeping_max:MAX:%5.1lf Max,',
760 'GPRINT:sleeping_avg:LAST:%5.1lf Last\l'
763 'DEF:avg={file}:byte:AVERAGE',
764 'DEF:min={file}:byte:MIN',
765 'DEF:max={file}:byte:MAX',
766 "AREA:avg#$HalfBlue",
767 "LINE1:avg#$FullBlue:RSS",
768 'GPRINT:min:MIN:%5.1lf%s Min,',
769 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
770 'GPRINT:max:MAX:%5.1lf%s Max,',
771 'GPRINT:avg:LAST:%5.1lf%s Last\l'
774 'DEF:user_avg_raw={file}:user:AVERAGE',
775 'DEF:user_min_raw={file}:user:MIN',
776 'DEF:user_max_raw={file}:user:MAX',
777 'DEF:syst_avg_raw={file}:syst:AVERAGE',
778 'DEF:syst_min_raw={file}:syst:MIN',
779 'DEF:syst_max_raw={file}:syst:MAX',
780 'CDEF:user_avg=user_avg_raw,1000000,/',
781 'CDEF:user_min=user_min_raw,1000000,/',
782 'CDEF:user_max=user_max_raw,1000000,/',
783 'CDEF:syst_avg=syst_avg_raw,1000000,/',
784 'CDEF:syst_min=syst_min_raw,1000000,/',
785 'CDEF:syst_max=syst_max_raw,1000000,/',
786 'CDEF:user_syst=syst_avg,UN,0,syst_avg,IF,user_avg,+',
787 "AREA:user_syst#$HalfBlue",
788 "AREA:syst_avg#$HalfRed",
789 "LINE1:user_syst#$FullBlue:User ",
790 'GPRINT:user_min:MIN:%5.1lf%s Min,',
791 'GPRINT:user_avg:AVERAGE:%5.1lf%s Avg,',
792 'GPRINT:user_max:MAX:%5.1lf%s Max,',
793 'GPRINT:user_avg:LAST:%5.1lf%s Last\l',
794 "LINE1:syst_avg#$FullRed:System",
795 'GPRINT:syst_min:MIN:%5.1lf%s Min,',
796 'GPRINT:syst_avg:AVERAGE:%5.1lf%s Avg,',
797 'GPRINT:syst_max:MAX:%5.1lf%s Max,',
798 'GPRINT:syst_avg:LAST:%5.1lf%s Last\l'
801 'DEF:procs_avg={file}:processes:AVERAGE',
802 'DEF:procs_min={file}:processes:MIN',
803 'DEF:procs_max={file}:processes:MAX',
804 'DEF:thrds_avg={file}:threads:AVERAGE',
805 'DEF:thrds_min={file}:threads:MIN',
806 'DEF:thrds_max={file}:threads:MAX',
807 "AREA:thrds_avg#$HalfBlue",
808 "AREA:procs_avg#$HalfRed",
809 "LINE1:thrds_avg#$FullBlue:Threads ",
810 'GPRINT:thrds_min:MIN:%5.1lf Min,',
811 'GPRINT:thrds_avg:AVERAGE:%5.1lf Avg,',
812 'GPRINT:thrds_max:MAX:%5.1lf Max,',
813 'GPRINT:thrds_avg:LAST:%5.1lf Last\l',
814 "LINE1:procs_avg#$FullRed:Processes",
815 'GPRINT:procs_min:MIN:%5.1lf Min,',
816 'GPRINT:procs_avg:AVERAGE:%5.1lf Avg,',
817 'GPRINT:procs_max:MAX:%5.1lf Max,',
818 'GPRINT:procs_avg:LAST:%5.1lf Last\l'
821 'DEF:minor_avg={file}:minflt:AVERAGE',
822 'DEF:minor_min={file}:minflt:MIN',
823 'DEF:minor_max={file}:minflt:MAX',
824 'DEF:major_avg={file}:majflt:AVERAGE',
825 'DEF:major_min={file}:majflt:MIN',
826 'DEF:major_max={file}:majflt:MAX',
827 'CDEF:minor_major=major_avg,UN,0,major_avg,IF,minor_avg,+',
828 "AREA:minor_major#$HalfBlue",
829 "AREA:major_avg#$HalfRed",
830 "LINE1:minor_major#$FullBlue:Minor",
831 'GPRINT:minor_min:MIN:%5.1lf%s Min,',
832 'GPRINT:minor_avg:AVERAGE:%5.1lf%s Avg,',
833 'GPRINT:minor_max:MAX:%5.1lf%s Max,',
834 'GPRINT:minor_avg:LAST:%5.1lf%s Last\l',
835 "LINE1:major_avg#$FullRed:Major",
836 'GPRINT:major_min:MIN:%5.1lf%s Min,',
837 'GPRINT:major_avg:AVERAGE:%5.1lf%s Avg,',
838 'GPRINT:major_max:MAX:%5.1lf%s Max,',
839 'GPRINT:major_avg:LAST:%5.1lf%s Last\l'
842 'DEF:avg={file}:value:AVERAGE',
843 'DEF:min={file}:value:MIN',
844 'DEF:max={file}:value:MAX',
845 "AREA:max#$HalfBlue",
847 "LINE1:avg#$FullBlue:Queries/s",
848 'GPRINT:min:MIN:%9.3lf Min,',
849 'GPRINT:avg:AVERAGE:%9.3lf Average,',
850 'GPRINT:max:MAX:%9.3lf Max,',
851 'GPRINT:avg:LAST:%9.3lf Last\l'
854 'DEF:avg={file}:value:AVERAGE',
855 'DEF:min={file}:value:MIN',
856 'DEF:max={file}:value:MAX',
857 "AREA:max#$HalfBlue",
859 "LINE1:avg#$FullBlue:Queries/s",
860 'GPRINT:min:MIN:%9.3lf Min,',
861 'GPRINT:avg:AVERAGE:%9.3lf Average,',
862 'GPRINT:max:MAX:%9.3lf Max,',
863 'GPRINT:avg:LAST:%9.3lf Last\l'
866 'DEF:used_avg={file}:used:AVERAGE',
867 'DEF:used_min={file}:used:MIN',
868 'DEF:used_max={file}:used:MAX',
869 'DEF:free_avg={file}:free:AVERAGE',
870 'DEF:free_min={file}:free:MIN',
871 'DEF:free_max={file}:free:MAX',
872 'DEF:cach_avg={file}:cached:AVERAGE',
873 'DEF:cach_min={file}:cached:MIN',
874 'DEF:cach_max={file}:cached:MAX',
875 'DEF:resv_avg={file}:resv:AVERAGE',
876 'DEF:resv_min={file}:resv:MIN',
877 'DEF:resv_max={file}:resv:MAX',
878 'CDEF:cach_avg_notnull=cach_avg,UN,0,cach_avg,IF',
879 'CDEF:resv_avg_notnull=resv_avg,UN,0,resv_avg,IF',
880 'CDEF:used_acc=used_avg',
881 'CDEF:resv_acc=used_acc,resv_avg_notnull,+',
882 'CDEF:cach_acc=resv_acc,cach_avg_notnull,+',
883 'CDEF:free_acc=cach_acc,free_avg,+',
884 "AREA:free_acc#$HalfGreen",
885 "AREA:cach_acc#$HalfBlue",
886 "AREA:resv_acc#$HalfYellow",
887 "AREA:used_acc#$HalfRed",
888 "LINE1:free_acc#$FullGreen:Free ",
889 'GPRINT:free_min:MIN:%5.1lf%s Min,',
890 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
891 'GPRINT:free_max:MAX:%5.1lf%s Max,',
892 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
893 "LINE1:cach_acc#$FullBlue:Cached ",
894 'GPRINT:cach_min:MIN:%5.1lf%s Min,',
895 'GPRINT:cach_avg:AVERAGE:%5.1lf%s Avg,',
896 'GPRINT:cach_max:MAX:%5.1lf%s Max,',
897 'GPRINT:cach_avg:LAST:%5.1lf%s Last\l',
898 "LINE1:resv_acc#$FullYellow:Reserved",
899 'GPRINT:resv_min:MIN:%5.1lf%s Min,',
900 'GPRINT:resv_avg:AVERAGE:%5.1lf%s Avg,',
901 'GPRINT:resv_max:MAX:%5.1lf%s Max,',
902 'GPRINT:resv_avg:LAST:%5.1lf%s Last\n',
903 "LINE1:used_acc#$FullRed:Used ",
904 'GPRINT:used_min:MIN:%5.1lf%s Min,',
905 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
906 'GPRINT:used_max:MAX:%5.1lf%s Max,',
907 'GPRINT:used_avg:LAST:%5.1lf%s Last\l'
910 'DEF:temp_avg={file}:value:AVERAGE',
911 'DEF:temp_min={file}:value:MIN',
912 'DEF:temp_max={file}:value:MAX',
913 "AREA:temp_max#$HalfRed",
914 "AREA:temp_min#$Canvas",
915 "LINE1:temp_avg#$FullRed:Temperature",
916 'GPRINT:temp_min:MIN:%4.1lf Min,',
917 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
918 'GPRINT:temp_max:MAX:%4.1lf Max,',
919 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
922 'DEF:avg={file}:timeleft:AVERAGE',
923 'DEF:min={file}:timeleft:MIN',
924 'DEF:max={file}:timeleft:MAX',
925 "AREA:max#$HalfBlue",
927 "LINE1:avg#$FullBlue:Time left [min]",
928 'GPRINT:min:MIN:%5.1lf%s Min,',
929 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
930 'GPRINT:max:MAX:%5.1lf%s Max,',
931 'GPRINT:avg:LAST:%5.1lf%s Last\l'
933 time_offset => [ # NTPd
934 'DEF:s_avg={file}:seconds:AVERAGE',
935 'DEF:s_min={file}:seconds:MIN',
936 'DEF:s_max={file}:seconds:MAX',
937 "AREA:s_max#$HalfBlue",
938 "AREA:s_min#$Canvas",
939 "LINE1:s_avg#$FullBlue:{inst}",
940 'GPRINT:s_min:MIN:%7.3lf%s Min,',
941 'GPRINT:s_avg:AVERAGE:%7.3lf%s Avg,',
942 'GPRINT:s_max:MAX:%7.3lf%s Max,',
943 'GPRINT:s_avg:LAST:%7.3lf%s Last'
945 traffic => ['DEF:out_min_raw={file}:outgoing:MIN',
946 'DEF:out_avg_raw={file}:outgoing:AVERAGE',
947 'DEF:out_max_raw={file}:outgoing:MAX',
948 'DEF:inc_min_raw={file}:incoming:MIN',
949 'DEF:inc_avg_raw={file}:incoming:AVERAGE',
950 'DEF:inc_max_raw={file}:incoming:MAX',
951 'CDEF:out_min=out_min_raw,8,*',
952 'CDEF:out_avg=out_avg_raw,8,*',
953 'CDEF:out_max=out_max_raw,8,*',
954 'CDEF:inc_min=inc_min_raw,8,*',
955 'CDEF:inc_avg=inc_avg_raw,8,*',
956 'CDEF:inc_max=inc_max_raw,8,*',
957 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
958 'CDEF:mytime=out_avg_raw,TIME,TIME,IF',
959 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
960 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
961 'CDEF:out_avg_sample=out_avg_raw,UN,0,out_avg_raw,IF,sample_len,*',
962 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
963 'CDEF:inc_avg_sample=inc_avg_raw,UN,0,inc_avg_raw,IF,sample_len,*',
964 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
965 "AREA:out_avg#$HalfGreen",
966 "AREA:inc_avg#$HalfBlue",
967 "AREA:overlap#$HalfBlueGreen",
968 "LINE1:out_avg#$FullGreen:Outgoing",
969 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
970 'GPRINT:out_max:MAX:%5.1lf%s Max,',
971 'GPRINT:out_avg:LAST:%5.1lf%s Last',
972 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
973 "LINE1:inc_avg#$FullBlue:Incoming",
974 #'GPRINT:inc_min:MIN:%5.1lf %s Min,',
975 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
976 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
977 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
978 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
981 'DEF:cpufreq_avg={file}:value:AVERAGE',
982 'DEF:cpufreq_min={file}:value:MIN',
983 'DEF:cpufreq_max={file}:value:MAX',
984 "AREA:cpufreq_max#$HalfBlue",
985 "AREA:cpufreq_min#$Canvas",
986 "LINE1:cpufreq_avg#$FullBlue:Frequency",
987 'GPRINT:cpufreq_min:MIN:%5.1lf%s Min,',
988 'GPRINT:cpufreq_avg:AVERAGE:%5.1lf%s Avg,',
989 'GPRINT:cpufreq_max:MAX:%5.1lf%s Max,',
990 'GPRINT:cpufreq_avg:LAST:%5.1lf%s Last\l'
993 'DEF:multimeter_avg={file}:value:AVERAGE',
994 'DEF:multimeter_min={file}:value:MIN',
995 'DEF:multimeter_max={file}:value:MAX',
996 "AREA:multimeter_max#$HalfBlue",
997 "AREA:multimeter_min#$Canvas",
998 "LINE1:multimeter_avg#$FullBlue:Multimeter",
999 'GPRINT:multimeter_min:MIN:%4.1lf Min,',
1000 'GPRINT:multimeter_avg:AVERAGE:%4.1lf Average,',
1001 'GPRINT:multimeter_max:MAX:%4.1lf Max,',
1002 'GPRINT:multimeter_avg:LAST:%4.1lf Last\l'
1005 'DEF:users_avg={file}:users:AVERAGE',
1006 'DEF:users_min={file}:users:MIN',
1007 'DEF:users_max={file}:users:MAX',
1008 "AREA:users_max#$HalfBlue",
1009 "AREA:users_min#$Canvas",
1010 "LINE1:users_avg#$FullBlue:Users",
1011 'GPRINT:users_min:MIN:%4.1lf Min,',
1012 'GPRINT:users_avg:AVERAGE:%4.1lf Average,',
1013 'GPRINT:users_max:MAX:%4.1lf Max,',
1014 'GPRINT:users_avg:LAST:%4.1lf Last\l'
1017 'DEF:avg={file}:voltage:AVERAGE',
1018 'DEF:min={file}:voltage:MIN',
1019 'DEF:max={file}:voltage:MAX',
1020 "AREA:max#$HalfBlue",
1022 "LINE1:avg#$FullBlue:Voltage",
1023 'GPRINT:min:MIN:%5.1lf%sV Min,',
1024 'GPRINT:avg:AVERAGE:%5.1lf%sV Avg,',
1025 'GPRINT:max:MAX:%5.1lf%sV Max,',
1026 'GPRINT:avg:LAST:%5.1lf%sV Last\l'
1029 "DEF:total_avg={file}:total:AVERAGE",
1030 "DEF:total_min={file}:total:MIN",
1031 "DEF:total_max={file}:total:MAX",
1032 "DEF:running_avg={file}:running:AVERAGE",
1033 "DEF:running_min={file}:running:MIN",
1034 "DEF:running_max={file}:running:MAX",
1035 "DEF:uninterruptible_avg={file}:uninterruptible:AVERAGE",
1036 "DEF:uninterruptible_min={file}:uninterruptible:MIN",
1037 "DEF:uninterruptible_max={file}:uninterruptible:MAX",
1038 "DEF:onhold_avg={file}:onhold:AVERAGE",
1039 "DEF:onhold_min={file}:onhold:MIN",
1040 "DEF:onhold_max={file}:onhold:MAX",
1041 "LINE1:total_avg#$FullYellow:Total ",
1042 'GPRINT:total_min:MIN:%5.1lf Min,',
1043 'GPRINT:total_avg:AVERAGE:%5.1lf Avg.,',
1044 'GPRINT:total_max:MAX:%5.1lf Max,',
1045 'GPRINT:total_avg:LAST:%5.1lf Last\l',
1046 "LINE1:running_avg#$FullRed:Running ",
1047 'GPRINT:running_min:MIN:%5.1lf Min,',
1048 'GPRINT:running_avg:AVERAGE:%5.1lf Avg.,',
1049 'GPRINT:running_max:MAX:%5.1lf Max,',
1050 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1051 "LINE1:uninterruptible_avg#$FullGreen:Unintr ",
1052 'GPRINT:uninterruptible_min:MIN:%5.1lf Min,',
1053 'GPRINT:uninterruptible_avg:AVERAGE:%5.1lf Avg.,',
1054 'GPRINT:uninterruptible_max:MAX:%5.1lf Max,',
1055 'GPRINT:uninterruptible_avg:LAST:%5.1lf Last\l',
1056 "LINE1:onhold_avg#$FullBlue:Onhold ",
1057 'GPRINT:onhold_min:MIN:%5.1lf Min,',
1058 'GPRINT:onhold_avg:AVERAGE:%5.1lf Avg.,',
1059 'GPRINT:onhold_max:MAX:%5.1lf Max,',
1060 'GPRINT:onhold_avg:LAST:%5.1lf Last\l'
1063 'DEF:vm_avg={file}:vm:AVERAGE',
1064 'DEF:vm_min={file}:vm:MIN',
1065 'DEF:vm_max={file}:vm:MAX',
1066 'DEF:vml_avg={file}:vml:AVERAGE',
1067 'DEF:vml_min={file}:vml:MIN',
1068 'DEF:vml_max={file}:vml:MAX',
1069 'DEF:rss_avg={file}:rss:AVERAGE',
1070 'DEF:rss_min={file}:rss:MIN',
1071 'DEF:rss_max={file}:rss:MAX',
1072 'DEF:anon_avg={file}:anon:AVERAGE',
1073 'DEF:anon_min={file}:anon:MIN',
1074 'DEF:anon_max={file}:anon:MAX',
1075 "LINE1:vm_avg#$FullYellow:VM ",
1076 'GPRINT:vm_min:MIN:%5.1lf%s Min,',
1077 'GPRINT:vm_avg:AVERAGE:%5.1lf%s Avg.,',
1078 'GPRINT:vm_max:MAX:%5.1lf%s Avg.,',
1079 'GPRINT:vm_avg:LAST:%5.1lf%s Last\l',
1080 "LINE1:vml_avg#$FullRed:Locked ",
1081 'GPRINT:vml_min:MIN:%5.1lf%s Min,',
1082 'GPRINT:vml_avg:AVERAGE:%5.1lf%s Avg.,',
1083 'GPRINT:vml_max:MAX:%5.1lf%s Avg.,',
1084 'GPRINT:vml_avg:LAST:%5.1lf%s Last\l',
1085 "LINE1:rss_avg#$FullGreen:RSS ",
1086 'GPRINT:rss_min:MIN:%5.1lf%s Min,',
1087 'GPRINT:rss_avg:AVERAGE:%5.1lf%s Avg.,',
1088 'GPRINT:rss_max:MAX:%5.1lf%s Avg.,',
1089 'GPRINT:rss_avg:LAST:%5.1lf%s Last\l',
1090 "LINE1:anon_avg#$FullBlue:Anon. ",
1091 'GPRINT:anon_min:MIN:%5.1lf%s Min,',
1092 'GPRINT:anon_avg:AVERAGE:%5.1lf%s Avg.,',
1093 'GPRINT:anon_max:MAX:%5.1lf%s Avg.,',
1094 'GPRINT:anon_avg:LAST:%5.1lf%s Last\l',
1097 'DEF:proc_avg={file}:total:AVERAGE',
1098 'DEF:proc_min={file}:total:MIN',
1099 'DEF:proc_max={file}:total:MAX',
1100 "AREA:proc_max#$HalfBlue",
1101 "AREA:proc_min#$Canvas",
1102 "LINE1:proc_avg#$FullBlue:Processes",
1103 'GPRINT:proc_min:MIN:%4.1lf Min,',
1104 'GPRINT:proc_avg:AVERAGE:%4.1lf Avg.,',
1105 'GPRINT:proc_max:MAX:%4.1lf Max,',
1106 'GPRINT:proc_avg:LAST:%4.1lf Last\l'
1109 $GraphDefs->{'disk'} = $GraphDefs->{'partition'};
1110 $GraphDefs->{'if_errors'} = $GraphDefs->{'if_packets'};
1111 $GraphDefs->{'meminfo'} = $GraphDefs->{'memory'};
1112 $GraphDefs->{'sensors'} = $GraphDefs->{'temperature'};
1114 $GraphDefs->{'delay'} = $GraphDefs->{'time_offset'};
1115 $GraphDefs->{'time_dispersion'} = $GraphDefs->{'time_offset'};
1120 apache_bytes => ['-t', 'apache traffic', '-v', 'Bit/s'],
1121 apache_requests => ['-t', 'apache requests', '-v', 'Requests/s'],
1122 apache_scoreboard => ['-t', 'apache scoreboard {inst}', '-v', 'Processes'],
1123 charge => ['-t', '{host} charge', '-v', 'Ampere hours'],
1124 charge_percent => ['-t', '{host} charge', '-v', 'Percent'],
1125 cpu => ['-t', '{host} cpu{inst} usage', '-v', 'Percent', '-l', '0'],
1126 cpufreq => ['-t', '{host} cpu{inst} usage', '-v', 'Mhz'],
1127 current => ['-t', '{host} current', '-v', 'Ampere'],
1128 #disk => ['-t', '{host} disk {inst} IO wait', '-v', 'Seconds'],
1129 delay => ['-t', 'NTPd peer delay ({inst})', '-v', 'Seconds'],
1130 df => ['-t', '{host}:{inst} usage', '-v', 'Percent', '-l', '0'],
1131 disk => ['-t', '{host} disk {inst} usage', '-v', 'Byte/s'],
1132 dns_traffic => ['-t', '{host} DNS traffic', '-v', 'Bit/s'],
1133 fanspeed => ['-t', '{host} fanspeed {inst}', '-v', 'RPM'],
1134 frequency_offset => ['-t', 'NTPd frequency offset ({inst})', '-v', 'Parts per million'],
1135 hddtemp => ['-t', '{host} hdd temperature {inst}', '-v', '°Celsius'],
1136 if_errors => ['-t', '{host} {inst} errors', '-v', 'Errors/s'],
1137 if_packets => ['-t', '{host} {inst} packets', '-v', 'Packets/s'],
1138 load => ['-t', '{host} load average', '-v', 'System load', '-X', '0'],
1139 load_percent => ['-t', '{host} load', '-v', 'Percent'],
1140 mails => ['-t', '{host} mail count', '-v', 'Amount', '-X', '0'],
1141 memory => ['-t', '{host} memory usage', '-v', 'Bytes', '-b', '1024', '-l', '0'],
1142 mysql_commands => ['-t', 'mysql command {inst}', '-v', 'Issues/s' ],
1143 mysql_handler => ['-t', 'mysql handler {inst}', '-v', 'Issues/s' ],
1144 mysql_qcache => ['-t', 'mysql query cache', '-v', 'Queries/s' ],
1145 mysql_threads => ['-t', 'mysql threads', '-v', 'Threads' ],
1146 nfs3_procedures => ['-t', '{host} NFSv3 {inst} procedures', '-v', 'Procedures/s' ],
1147 opcode => ['-t', 'OpCode {inst}', '-v', 'Queries/s'],
1148 partition => ['-t', '{host} partition {inst} usage', '-v', 'Byte/s'],
1149 ping => ['-t', '{host} ping to {inst}', '-v', 'ms'],
1150 processes => ['-t', '{host} processes', '-v', 'Processes'],
1151 ps_rss => ['-t', '{host} process {inst} RSS', '-v', 'Bytes', '-b', '1024'],
1152 ps_cputime => ['-t', '{host} process {inst} CPU usage', '-v', 'Seconds'],
1153 ps_count => ['-t', '{host} process {inst} count', '-v', 'Threads/Processes'],
1154 ps_pagefaults => ['-t', '{host} process {inst} pagefaults', '-v', 'Pagefaults/s'],
1155 qtype => ['-t', 'QType {inst}', '-v', 'Queries/s'],
1156 rcode => ['-t', 'RCode {inst}', '-v', 'Queries/s'],
1157 sensors => ['-t', '{host} sensor {inst}', '-v', '°Celsius'],
1158 swap => ['-t', '{host} swap usage', '-v', 'Bytes', '-b', '1024', '-l', '0'],
1159 temperature => ['-t', '{host} temperature {inst}', '-v', '°Celsius'],
1160 timeleft => ['-t', '{host} UPS time left', '-v', 'Time [min]'],
1161 time_offset => ['-t', 'NTPd time offset ({inst})', '-v', 'Seconds'],
1162 time_dispersion => ['-t', 'NTPd time dispersion ({inst})', '-v', 'Seconds'],
1163 traffic => ['-t', '{host} {inst} traffic', '-v', 'Bit/s'],
1164 users => ['-t', '{host} users', '-v', 'Users'],
1165 multimeter => ['-t', '{host} multimeter', '-v', 'Value'],
1166 voltage => ['-t', '{host} voltage {inst}', '-v', 'Volts'],
1167 vs_threads => ['-t', '{host} threads', '-v', 'Threads'],
1168 vs_memory => ['-t', '{host} memory usage', '-v', 'Bytes'],
1169 vs_processes => ['-t', '{host} processes', '-v', 'Processes'],
1174 apache_scoreboard => \&output_graph_apache_scoreboard,
1175 cpu => \&output_graph_cpu,
1181 mysql_commands => \&output_graph_mysql_commands,
1182 mysql_handler => \&output_graph_mysql_handler,
1184 ping => \&output_graph_ping,
1185 qtype => \&output_graph_named_qtype,
1186 rcode => \&output_graph_named_rcode,
1194 if (defined ($ENV{'GATEWAY_INTERFACE'}))
1196 @Info = ($ENV{'PATH_INFO'} || '') =~ m#([\w\-\.]+)#g;
1203 parse_pathinfo (@Info);
1216 sub output_graph_cpu
1226 "DEF:user_avg_$_=$AbsDir/cpu-$_.rrd:user:AVERAGE",
1227 "DEF:user_min_$_=$AbsDir/cpu-$_.rrd:user:MIN",
1228 "DEF:user_max_$_=$AbsDir/cpu-$_.rrd:user:MAX",
1229 "DEF:nice_avg_$_=$AbsDir/cpu-$_.rrd:nice:AVERAGE",
1230 "DEF:nice_min_$_=$AbsDir/cpu-$_.rrd:nice:MIN",
1231 "DEF:nice_max_$_=$AbsDir/cpu-$_.rrd:nice:MAX",
1232 "DEF:syst_avg_$_=$AbsDir/cpu-$_.rrd:syst:AVERAGE",
1233 "DEF:syst_min_$_=$AbsDir/cpu-$_.rrd:syst:MIN",
1234 "DEF:syst_max_$_=$AbsDir/cpu-$_.rrd:syst:MAX",
1235 "DEF:wait_avg_$_=$AbsDir/cpu-$_.rrd:wait:AVERAGE",
1236 "DEF:wait_min_$_=$AbsDir/cpu-$_.rrd:wait:MIN",
1237 "DEF:wait_max_$_=$AbsDir/cpu-$_.rrd:wait:MAX");
1240 for (qw(user nice syst wait))
1245 my $default_value = ($def eq 'user' or $def eq 'syst') ? 'UNKN' : '0';
1247 for (qw(avg min max))
1253 push (@ret, "CDEF:${def}_${cf}_notnull_${_}=${def}_${cf}_${_},UN,0,${def}_${cf}_${_},IF");
1254 push (@ret, "CDEF:${def}_${cf}_defined_${_}=${def}_${cf}_${_},UN,0,1,IF");
1257 $cdef = "CDEF:${def}_${cf}_num=" . join (',', map { "${def}_${cf}_defined_${_}" } (@inst));
1258 $cdef .= ',+' x (scalar (@inst) - 1);
1261 $cdef = "CDEF:${def}_${cf}=${def}_${cf}_num," . join (',', map { "${def}_${cf}_notnull_${_}" } (@inst));
1262 $cdef .= ',+' x (scalar (@inst) - 1);
1263 $cdef .= ",${def}_${cf}_num,${def}_${cf}_num,1,IF,/,$default_value,IF";
1265 push (@ret, "CDEF:${def}_${cf}_notnull=${def}_${cf},UN,0,${def}_${cf},IF");
1270 "CDEF:nice_acc=syst_avg_notnull,wait_avg_notnull,user_avg_notnull,nice_avg_notnull,+,+,+",
1271 "CDEF:user_acc=syst_avg_notnull,wait_avg_notnull,user_avg_notnull,+,+",
1272 "CDEF:wait_acc=syst_avg_notnull,wait_avg_notnull,+",
1273 "CDEF:syst_acc=syst_avg_notnull");
1275 push (@ret, grep { $_ !~ m/^C?DEF/ } (@{$GraphDefs->{'cpu'}}));
1280 sub output_graph_apache_scoreboard
1287 my @colors = get_n_colors (scalar (@inst));
1289 for (my $i = 0; $i < scalar (@inst); $i++)
1291 my $inst = $inst[$i];
1293 "DEF:avg_$i=$AbsDir/apache_scoreboard-$inst.rrd:count:AVERAGE",
1294 "DEF:min_$i=$AbsDir/apache_scoreboard-$inst.rrd:count:MIN",
1295 "DEF:max_$i=$AbsDir/apache_scoreboard-$inst.rrd:count:MAX");
1298 for (my $i = 0; $i < scalar (@inst); $i++)
1300 my $inst = $inst[$i];
1301 my $color = $colors[$i];
1303 if (length ($inst) > 15)
1305 $inst = substr ($inst, 0, 12) . '...';
1309 $inst = sprintf ('%-15s', $inst);
1313 "LINE1:avg_$i#$color:$inst",
1314 "GPRINT:min_$i:MIN:%6.2lf Min,",
1315 "GPRINT:avg_$i:AVERAGE:%6.2lf Avg,",
1316 "GPRINT:max_$i:MAX:%6.2lf Max,",
1317 "GPRINT:avg_$i:LAST:%6.2lf Last\\l");
1323 sub output_graph_ping
1330 my @colors = get_n_colors (scalar (@inst));
1332 for (my $i = 0; $i < scalar (@inst); $i++)
1334 my $inst = $inst[$i];
1336 "DEF:avg_$i=$AbsDir/ping-$inst.rrd:ping:AVERAGE",
1337 "DEF:min_$i=$AbsDir/ping-$inst.rrd:ping:MIN",
1338 "DEF:max_$i=$AbsDir/ping-$inst.rrd:ping:MAX");
1341 for (my $i = 0; $i < scalar (@inst); $i++)
1343 my $inst = $inst[$i];
1344 my $color = $colors[$i];
1346 if (length ($inst) > 15)
1348 $inst = substr ($inst, 0, 12) . '...';
1352 $inst = sprintf ('%-15s', $inst);
1356 "LINE1:avg_$i#$color:$inst",
1357 "GPRINT:min_$i:MIN:%4.1lf ms Min,",
1358 "GPRINT:avg_$i:AVERAGE:%4.1lf ms Avg,",
1359 "GPRINT:max_$i:MAX:%4.1lf ms Max,",
1360 "GPRINT:avg_$i:LAST:%4.1lf ms Last\\l");
1366 sub output_graph_mysql_commands
1373 my @colors = get_n_colors (scalar (@inst));
1375 for (my $i = 0; $i < scalar (@inst); $i++)
1377 my $inst = $inst[$i];
1379 "DEF:avg_$i=$AbsDir/mysql_commands-$inst.rrd:value:AVERAGE",
1380 "DEF:min_$i=$AbsDir/mysql_commands-$inst.rrd:value:MIN",
1381 "DEF:max_$i=$AbsDir/mysql_commands-$inst.rrd:value:MAX");
1384 for (my $i = 0; $i < scalar (@inst); $i++)
1386 my $inst = $inst[$i];
1387 my $color = $colors[$i];
1389 if (length ($inst) > 18)
1391 $inst = substr ($inst, 0, 15) . '...';
1395 $inst = sprintf ('%-18s', $inst);
1399 "LINE1:avg_$i#$color:$inst",
1400 "GPRINT:min_$i:MIN:%6.1lf Min,",
1401 "GPRINT:avg_$i:AVERAGE:%6.1lf Avg,",
1402 "GPRINT:max_$i:MAX:%6.1lf Max,",
1403 "GPRINT:avg_$i:LAST:%6.1lf Last\\l");
1409 sub output_graph_mysql_handler
1416 my @colors = get_n_colors (scalar (@inst));
1418 for (my $i = 0; $i < scalar (@inst); $i++)
1420 my $inst = $inst[$i];
1422 "DEF:avg_$i=$AbsDir/mysql_handler-$inst.rrd:value:AVERAGE",
1423 "DEF:min_$i=$AbsDir/mysql_handler-$inst.rrd:value:MIN",
1424 "DEF:max_$i=$AbsDir/mysql_handler-$inst.rrd:value:MAX");
1427 for (my $i = 0; $i < scalar (@inst); $i++)
1429 my $inst = $inst[$i];
1430 my $color = $colors[$i];
1432 if (length ($inst) > 18)
1434 $inst = substr ($inst, 0, 15) . '...';
1438 $inst = sprintf ('%-18s', $inst);
1442 "LINE1:avg_$i#$color:$inst",
1443 "GPRINT:min_$i:MIN:%6.1lf Min,",
1444 "GPRINT:avg_$i:AVERAGE:%6.1lf Avg,",
1445 "GPRINT:max_$i:MAX:%6.1lf Max,",
1446 "GPRINT:avg_$i:LAST:%6.1lf Last\\l");
1452 sub output_graph_named_qtype
1459 my @colors = get_n_colors (scalar (@inst));
1461 for (my $i = 0; $i < scalar (@inst); $i++)
1463 my $inst = $inst[$i];
1465 "DEF:avg_$i=$AbsDir/qtype-$inst.rrd:value:AVERAGE",
1466 "DEF:min_$i=$AbsDir/qtype-$inst.rrd:value:MIN",
1467 "DEF:max_$i=$AbsDir/qtype-$inst.rrd:value:MAX");
1470 for (my $i = 0; $i < scalar (@inst); $i++)
1472 my $inst = $inst[$i];
1473 my $color = $colors[$i];
1474 my $type = ($i == 0) ? 'AREA' : 'STACK';
1476 if (length ($inst) > 5)
1478 $inst = substr ($inst, 0, 5);
1482 $inst = sprintf ('%-5s', $inst);
1486 "$type:avg_$i#$color:$inst",
1487 "GPRINT:min_$i:MIN:%9.3lf Min,",
1488 "GPRINT:avg_$i:AVERAGE:%9.3lf Avg,",
1489 "GPRINT:max_$i:MAX:%9.3lf Max,",
1490 "GPRINT:avg_$i:LAST:%9.3lf Last\\l");
1496 sub output_graph_named_rcode
1503 my @colors = get_n_colors (scalar (@inst));
1505 for (my $i = 0; $i < scalar (@inst); $i++)
1507 my $inst = $inst[$i];
1509 "DEF:avg_$i=$AbsDir/rcode-$inst.rrd:value:AVERAGE",
1510 "DEF:min_$i=$AbsDir/rcode-$inst.rrd:value:MIN",
1511 "DEF:max_$i=$AbsDir/rcode-$inst.rrd:value:MAX");
1514 for (my $i = 0; $i < scalar (@inst); $i++)
1516 my $inst = $inst[$i];
1517 my $color = $colors[$i];
1518 my $type = ($i == 0) ? 'AREA' : 'STACK';
1520 if (length ($inst) > 8)
1522 $inst = substr ($inst, 0, 6) . '..';
1526 $inst = sprintf ('%-8s', $inst);
1530 "$type:avg_$i#$color:$inst",
1531 "GPRINT:min_$i:MIN:%9.3lf Min,",
1532 "GPRINT:avg_$i:AVERAGE:%9.3lf Avg,",
1533 "GPRINT:max_$i:MAX:%9.3lf Max,",
1534 "GPRINT:avg_$i:LAST:%9.3lf Last\\l");
1541 die unless (defined ($GraphDefs->{$Type}));
1545 my $file = $AbsDir . '/';
1546 my $files = get_all_files ($AbsDir);
1551 if ($RelDir =~ m#([^/]+)$#)
1557 $host = $Config->{'HostName'};
1563 if ($TimeSpan =~ m/(\d+)/)
1565 $TimeSpan = -1 * int ($1);
1569 my %t = (hour => -3600, day => -86400, week => -604800, month => -2678400, year => -31622400);
1570 die unless (defined ($t{$TimeSpan}));
1571 $TimeSpan = $t{$TimeSpan};
1574 if (scalar (@{$files->{$Type}}) == 1)
1576 $Inst = $files->{$Type}[0];
1579 #push (@cmd, '-', '-a', 'PNG', '-s', $TimeSpan, '-w', 800, '-h', 150);
1580 push (@cmd, '-', '-a', 'PNG', '-s', $TimeSpan);
1581 push (@cmd, @{$GraphArgs->{$Type}}) if (defined ($GraphArgs->{$Type}));
1583 for (qw(Back ShadeA ShadeB Font Canvas Grid MGrid Frame Arrow))
1585 push (@cmd, '-c', uc ($_) . '#' . $Config->{'Colors'}{$_});
1588 if ((length ($Inst) == 0) and (ref ($GraphMulti->{$Type}) eq 'CODE'))
1590 push (@cmd, $GraphMulti->{$Type}->(@{$files->{$Type}}));
1594 if (length ("$Inst"))
1596 $file .= "$Type-$Inst.rrd";
1600 $file .= "$Type.rrd";
1603 die ("File not found: $file") unless (-e $file);
1605 push (@cmd, @{$GraphDefs->{$Type}});
1610 $_ =~ s/{file}/$file/g;
1611 $_ =~ s/{host}/$host/g;
1612 $_ =~ s/{inst}/$Inst/g;
1613 $_ =~ s/{type}/$Type/g;
1618 print STDOUT <<HEADER if (defined ($ENV{'GATEWAY_INTERFACE'}));
1619 Content-Type: image/png
1620 Cache-Control: no-cache
1627 open ($fh, ">/tmp/collection.log") or die ("open: $!");
1628 flock ($fh, LOCK_EX) or die ("flock: $!");
1630 print $fh join ("\n\t", @cmd) . "\n";
1637 die ('RRDs::error: ' . RRDs::error ()) if (RRDs::error ());
1642 my $files = get_all_files ($AbsDir);
1643 my $dirs = get_all_dirs ($AbsDir);
1645 print STDOUT <<HEADER if (defined ($ENV{'GATEWAY_INTERFACE'}));
1646 Content-Type: text/html
1647 Cache-Control: no-cache
1651 <title>Collection: $RelDir</title>
1652 <style type="text/css">
1653 img { border: none; display: block; }
1660 my $MySelf = defined ($ENV{'GATEWAY_INTERFACE'}) ? $ENV{'SCRIPT_NAME'} : $0;
1662 if ((length ($Type) != 0) and (length ($Inst) == 0) and (ref ($GraphMulti->{$Type}) eq 'CODE') and (scalar (@{$files->{$Type}}) > 1))
1664 print qq(\t\t<div><a href="$MySelf$RelDir">Go up</a></div>\n);
1667 for (@{$files->{$Type}})
1669 print qq(\t\t\t<li><a href="$MySelf$RelDir/$Type/$_">$_</a></li>\n);
1675 <div><img src="$MySelf$RelDir/$Type/hour" /></div>
1677 <div><img src="$MySelf$RelDir/$Type/day" /></div>
1679 <div><img src="$MySelf$RelDir/$Type/week" /></div>
1681 <div><img src="$MySelf$RelDir/$Type/month" /></div>
1683 <div><img src="$MySelf$RelDir/$Type/year" /></div>
1686 elsif (length ($Type) != 0)
1688 my $ext = length ($Inst) ? "$Type/$Inst" : $Type;
1690 if ((ref ($GraphMulti->{$Type}) eq 'CODE') and (scalar (@{$files->{$Type}}) > 1))
1692 print qq(<div><a href="$MySelf$RelDir/$Type">Go up</a></div>\n);
1696 print qq(<div><a href="$MySelf$RelDir">Go up</a></div>\n);
1701 <div><img src="$MySelf$RelDir/$ext/hour" /></div>
1703 <div><img src="$MySelf$RelDir/$ext/day" /></div>
1705 <div><img src="$MySelf$RelDir/$ext/week" /></div>
1707 <div><img src="$MySelf$RelDir/$ext/month" /></div>
1709 <div><img src="$MySelf$RelDir/$ext/year" /></div>
1716 my ($up) = $RelDir =~ m#(.*)/[^/]+$#;
1717 print qq(\t\t<div><a href="$MySelf$up">Go up</a></div>\n);
1725 print qq(<li>$AbsDir/<a href="$MySelf$RelDir/$_">$_</a></li>\n);
1730 for (sort (keys %$files))
1734 if (ref ($GraphMulti->{$type}) eq 'CODE')
1736 print qq(\t\t<a href="$MySelf$RelDir/$type" />),
1737 qq(<img src="$MySelf$RelDir/$type/day" /></a>\n);
1741 for (@{$files->{$type}})
1747 print qq(\t\t<a href="$MySelf$RelDir/$type/$inst" />),
1748 qq(<img src="$MySelf$RelDir/$type/$inst/day" /></a>\n);
1752 print qq(\t\t<a href="$MySelf$RelDir/$type" />),
1753 qq(<img src="$MySelf$RelDir/$type/day" /></a>\n);
1759 print STDOUT <<FOOTER if (defined ($ENV{'GATEWAY_INTERFACE'}));
1767 my $files = get_all_files ();
1769 print STDOUT <<HEADER if (defined ($ENV{'GATEWAY_INTERFACE'}));
1770 Content-Type: text/xml
1771 Cache-Control: no-cache
1774 print STDOUT pl2xml ($files);
1779 my $file = @_ ? shift : '/etc/collection.conf';
1783 # if (open ($fh, "< $file"))
1791 # $conf = xml2pl ($xml);
1811 FullRed => 'FF0000',
1812 FullBlue => '0000FF',
1813 FullGreen => '00E000',
1814 FullYellow => 'F0A000',
1815 FullCyan => '00A0FF',
1816 FullMagenta => 'A000FF',
1818 HalfRed => 'F8B8B8',
1819 HalfBlue => 'B8B8F8',
1820 HalfGreen => 'B8F0B8',
1821 HalfYellow => 'F4F4B8'
1823 Directory => '/var/lib/collectd',
1824 HostName => (defined ($ENV{'SERVER_NAME'}) ? $ENV{'SERVER_NAME'} : 'localhost')
1837 $AbsDir = $Config->{'Directory'};
1840 while (@info and -d $AbsDir . '/' . $info[0])
1842 my $new = shift (@info);
1843 next if ($new =~ m/^\./);
1845 $AbsDir .= '/' . $new;
1846 $RelDir .= '/' . $new;
1853 confess ("parse_pathinfo: too many elements in pathinfo") if (scalar (@info) > 3);
1854 return unless (@info);
1856 $Type = shift (@info);
1857 return unless (@info);
1859 if ($info[-1] =~ m/^(hour|day|week|month|year)$/i)
1861 $TimeSpan = pop (@info);
1864 $Inst = shift (@info) if (@info);
1866 confess ("unrecognized elements in pathinfo") if (@info);
1871 my $dir = @_ ? shift : $Config->{'Directory'};
1875 if (opendir ($dh, $dir))
1877 while (my $thing = readdir ($dh))
1879 next if ($thing =~ m/^\./);
1884 if ($thing =~ m/^(\w+)-([\w\-\.]+)\.rrd$/)
1889 elsif ($thing =~ m/^(\w+)\.rrd$/)
1899 # Only load RRD files we can actually display..
1900 next unless (defined ($GraphDefs->{$type}));
1902 $hash->{$type} = [] unless (defined ($hash->{$type}));
1903 push (@{$hash->{$type}}, $inst);
1914 my $dir = @_ ? shift : $Config->{'Directory'};
1918 if (opendir ($dh, $dir))
1920 while (my $thing = readdir ($dh))
1922 next if ($thing =~ m/^\./);
1924 next if (!-d "$dir/$thing");
1926 push (@ret, $thing);
1932 return (@ret) if (wantarray ());
1940 my ($red, $green, $blue) = map { ord (pack ("H2", $_)) } ($color =~ m/([A-Fa-f0-9]{2})/g);
1941 #print STDERR "$color -> rgb($red,$green,$blue)\n";
1943 return ($red, $green, $blue);
1948 croak unless (scalar (@_) == 3);
1950 my ($red, $green, $blue) = @_;
1952 my $ret = sprintf ("%02X%02X%02X", $red, $green, $blue);
1953 #print STDERR "rgb($red,$green,$blue) -> $ret\n";
1958 sub color_calculate_transparent
1961 my $canvas = [color_hex2rgb (shift)];
1962 my @colors = map { [color_hex2rgb ($_)] } (@_);
1964 if (($alpha < 0.0) or ($alpha > 1.0))
1971 return (color_rgb2hex (@$canvas));
1975 return (color_rgb2hex (@{$colors[-1]}));
1978 my $ret = _color_calculate_transparent ($alpha, $canvas, @colors);
1980 return (color_rgb2hex (@$ret));
1983 sub _color_calculate_transparent
1988 my @colors = @_ ? shift : ();
1989 my $ret = [0, 0, 0];
1991 for (my $i = 0; $i < 3; $i++)
1993 $ret->[$i] = ($alpha * $color->[$i]) + ((1 - $alpha) * $canvas->[$i]);
1996 return (_color_calculate_transparent ($alpha, $ret, @colors)) if (@colors);
2005 for (my $i = 0; $i < $num; $i++)
2007 my $pos = 6 * $i / $num;
2048 push (@ret, sprintf ("%02x%02x%02x", $red, $green, $blue));