php-collection/definitions.php: Add MetaGraph definitions for bind plugin
[collectd.git] / contrib / php-collection / definitions.php
1 <?php // vim:fenc=utf-8:filetype=php:ts=4
2 /*
3  * Copyright (C) 2009  Bruno PrĂ©mont <bonbons AT linux-vserver.org>
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License as published by the Free Software
7  * Foundation; only version 2 of the License is applicable.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  *
19  * Most RRD Graph definitions copied from collection.cgi
20  */
21 $GraphDefs     = array();
22 $MetaGraphDefs = array();
23
24 if (is_file('definitions.local.php'))
25         require_once('definitions.local.php');
26
27 function load_graph_definitions($logarithmic = false, $tinylegend = false) {
28         global $GraphDefs, $MetaGraphDefs;
29
30         $Canvas   = 'FFFFFF';
31
32         $FullRed    = 'FF0000';
33         $FullGreen  = '00E000';
34         $FullBlue   = '0000FF';
35         $FullYellow = 'F0A000';
36         $FullCyan   = '00A0FF';
37         $FullMagenta= 'A000FF';
38
39         $HalfRed    = 'F7B7B7';
40         $HalfGreen  = 'B7EFB7';
41         $HalfBlue   = 'B7B7F7';
42         $HalfYellow = 'F3DFB7';
43         $HalfCyan   = 'B7DFF7';
44         $HalfMagenta= 'DFB7F7';
45
46         $HalfBlueGreen = '89B3C9';
47
48         $GraphDefs = array();
49         $GraphDefs['apache_bytes'] = array(
50                 '-v', 'Bits/s',
51                 'DEF:min_raw={file}:count:MIN',
52                 'DEF:avg_raw={file}:count:AVERAGE',
53                 'DEF:max_raw={file}:count:MAX',
54                 'CDEF:min=min_raw,8,*',
55                 'CDEF:avg=avg_raw,8,*',
56                 'CDEF:max=max_raw,8,*',
57                 'CDEF:mytime=avg_raw,TIME,TIME,IF',
58                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
59                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
60                 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
61                 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
62                 "AREA:avg#$HalfBlue",
63                 "LINE1:avg#$FullBlue:Bit/s",
64                 'GPRINT:min:MIN:%5.1lf%s Min,',
65                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
66                 'GPRINT:max:MAX:%5.1lf%s Max,',
67                 'GPRINT:avg:LAST:%5.1lf%s Last',
68                 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
69         $GraphDefs['apache_requests'] = array(
70                 '-v', 'Requests/s',
71                 'DEF:min={file}:count:MIN',
72                 'DEF:avg={file}:count:AVERAGE',
73                 'DEF:max={file}:count:MAX',
74                 "AREA:max#$HalfBlue",
75                 "AREA:min#$Canvas",
76                 "LINE1:avg#$FullBlue:Requests/s",
77                 'GPRINT:min:MIN:%6.2lf Min,',
78                 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
79                 'GPRINT:max:MAX:%6.2lf Max,',
80                 'GPRINT:avg:LAST:%6.2lf Last');
81         $GraphDefs['apache_scoreboard'] = array(
82                 'DEF:min={file}:count:MIN',
83                 'DEF:avg={file}:count:AVERAGE',
84                 'DEF:max={file}:count:MAX',
85                 "AREA:max#$HalfBlue",
86                 "AREA:min#$Canvas",
87                 "LINE1:avg#$FullBlue:Processes",
88                 'GPRINT:min:MIN:%6.2lf Min,',
89                 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
90                 'GPRINT:max:MAX:%6.2lf Max,',
91                 'GPRINT:avg:LAST:%6.2lf Last');
92         $GraphDefs['bitrate'] = array(
93                 '-v', 'Bits/s',
94                 'DEF:avg={file}:value:AVERAGE',
95                 'DEF:min={file}:value:MIN',
96                 'DEF:max={file}:value:MAX',
97                 "AREA:max#$HalfBlue",
98                 "AREA:min#$Canvas",
99                 "LINE1:avg#$FullBlue:Bits/s",
100                 'GPRINT:min:MIN:%5.1lf%s Min,',
101                 'GPRINT:avg:AVERAGE:%5.1lf%s Average,',
102                 'GPRINT:max:MAX:%5.1lf%s Max,',
103                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
104         $GraphDefs['charge'] = array(
105                 '-v', 'Ah',
106                 'DEF:avg={file}:value:AVERAGE',
107                 'DEF:min={file}:value:MIN',
108                 'DEF:max={file}:value:MAX',
109                 "AREA:max#$HalfBlue",
110                 "AREA:min#$Canvas",
111                 "LINE1:avg#$FullBlue:Charge",
112                 'GPRINT:min:MIN:%5.1lf%sAh Min,',
113                 'GPRINT:avg:AVERAGE:%5.1lf%sAh Avg,',
114                 'GPRINT:max:MAX:%5.1lf%sAh Max,',
115                 'GPRINT:avg:LAST:%5.1lf%sAh Last\l');
116         $GraphDefs['counter'] = array(
117                 '-v', 'Events',
118                 'DEF:avg={file}:value:AVERAGE',
119                 'DEF:min={file}:value:MIN',
120                 'DEF:max={file}:value:MAX',
121                 "AREA:max#$HalfBlue",
122                 "AREA:min#$Canvas",
123                 "LINE1:avg#$FullBlue:Percent",
124                 'GPRINT:min:MIN:%6.2lf%% Min,',
125                 'GPRINT:avg:AVERAGE:%6.2lf%% Avg,',
126                 'GPRINT:max:MAX:%6.2lf%% Max,',
127                 'GPRINT:avg:LAST:%6.2lf%% Last\l');
128                 $GraphDefs['cpu'] = array(
129                 '-v', 'CPU load',
130                 'DEF:avg={file}:value:AVERAGE',
131                 'DEF:min={file}:value:MIN',
132                 'DEF:max={file}:value:MAX',
133                 "AREA:max#$HalfBlue",
134                 "AREA:min#$Canvas",
135                 "LINE1:avg#$FullBlue:Percent",
136                 'GPRINT:min:MIN:%6.2lf%% Min,',
137                 'GPRINT:avg:AVERAGE:%6.2lf%% Avg,',
138                 'GPRINT:max:MAX:%6.2lf%% Max,',
139                 'GPRINT:avg:LAST:%6.2lf%% Last\l');
140         $GraphDefs['current'] = array(
141                 '-v', 'Ampere',
142                 'DEF:avg={file}:value:AVERAGE',
143                 'DEF:min={file}:value:MIN',
144                 'DEF:max={file}:value:MAX',
145                 "AREA:max#$HalfBlue",
146                 "AREA:min#$Canvas",
147                 "LINE1:avg#$FullBlue:Current",
148                 'GPRINT:min:MIN:%5.1lf%sA Min,',
149                 'GPRINT:avg:AVERAGE:%5.1lf%sA Avg,',
150                 'GPRINT:max:MAX:%5.1lf%sA Max,',
151                 'GPRINT:avg:LAST:%5.1lf%sA Last\l');
152         $GraphDefs['df'] = array(
153                 '-v', 'Percent', '-l', '0',
154                 'DEF:free_avg={file}:free:AVERAGE',
155                 'DEF:free_min={file}:free:MIN',
156                 'DEF:free_max={file}:free:MAX',
157                 'DEF:used_avg={file}:used:AVERAGE',
158                 'DEF:used_min={file}:used:MIN',
159                 'DEF:used_max={file}:used:MAX',
160                 'CDEF:total=free_avg,used_avg,+',
161                 'CDEF:free_pct=100,free_avg,*,total,/',
162                 'CDEF:used_pct=100,used_avg,*,total,/',
163                 'CDEF:free_acc=free_pct,used_pct,+',
164                 'CDEF:used_acc=used_pct',
165                 "AREA:free_acc#$HalfGreen",
166                 "AREA:used_acc#$HalfRed",
167                 "LINE1:free_acc#$FullGreen:Free",
168                 'GPRINT:free_min:MIN:%5.1lf%sB Min,',
169                 'GPRINT:free_avg:AVERAGE:%5.1lf%sB Avg,',
170                 'GPRINT:free_max:MAX:%5.1lf%sB Max,',
171                 'GPRINT:free_avg:LAST:%5.1lf%sB Last\l',
172                 "LINE1:used_acc#$FullRed:Used",
173                 'GPRINT:used_min:MIN:%5.1lf%sB Min,',
174                 'GPRINT:used_avg:AVERAGE:%5.1lf%sB Avg,',
175                 'GPRINT:used_max:MAX:%5.1lf%sB Max,',
176                 'GPRINT:used_avg:LAST:%5.1lf%sB Last\l');
177         $GraphDefs['disk'] = array(
178                 'DEF:rtime_avg={file}:rtime:AVERAGE',
179                 'DEF:rtime_min={file}:rtime:MIN',
180                 'DEF:rtime_max={file}:rtime:MAX',
181                 'DEF:wtime_avg={file}:wtime:AVERAGE',
182                 'DEF:wtime_min={file}:wtime:MIN',
183                 'DEF:wtime_max={file}:wtime:MAX',
184                 'CDEF:rtime_avg_ms=rtime_avg,1000,/',
185                 'CDEF:rtime_min_ms=rtime_min,1000,/',
186                 'CDEF:rtime_max_ms=rtime_max,1000,/',
187                 'CDEF:wtime_avg_ms=wtime_avg,1000,/',
188                 'CDEF:wtime_min_ms=wtime_min,1000,/',
189                 'CDEF:wtime_max_ms=wtime_max,1000,/',
190                 'CDEF:total_avg_ms=rtime_avg_ms,wtime_avg_ms,+',
191                 'CDEF:total_min_ms=rtime_min_ms,wtime_min_ms,+',
192                 'CDEF:total_max_ms=rtime_max_ms,wtime_max_ms,+',
193                 "AREA:total_max_ms#$HalfRed",
194                 "AREA:total_min_ms#$Canvas",
195                 "LINE1:wtime_avg_ms#$FullGreen:Write",
196                 'GPRINT:wtime_min_ms:MIN:%5.1lf%s Min,',
197                 'GPRINT:wtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
198                 'GPRINT:wtime_max_ms:MAX:%5.1lf%s Max,',
199                 'GPRINT:wtime_avg_ms:LAST:%5.1lf%s Last\n',
200                 "LINE1:rtime_avg_ms#$FullBlue:Read ",
201                 'GPRINT:rtime_min_ms:MIN:%5.1lf%s Min,',
202                 'GPRINT:rtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
203                 'GPRINT:rtime_max_ms:MAX:%5.1lf%s Max,',
204                 'GPRINT:rtime_avg_ms:LAST:%5.1lf%s Last\n',
205                 "LINE1:total_avg_ms#$FullRed:Total",
206                 'GPRINT:total_min_ms:MIN:%5.1lf%s Min,',
207                 'GPRINT:total_avg_ms:AVERAGE:%5.1lf%s Avg,',
208                 'GPRINT:total_max_ms:MAX:%5.1lf%s Max,',
209                 'GPRINT:total_avg_ms:LAST:%5.1lf%s Last');
210         $GraphDefs['disk_octets'] = array(
211                 '-v', 'Bytes/s', '--units=si',
212                 'DEF:out_min={file}:write:MIN',
213                 'DEF:out_avg={file}:write:AVERAGE',
214                 'DEF:out_max={file}:write:MAX',
215                 'DEF:inc_min={file}:read:MIN',
216                 'DEF:inc_avg={file}:read:AVERAGE',
217                 'DEF:inc_max={file}:read:MAX',
218                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
219                 'CDEF:mytime=out_avg,TIME,TIME,IF',
220                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
221                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
222                 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
223                 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
224                 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
225                 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
226                 "AREA:out_avg#$HalfGreen",
227                 "AREA:inc_avg#$HalfBlue",
228                 "AREA:overlap#$HalfBlueGreen",
229                 "LINE1:out_avg#$FullGreen:Written",
230                 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
231                 'GPRINT:out_max:MAX:%5.1lf%s Max,',
232                 'GPRINT:out_avg:LAST:%5.1lf%s Last',
233                 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
234                 "LINE1:inc_avg#$FullBlue:Read   ",
235                 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
236                 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
237                 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
238                 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
239         $GraphDefs['disk_merged'] = array(
240                 '-v', 'Merged Ops/s', '--units=si',
241                 'DEF:out_min={file}:write:MIN',
242                 'DEF:out_avg={file}:write:AVERAGE',
243                 'DEF:out_max={file}:write:MAX',
244                 'DEF:inc_min={file}:read:MIN',
245                 'DEF:inc_avg={file}:read:AVERAGE',
246                 'DEF:inc_max={file}:read:MAX',
247                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
248                 "AREA:out_avg#$HalfGreen",
249                 "AREA:inc_avg#$HalfBlue",
250                 "AREA:overlap#$HalfBlueGreen",
251                 "LINE1:out_avg#$FullGreen:Written",
252                 'GPRINT:out_avg:AVERAGE:%6.2lf Avg,',
253                 'GPRINT:out_max:MAX:%6.2lf Max,',
254                 'GPRINT:out_avg:LAST:%6.2lf Last\l',
255                 "LINE1:inc_avg#$FullBlue:Read   ",
256                 'GPRINT:inc_avg:AVERAGE:%6.2lf Avg,',
257                 'GPRINT:inc_max:MAX:%6.2lf Max,',
258                 'GPRINT:inc_avg:LAST:%6.2lf Last\l');
259                 $GraphDefs['disk_ops'] = array(
260                 '-v', 'Ops/s', '--units=si',
261                 'DEF:out_min={file}:write:MIN',
262                 'DEF:out_avg={file}:write:AVERAGE',
263                 'DEF:out_max={file}:write:MAX',
264                 'DEF:inc_min={file}:read:MIN',
265                 'DEF:inc_avg={file}:read:AVERAGE',
266                 'DEF:inc_max={file}:read:MAX',
267                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
268                 "AREA:out_avg#$HalfGreen",
269                 "AREA:inc_avg#$HalfBlue",
270                 "AREA:overlap#$HalfBlueGreen",
271                 "LINE1:out_avg#$FullGreen:Written",
272                 'GPRINT:out_avg:AVERAGE:%6.2lf Avg,',
273                 'GPRINT:out_max:MAX:%6.2lf Max,',
274                 'GPRINT:out_avg:LAST:%6.2lf Last\l',
275                 "LINE1:inc_avg#$FullBlue:Read   ",
276                 'GPRINT:inc_avg:AVERAGE:%6.2lf Avg,',
277                 'GPRINT:inc_max:MAX:%6.2lf Max,',
278                 'GPRINT:inc_avg:LAST:%6.2lf Last\l');
279         $GraphDefs['disk_time'] = array(
280                 '-v', 'Seconds/s',
281                 'DEF:out_min_raw={file}:write:MIN',
282                 'DEF:out_avg_raw={file}:write:AVERAGE',
283                 'DEF:out_max_raw={file}:write:MAX',
284                 'DEF:inc_min_raw={file}:read:MIN',
285                 'DEF:inc_avg_raw={file}:read:AVERAGE',
286                 'DEF:inc_max_raw={file}:read:MAX',
287                 'CDEF:out_min=out_min_raw,1000,/',
288                 'CDEF:out_avg=out_avg_raw,1000,/',
289                 'CDEF:out_max=out_max_raw,1000,/',
290                 'CDEF:inc_min=inc_min_raw,1000,/',
291                 'CDEF:inc_avg=inc_avg_raw,1000,/',
292                 'CDEF:inc_max=inc_max_raw,1000,/',
293                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
294                 "AREA:out_avg#$HalfGreen",
295                 "AREA:inc_avg#$HalfBlue",
296                 "AREA:overlap#$HalfBlueGreen",
297                 "LINE1:out_avg#$FullGreen:Written",
298                 'GPRINT:out_avg:AVERAGE:%5.1lf%ss Avg,',
299                 'GPRINT:out_max:MAX:%5.1lf%ss Max,',
300                 'GPRINT:out_avg:LAST:%5.1lf%ss Last\l',
301                 "LINE1:inc_avg#$FullBlue:Read   ",
302                 'GPRINT:inc_avg:AVERAGE:%5.1lf%ss Avg,',
303                 'GPRINT:inc_max:MAX:%5.1lf%ss Max,',
304                 'GPRINT:inc_avg:LAST:%5.1lf%ss Last\l');
305         $GraphDefs['dns_traffic'] = array(
306                 'DEF:rsp_min_raw={file}:responses:MIN',
307                 'DEF:rsp_avg_raw={file}:responses:AVERAGE',
308                 'DEF:rsp_max_raw={file}:responses:MAX',
309                 'DEF:qry_min_raw={file}:queries:MIN',
310                 'DEF:qry_avg_raw={file}:queries:AVERAGE',
311                 'DEF:qry_max_raw={file}:queries:MAX',
312                 'CDEF:rsp_min=rsp_min_raw,8,*',
313                 'CDEF:rsp_avg=rsp_avg_raw,8,*',
314                 'CDEF:rsp_max=rsp_max_raw,8,*',
315                 'CDEF:qry_min=qry_min_raw,8,*',
316                 'CDEF:qry_avg=qry_avg_raw,8,*',
317                 'CDEF:qry_max=qry_max_raw,8,*',
318                 'CDEF:overlap=rsp_avg,qry_avg,GT,qry_avg,rsp_avg,IF',
319                 'CDEF:mytime=rsp_avg_raw,TIME,TIME,IF',
320                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
321                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
322                 'CDEF:rsp_avg_sample=rsp_avg_raw,UN,0,rsp_avg_raw,IF,sample_len,*',
323                 'CDEF:rsp_avg_sum=PREV,UN,0,PREV,IF,rsp_avg_sample,+',
324                 'CDEF:qry_avg_sample=qry_avg_raw,UN,0,qry_avg_raw,IF,sample_len,*',
325                 'CDEF:qry_avg_sum=PREV,UN,0,PREV,IF,qry_avg_sample,+',
326                 "AREA:rsp_avg#$HalfGreen",
327                 "AREA:qry_avg#$HalfBlue",
328                 "AREA:overlap#$HalfBlueGreen",
329                 "LINE1:rsp_avg#$FullGreen:Responses",
330                 'GPRINT:rsp_avg:AVERAGE:%5.1lf%s Avg,',
331                 'GPRINT:rsp_max:MAX:%5.1lf%s Max,',
332                 'GPRINT:rsp_avg:LAST:%5.1lf%s Last',
333                 'GPRINT:rsp_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
334                 "LINE1:qry_avg#$FullBlue:Queries  ",
335 //                      'GPRINT:qry_min:MIN:%5.1lf %s Min,',
336                 'GPRINT:qry_avg:AVERAGE:%5.1lf%s Avg,',
337                 'GPRINT:qry_max:MAX:%5.1lf%s Max,',
338                 'GPRINT:qry_avg:LAST:%5.1lf%s Last',
339                 'GPRINT:qry_avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
340         $GraphDefs['email_count'] = array(
341                 '-v', 'Mails',
342                 'DEF:avg={file}:value:AVERAGE',
343                 'DEF:min={file}:value:MIN',
344                 'DEF:max={file}:value:MAX',
345                 "AREA:max#$HalfMagenta",
346                 "AREA:min#$Canvas",
347                 "LINE1:avg#$FullMagenta:Count ",
348                 'GPRINT:min:MIN:%4.1lf Min,',
349                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
350                 'GPRINT:max:MAX:%4.1lf Max,',
351                 'GPRINT:avg:LAST:%4.1lf Last\l');
352         $GraphDefs['files'] = $GraphDefs['email_count'];
353         $GraphDefs['email_size'] = array(
354                 '-v', 'Bytes',
355                 'DEF:avg={file}:value:AVERAGE',
356                 'DEF:min={file}:value:MIN',
357                 'DEF:max={file}:value:MAX',
358                 "AREA:max#$HalfMagenta",
359                 "AREA:min#$Canvas",
360                 "LINE1:avg#$FullMagenta:Count ",
361                 'GPRINT:min:MIN:%4.1lf Min,',
362                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
363                 'GPRINT:max:MAX:%4.1lf Max,',
364                 'GPRINT:avg:LAST:%4.1lf Last\l');
365         $GraphDefs['bytes'] = $GraphDefs['email_size'];
366         $GraphDefs['spam_score'] = array(
367                 '-v', 'Score',
368                 'DEF:avg={file}:value:AVERAGE',
369                 'DEF:min={file}:value:MIN',
370                 'DEF:max={file}:value:MAX',
371                 "AREA:max#$HalfBlue",
372                 "AREA:min#$Canvas",
373                 "LINE1:avg#$FullBlue:Score ",
374                 'GPRINT:min:MIN:%4.1lf Min,',
375                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
376                 'GPRINT:max:MAX:%4.1lf Max,',
377                 'GPRINT:avg:LAST:%4.1lf Last\l');
378         $GraphDefs['spam_check'] = array(
379                 'DEF:avg={file}:hits:AVERAGE',
380                 'DEF:min={file}:hits:MIN',
381                 'DEF:max={file}:hits:MAX',
382                 "AREA:max#$HalfMagenta",
383                 "AREA:min#$Canvas",
384                 "LINE1:avg#$FullMagenta:Count ",
385                 'GPRINT:min:MIN:%4.1lf Min,',
386                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
387                 'GPRINT:max:MAX:%4.1lf Max,',
388                 'GPRINT:avg:LAST:%4.1lf Last\l');
389         $GraphDefs['entropy'] = array(
390                 '-v', 'Bits',
391                 'DEF:avg={file}:entropy:AVERAGE',
392                 'DEF:min={file}:entropy:MIN',
393                 'DEF:max={file}:entropy:MAX',
394                 "AREA:max#$HalfBlue",
395                 "AREA:min#$Canvas",
396                 "LINE1:avg#$FullBlue:Bits",
397                 'GPRINT:min:MIN:%4.0lfbit Min,',
398                 'GPRINT:avg:AVERAGE:%4.0lfbit Avg,',
399                 'GPRINT:max:MAX:%4.0lfbit Max,',
400                 'GPRINT:avg:LAST:%4.0lfbit Last\l');
401         $GraphDefs['fanspeed'] = array(
402                 '-v', 'RPM',
403                 'DEF:avg={file}:value:AVERAGE',
404                 'DEF:min={file}:value:MIN',
405                 'DEF:max={file}:value:MAX',
406                 "AREA:max#$HalfMagenta",
407                 "AREA:min#$Canvas",
408                 "LINE1:avg#$FullMagenta:RPM",
409                 'GPRINT:min:MIN:%4.1lf Min,',
410                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
411                 'GPRINT:max:MAX:%4.1lf Max,',
412                 'GPRINT:avg:LAST:%4.1lf Last\l');
413         $GraphDefs['frequency'] = array(
414                 '-v', 'Hertz',
415                 'DEF:avg={file}:frequency:AVERAGE',
416                 'DEF:min={file}:frequency:MIN',
417                 'DEF:max={file}:frequency:MAX',
418                 "AREA:max#$HalfBlue",
419                 "AREA:min#$Canvas",
420                 "LINE1:avg#$FullBlue:Frequency [Hz]",
421                 'GPRINT:min:MIN:%4.1lf Min,',
422                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
423                 'GPRINT:max:MAX:%4.1lf Max,',
424                 'GPRINT:avg:LAST:%4.1lf Last\l');
425         $GraphDefs['frequency_offset'] = array( // NTPd
426                 'DEF:ppm_avg={file}:ppm:AVERAGE',
427                 'DEF:ppm_min={file}:ppm:MIN',
428                 'DEF:ppm_max={file}:ppm:MAX',
429                 "AREA:ppm_max#$HalfBlue",
430                 "AREA:ppm_min#$Canvas",
431                 "LINE1:ppm_avg#$FullBlue:{inst}",
432                 'GPRINT:ppm_min:MIN:%5.2lf Min,',
433                 'GPRINT:ppm_avg:AVERAGE:%5.2lf Avg,',
434                 'GPRINT:ppm_max:MAX:%5.2lf Max,',
435                 'GPRINT:ppm_avg:LAST:%5.2lf Last');
436         $GraphDefs['gauge'] = array(
437                 '-v', 'Exec value',
438                 'DEF:temp_avg={file}:value:AVERAGE',
439                 'DEF:temp_min={file}:value:MIN',
440                 'DEF:temp_max={file}:value:MAX',
441                 "AREA:temp_max#$HalfBlue",
442                 "AREA:temp_min#$Canvas",
443                 "LINE1:temp_avg#$FullBlue:Exec value",
444                 'GPRINT:temp_min:MIN:%6.2lf Min,',
445                 'GPRINT:temp_avg:AVERAGE:%6.2lf Avg,',
446                 'GPRINT:temp_max:MAX:%6.2lf Max,',
447                 'GPRINT:temp_avg:LAST:%6.2lf Last\l');
448         $GraphDefs['hddtemp'] = array(
449                 '-v', '°C',
450                 'DEF:temp_avg={file}:value:AVERAGE',
451                 'DEF:temp_min={file}:value:MIN',
452                 'DEF:temp_max={file}:value:MAX',
453                 "AREA:temp_max#$HalfRed",
454                 "AREA:temp_min#$Canvas",
455                 "LINE1:temp_avg#$FullRed:Temperature",
456                 'GPRINT:temp_min:MIN:%4.1lf Min,',
457                 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
458                 'GPRINT:temp_max:MAX:%4.1lf Max,',
459                 'GPRINT:temp_avg:LAST:%4.1lf Last\l');
460         $GraphDefs['humidity'] = array(
461                 '-v', 'Percent',
462                 'DEF:temp_avg={file}:value:AVERAGE',
463                 'DEF:temp_min={file}:value:MIN',
464                 'DEF:temp_max={file}:value:MAX',
465                 "AREA:temp_max#$HalfGreen",
466                 "AREA:temp_min#$Canvas",
467                 "LINE1:temp_avg#$FullGreen:Temperature",
468                 'GPRINT:temp_min:MIN:%4.1lf%% Min,',
469                 'GPRINT:temp_avg:AVERAGE:%4.1lf%% Avg,',
470                 'GPRINT:temp_max:MAX:%4.1lf%% Max,',
471                 'GPRINT:temp_avg:LAST:%4.1lf%% Last\l');
472         $GraphDefs['if_errors'] = array(
473                 '-v', 'Errors/s', '--units=si',
474                 'DEF:tx_min={file}:tx:MIN',
475                 'DEF:tx_avg={file}:tx:AVERAGE',
476                 'DEF:tx_max={file}:tx:MAX',
477                 'DEF:rx_min={file}:rx:MIN',
478                 'DEF:rx_avg={file}:rx:AVERAGE',
479                 'DEF:rx_max={file}:rx:MAX',
480                 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
481                 'CDEF:mytime=tx_avg,TIME,TIME,IF',
482                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
483                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
484                 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
485                 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
486                 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
487                 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
488                 "AREA:tx_avg#$HalfGreen",
489                 "AREA:rx_avg#$HalfBlue",
490                 "AREA:overlap#$HalfBlueGreen",
491                 "LINE1:tx_avg#$FullGreen:TX",
492                 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
493                 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
494                 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
495                 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
496                 "LINE1:rx_avg#$FullBlue:RX",
497 //                      'GPRINT:rx_min:MIN:%5.1lf %s Min,',
498                 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
499                 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
500                 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
501                 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l');
502         $GraphDefs['if_collisions'] = array(
503                 '-v', 'Collisions/s', '--units=si',
504                 'DEF:min_raw={file}:value:MIN',
505                 'DEF:avg_raw={file}:value:AVERAGE',
506                 'DEF:max_raw={file}:value:MAX',
507                 'CDEF:min=min_raw,8,*',
508                 'CDEF:avg=avg_raw,8,*',
509                 'CDEF:max=max_raw,8,*',
510                 "AREA:max#$HalfBlue",
511                 "AREA:min#$Canvas",
512                 "LINE1:avg#$FullBlue:Collisions/s",
513                 'GPRINT:min:MIN:%5.1lf %s Min,',
514                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
515                 'GPRINT:max:MAX:%5.1lf%s Max,',
516                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
517         $GraphDefs['if_dropped'] = array(
518                 '-v', 'Packets/s', '--units=si',
519                 'DEF:tx_min={file}:tx:MIN',
520                 'DEF:tx_avg={file}:tx:AVERAGE',
521                 'DEF:tx_max={file}:tx:MAX',
522                 'DEF:rx_min={file}:rx:MIN',
523                 'DEF:rx_avg={file}:rx:AVERAGE',
524                 'DEF:rx_max={file}:rx:MAX',
525                 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
526                 'CDEF:mytime=tx_avg,TIME,TIME,IF',
527                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
528                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
529                 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
530                 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
531                 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
532                 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
533                 "AREA:tx_avg#$HalfGreen",
534                 "AREA:rx_avg#$HalfBlue",
535                 "AREA:overlap#$HalfBlueGreen",
536                 "LINE1:tx_avg#$FullGreen:TX",
537                 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
538                 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
539                 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
540                 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
541                 "LINE1:rx_avg#$FullBlue:RX",
542 //                      'GPRINT:rx_min:MIN:%5.1lf %s Min,',
543                 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
544                 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
545                 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
546                 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l');
547         $GraphDefs['if_packets'] = array(
548                 '-v', 'Packets/s', '--units=si',
549                 'DEF:tx_min={file}:tx:MIN',
550                 'DEF:tx_avg={file}:tx:AVERAGE',
551                 'DEF:tx_max={file}:tx:MAX',
552                 'DEF:rx_min={file}:rx:MIN',
553                 'DEF:rx_avg={file}:rx:AVERAGE',
554                 'DEF:rx_max={file}:rx:MAX',
555                 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
556                 'CDEF:mytime=tx_avg,TIME,TIME,IF',
557                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
558                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
559                 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
560                 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
561                 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
562                 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
563                 "AREA:tx_avg#$HalfGreen",
564                 "AREA:rx_avg#$HalfBlue",
565                 "AREA:overlap#$HalfBlueGreen",
566                 "LINE1:tx_avg#$FullGreen:TX",
567                 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
568                 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
569                 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
570                 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
571                 "LINE1:rx_avg#$FullBlue:RX",
572 //                      'GPRINT:rx_min:MIN:%5.1lf %s Min,',
573                 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
574                 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
575                 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
576                 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l');
577         $GraphDefs['if_rx_errors'] = array(
578                 '-v', 'Errors/s', '--units=si',
579                 'DEF:min={file}:value:MIN',
580                 'DEF:avg={file}:value:AVERAGE',
581                 'DEF:max={file}:value:MAX',
582                 'CDEF:mytime=avg,TIME,TIME,IF',
583                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
584                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
585                 'CDEF:avg_sample=avg,UN,0,avg,IF,sample_len,*',
586                 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
587                 "AREA:avg#$HalfBlue",
588                 "LINE1:avg#$FullBlue:Errors/s",
589                 'GPRINT:avg:AVERAGE:%3.1lf%s Avg,',
590                 'GPRINT:max:MAX:%3.1lf%s Max,',
591                 'GPRINT:avg:LAST:%3.1lf%s Last',
592                 'GPRINT:avg_sum:LAST:(ca. %2.0lf%s Total)\l');
593         $GraphDefs['ipt_bytes'] = array(
594                 '-v', 'Bits/s',
595                 'DEF:min_raw={file}:value:MIN',
596                 'DEF:avg_raw={file}:value:AVERAGE',
597                 'DEF:max_raw={file}:value:MAX',
598                 'CDEF:min=min_raw,8,*',
599                 'CDEF:avg=avg_raw,8,*',
600                 'CDEF:max=max_raw,8,*',
601                 'CDEF:mytime=avg_raw,TIME,TIME,IF',
602                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
603                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
604                 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
605                 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
606                 "AREA:max#$HalfBlue",
607                 "AREA:min#$Canvas",
608                 "LINE1:avg#$FullBlue:Bits/s",
609 //                      'GPRINT:min:MIN:%5.1lf %s Min,',
610                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
611                 'GPRINT:max:MAX:%5.1lf%s Max,',
612                 'GPRINT:avg:LAST:%5.1lf%s Last',
613                 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
614         $GraphDefs['ipt_packets'] = array(
615                 '-v', 'Packets/s',
616                 'DEF:min_raw={file}:value:MIN',
617                 'DEF:avg_raw={file}:value:AVERAGE',
618                 'DEF:max_raw={file}:value:MAX',
619                 'CDEF:min=min_raw,8,*',
620                 'CDEF:avg=avg_raw,8,*',
621                 'CDEF:max=max_raw,8,*',
622                 "AREA:max#$HalfBlue",
623                 "AREA:min#$Canvas",
624                 "LINE1:avg#$FullBlue:Packets/s",
625                 'GPRINT:min:MIN:%5.1lf %s Min,',
626                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
627                 'GPRINT:max:MAX:%5.1lf%s Max,',
628                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
629         $GraphDefs['irq'] = array(
630                 '-v', 'Issues/s',
631                 'DEF:avg={file}:value:AVERAGE',
632                 'DEF:min={file}:value:MIN',
633                 'DEF:max={file}:value:MAX',
634                 "AREA:max#$HalfBlue",
635                 "AREA:min#$Canvas",
636                 "LINE1:avg#$FullBlue:Issues/s",
637                 'GPRINT:min:MIN:%6.2lf Min,',
638                 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
639                 'GPRINT:max:MAX:%6.2lf Max,',
640                 'GPRINT:avg:LAST:%6.2lf Last\l');
641         $GraphDefs['load'] = array(
642                 '-v', 'System load',
643                 'DEF:s_avg={file}:shortterm:AVERAGE',
644                 'DEF:s_min={file}:shortterm:MIN',
645                 'DEF:s_max={file}:shortterm:MAX',
646                 'DEF:m_avg={file}:midterm:AVERAGE',
647                 'DEF:m_min={file}:midterm:MIN',
648                 'DEF:m_max={file}:midterm:MAX',
649                 'DEF:l_avg={file}:longterm:AVERAGE',
650                 'DEF:l_min={file}:longterm:MIN',
651                 'DEF:l_max={file}:longterm:MAX',
652                 "AREA:s_max#$HalfGreen",
653                 "AREA:s_min#$Canvas",
654                 "LINE1:s_avg#$FullGreen: 1m average",
655                 'GPRINT:s_min:MIN:%4.2lf Min,',
656                 'GPRINT:s_avg:AVERAGE:%4.2lf Avg,',
657                 'GPRINT:s_max:MAX:%4.2lf Max,',
658                 'GPRINT:s_avg:LAST:%4.2lf Last\n',
659                 "LINE1:m_avg#$FullBlue: 5m average",
660                 'GPRINT:m_min:MIN:%4.2lf Min,',
661                 'GPRINT:m_avg:AVERAGE:%4.2lf Avg,',
662                 'GPRINT:m_max:MAX:%4.2lf Max,',
663                 'GPRINT:m_avg:LAST:%4.2lf Last\n',
664                 "LINE1:l_avg#$FullRed:15m average",
665                 'GPRINT:l_min:MIN:%4.2lf Min,',
666                 'GPRINT:l_avg:AVERAGE:%4.2lf Avg,',
667                 'GPRINT:l_max:MAX:%4.2lf Max,',
668                 'GPRINT:l_avg:LAST:%4.2lf Last');
669         $GraphDefs['load_percent'] = array(
670                 'DEF:avg={file}:percent:AVERAGE',
671                 'DEF:min={file}:percent:MIN',
672                 'DEF:max={file}:percent:MAX',
673                 "AREA:max#$HalfBlue",
674                 "AREA:min#$Canvas",
675                 "LINE1:avg#$FullBlue:Load",
676                 'GPRINT:min:MIN:%5.1lf%s%% Min,',
677                 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
678                 'GPRINT:max:MAX:%5.1lf%s%% Max,',
679                 'GPRINT:avg:LAST:%5.1lf%s%% Last\l');
680         $GraphDefs['mails'] = array(
681                 'DEF:rawgood={file}:good:AVERAGE',
682                 'DEF:rawspam={file}:spam:AVERAGE',
683                 'CDEF:good=rawgood,UN,0,rawgood,IF',
684                 'CDEF:spam=rawspam,UN,0,rawspam,IF',
685                 'CDEF:negspam=spam,-1,*',
686                 "AREA:good#$HalfGreen",
687                 "LINE1:good#$FullGreen:Good mails",
688                 'GPRINT:good:AVERAGE:%4.1lf Avg,',
689                 'GPRINT:good:MAX:%4.1lf Max,',
690                 'GPRINT:good:LAST:%4.1lf Last\n',
691                 "AREA:negspam#$HalfRed",
692                 "LINE1:negspam#$FullRed:Spam mails",
693                 'GPRINT:spam:AVERAGE:%4.1lf Avg,',
694                 'GPRINT:spam:MAX:%4.1lf Max,',
695                 'GPRINT:spam:LAST:%4.1lf Last',
696                 'HRULE:0#000000');
697         $GraphDefs['memory'] = array(
698                 '-b', '1024', '-v', 'Bytes',
699                 'DEF:avg={file}:value:AVERAGE',
700                 'DEF:min={file}:value:MIN',
701                 'DEF:max={file}:value:MAX',
702                 "AREA:max#$HalfBlue",
703                 "AREA:min#$Canvas",
704                 "LINE1:avg#$FullBlue:Memory",
705                 'GPRINT:min:MIN:%5.1lf%sbyte Min,',
706                 'GPRINT:avg:AVERAGE:%5.1lf%sbyte Avg,',
707                 'GPRINT:max:MAX:%5.1lf%sbyte Max,',
708                 'GPRINT:avg:LAST:%5.1lf%sbyte Last\l');
709         $GraphDefs['old_memory'] = array(
710                 'DEF:used_avg={file}:used:AVERAGE',
711                 'DEF:free_avg={file}:free:AVERAGE',
712                 'DEF:buffers_avg={file}:buffers:AVERAGE',
713                 'DEF:cached_avg={file}:cached:AVERAGE',
714                 'DEF:used_min={file}:used:MIN',
715                 'DEF:free_min={file}:free:MIN',
716                 'DEF:buffers_min={file}:buffers:MIN',
717                 'DEF:cached_min={file}:cached:MIN',
718                 'DEF:used_max={file}:used:MAX',
719                 'DEF:free_max={file}:free:MAX',
720                 'DEF:buffers_max={file}:buffers:MAX',
721                 'DEF:cached_max={file}:cached:MAX',
722                 'CDEF:cached_avg_nn=cached_avg,UN,0,cached_avg,IF',
723                 'CDEF:buffers_avg_nn=buffers_avg,UN,0,buffers_avg,IF',
724                 'CDEF:free_cached_buffers_used=free_avg,cached_avg_nn,+,buffers_avg_nn,+,used_avg,+',
725                 'CDEF:cached_buffers_used=cached_avg,buffers_avg_nn,+,used_avg,+',
726                 'CDEF:buffers_used=buffers_avg,used_avg,+',
727                 "AREA:free_cached_buffers_used#$HalfGreen",
728                 "AREA:cached_buffers_used#$HalfBlue",
729                 "AREA:buffers_used#$HalfYellow",
730                 "AREA:used_avg#$HalfRed",
731                 "LINE1:free_cached_buffers_used#$FullGreen:Free        ",
732                 'GPRINT:free_min:MIN:%5.1lf%s Min,',
733                 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
734                 'GPRINT:free_max:MAX:%5.1lf%s Max,',
735                 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
736                 "LINE1:cached_buffers_used#$FullBlue:Page cache  ",
737                 'GPRINT:cached_min:MIN:%5.1lf%s Min,',
738                 'GPRINT:cached_avg:AVERAGE:%5.1lf%s Avg,',
739                 'GPRINT:cached_max:MAX:%5.1lf%s Max,',
740                 'GPRINT:cached_avg:LAST:%5.1lf%s Last\n',
741                 "LINE1:buffers_used#$FullYellow:Buffer cache",
742                 'GPRINT:buffers_min:MIN:%5.1lf%s Min,',
743                 'GPRINT:buffers_avg:AVERAGE:%5.1lf%s Avg,',
744                 'GPRINT:buffers_max:MAX:%5.1lf%s Max,',
745                 'GPRINT:buffers_avg:LAST:%5.1lf%s Last\n',
746                 "LINE1:used_avg#$FullRed:Used        ",
747                 'GPRINT:used_min:MIN:%5.1lf%s Min,',
748                 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
749                 'GPRINT:used_max:MAX:%5.1lf%s Max,',
750                 'GPRINT:used_avg:LAST:%5.1lf%s Last');
751         $GraphDefs['mysql_commands'] = array(
752                 '-v', 'Issues/s',
753                 "DEF:val_avg={file}:value:AVERAGE",
754                 "DEF:val_min={file}:value:MIN",
755                 "DEF:val_max={file}:value:MAX",
756                 "AREA:val_max#$HalfBlue",
757                 "AREA:val_min#$Canvas",
758                 "LINE1:val_avg#$FullBlue:Issues/s",
759                 'GPRINT:val_min:MIN:%5.2lf Min,',
760                 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
761                 'GPRINT:val_max:MAX:%5.2lf Max,',
762                 'GPRINT:val_avg:LAST:%5.2lf Last');
763         $GraphDefs['mysql_handler'] = array(
764                 '-v', 'Issues/s',
765                 "DEF:val_avg={file}:value:AVERAGE",
766                 "DEF:val_min={file}:value:MIN",
767                 "DEF:val_max={file}:value:MAX",
768                 "AREA:val_max#$HalfBlue",
769                 "AREA:val_min#$Canvas",
770                 "LINE1:val_avg#$FullBlue:Issues/s",
771                 'GPRINT:val_min:MIN:%5.2lf Min,',
772                 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
773                 'GPRINT:val_max:MAX:%5.2lf Max,',
774                 'GPRINT:val_avg:LAST:%5.2lf Last');
775         $GraphDefs['mysql_octets'] = array(
776                 '-v', 'Bits/s',
777                 'DEF:out_min={file}:tx:MIN',
778                 'DEF:out_avg={file}:tx:AVERAGE',
779                 'DEF:out_max={file}:tx:MAX',
780                 'DEF:inc_min={file}:rx:MIN',
781                 'DEF:inc_avg={file}:rx:AVERAGE',
782                 'DEF:inc_max={file}:rx:MAX',
783                 'CDEF:mytime=out_avg,TIME,TIME,IF',
784                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
785                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
786                 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
787                 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
788                 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
789                 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
790                 'CDEF:out_bit_min=out_min,8,*',
791                 'CDEF:out_bit_avg=out_avg,8,*',
792                 'CDEF:out_bit_max=out_max,8,*',
793                 'CDEF:inc_bit_min=inc_min,8,*',
794                 'CDEF:inc_bit_avg=inc_avg,8,*',
795                 'CDEF:inc_bit_max=inc_max,8,*',
796                 'CDEF:overlap=out_bit_avg,inc_bit_avg,GT,inc_bit_avg,out_bit_avg,IF',
797                 "AREA:out_bit_avg#$HalfGreen",
798                 "AREA:inc_bit_avg#$HalfBlue",
799                 "AREA:overlap#$HalfBlueGreen",
800                 "LINE1:out_bit_avg#$FullGreen:Written",
801                 'GPRINT:out_bit_avg:AVERAGE:%5.1lf%s Avg,',
802                 'GPRINT:out_bit_max:MAX:%5.1lf%s Max,',
803                 'GPRINT:out_bit_avg:LAST:%5.1lf%s Last',
804                 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
805                 "LINE1:inc_bit_avg#$FullBlue:Read   ",
806                 'GPRINT:inc_bit_avg:AVERAGE:%5.1lf%s Avg,',
807                 'GPRINT:inc_bit_max:MAX:%5.1lf%s Max,',
808                 'GPRINT:inc_bit_avg:LAST:%5.1lf%s Last',
809                 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
810         $GraphDefs['mysql_qcache'] = array(
811                 '-v', 'Queries/s',
812                 "DEF:hits_min={file}:hits:MIN",
813                 "DEF:hits_avg={file}:hits:AVERAGE",
814                 "DEF:hits_max={file}:hits:MAX",
815                 "DEF:inserts_min={file}:inserts:MIN",
816                 "DEF:inserts_avg={file}:inserts:AVERAGE",
817                 "DEF:inserts_max={file}:inserts:MAX",
818                 "DEF:not_cached_min={file}:not_cached:MIN",
819                 "DEF:not_cached_avg={file}:not_cached:AVERAGE",
820                 "DEF:not_cached_max={file}:not_cached:MAX",
821                 "DEF:lowmem_prunes_min={file}:lowmem_prunes:MIN",
822                 "DEF:lowmem_prunes_avg={file}:lowmem_prunes:AVERAGE",
823                 "DEF:lowmem_prunes_max={file}:lowmem_prunes:MAX",
824                 "DEF:queries_min={file}:queries_in_cache:MIN",
825                 "DEF:queries_avg={file}:queries_in_cache:AVERAGE",
826                 "DEF:queries_max={file}:queries_in_cache:MAX",
827                 "CDEF:unknown=queries_avg,UNKN,+",
828                 "CDEF:not_cached_agg=hits_avg,inserts_avg,+,not_cached_avg,+",
829                 "CDEF:inserts_agg=hits_avg,inserts_avg,+",
830                 "CDEF:hits_agg=hits_avg",
831                 "AREA:not_cached_agg#$HalfYellow",
832                 "AREA:inserts_agg#$HalfBlue",
833                 "AREA:hits_agg#$HalfGreen",
834                 "LINE1:not_cached_agg#$FullYellow:Not Cached      ",
835                 'GPRINT:not_cached_min:MIN:%5.2lf Min,',
836                 'GPRINT:not_cached_avg:AVERAGE:%5.2lf Avg,',
837                 'GPRINT:not_cached_max:MAX:%5.2lf Max,',
838                 'GPRINT:not_cached_avg:LAST:%5.2lf Last\l',
839                 "LINE1:inserts_agg#$FullBlue:Inserts         ",
840                 'GPRINT:inserts_min:MIN:%5.2lf Min,',
841                 'GPRINT:inserts_avg:AVERAGE:%5.2lf Avg,',
842                 'GPRINT:inserts_max:MAX:%5.2lf Max,',
843                 'GPRINT:inserts_avg:LAST:%5.2lf Last\l',
844                 "LINE1:hits_agg#$FullGreen:Hits            ",
845                 'GPRINT:hits_min:MIN:%5.2lf Min,',
846                 'GPRINT:hits_avg:AVERAGE:%5.2lf Avg,',
847                 'GPRINT:hits_max:MAX:%5.2lf Max,',
848                 'GPRINT:hits_avg:LAST:%5.2lf Last\l',
849                 "LINE1:lowmem_prunes_avg#$FullRed:Lowmem Prunes   ",
850                 'GPRINT:lowmem_prunes_min:MIN:%5.2lf Min,',
851                 'GPRINT:lowmem_prunes_avg:AVERAGE:%5.2lf Avg,',
852                 'GPRINT:lowmem_prunes_max:MAX:%5.2lf Max,',
853                 'GPRINT:lowmem_prunes_avg:LAST:%5.2lf Last\l',
854                 "LINE1:unknown#$Canvas:Queries in cache",
855                 'GPRINT:queries_min:MIN:%5.0lf Min,',
856                 'GPRINT:queries_avg:AVERAGE:%5.0lf Avg,',
857                 'GPRINT:queries_max:MAX:%5.0lf Max,',
858                 'GPRINT:queries_avg:LAST:%5.0lf Last\l');
859         $GraphDefs['mysql_threads'] = array(
860                 '-v', 'Threads',
861                 "DEF:running_min={file}:running:MIN",
862                 "DEF:running_avg={file}:running:AVERAGE",
863                 "DEF:running_max={file}:running:MAX",
864                 "DEF:connected_min={file}:connected:MIN",
865                 "DEF:connected_avg={file}:connected:AVERAGE",
866                 "DEF:connected_max={file}:connected:MAX",
867                 "DEF:cached_min={file}:cached:MIN",
868                 "DEF:cached_avg={file}:cached:AVERAGE",
869                 "DEF:cached_max={file}:cached:MAX",
870                 "DEF:created_min={file}:created:MIN",
871                 "DEF:created_avg={file}:created:AVERAGE",
872                 "DEF:created_max={file}:created:MAX",
873                 "CDEF:unknown=created_avg,UNKN,+",
874                 "CDEF:cached_agg=connected_avg,cached_avg,+",
875                 "AREA:cached_agg#$HalfGreen",
876                 "AREA:connected_avg#$HalfBlue",
877                 "AREA:running_avg#$HalfRed",
878                 "LINE1:cached_agg#$FullGreen:Cached   ",
879                 'GPRINT:cached_min:MIN:%5.1lf Min,',
880                 'GPRINT:cached_avg:AVERAGE:%5.1lf Avg,',
881                 'GPRINT:cached_max:MAX:%5.1lf Max,',
882                 'GPRINT:cached_avg:LAST:%5.1lf Last\l',
883                 "LINE1:connected_avg#$FullBlue:Connected",
884                 'GPRINT:connected_min:MIN:%5.1lf Min,',
885                 'GPRINT:connected_avg:AVERAGE:%5.1lf Avg,',
886                 'GPRINT:connected_max:MAX:%5.1lf Max,',
887                 'GPRINT:connected_avg:LAST:%5.1lf Last\l',
888                 "LINE1:running_avg#$FullRed:Running  ",
889                 'GPRINT:running_min:MIN:%5.1lf Min,',
890                 'GPRINT:running_avg:AVERAGE:%5.1lf Avg,',
891                 'GPRINT:running_max:MAX:%5.1lf Max,',
892                 'GPRINT:running_avg:LAST:%5.1lf Last\l',
893                 "LINE1:unknown#$Canvas:Created  ",
894                 'GPRINT:created_min:MIN:%5.0lf Min,',
895                 'GPRINT:created_avg:AVERAGE:%5.0lf Avg,',
896                 'GPRINT:created_max:MAX:%5.0lf Max,',
897                 'GPRINT:created_avg:LAST:%5.0lf Last\l');
898         $GraphDefs['nfs_procedure'] = array(
899                 '-v', 'Issues/s',
900                 'DEF:avg={file}:value:AVERAGE',
901                 'DEF:min={file}:value:MIN',
902                 'DEF:max={file}:value:MAX',
903                 "AREA:max#$HalfBlue",
904                 "AREA:min#$Canvas",
905                 "LINE1:avg#$FullBlue:Issues/s",
906                 'GPRINT:min:MIN:%6.2lf Min,',
907                 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
908                 'GPRINT:max:MAX:%6.2lf Max,',
909                 'GPRINT:avg:LAST:%6.2lf Last\l');
910         $GraphDefs['nfs3_procedures'] = array(
911                 "DEF:null_avg={file}:null:AVERAGE",
912                 "DEF:getattr_avg={file}:getattr:AVERAGE",
913                 "DEF:setattr_avg={file}:setattr:AVERAGE",
914                 "DEF:lookup_avg={file}:lookup:AVERAGE",
915                 "DEF:access_avg={file}:access:AVERAGE",
916                 "DEF:readlink_avg={file}:readlink:AVERAGE",
917                 "DEF:read_avg={file}:read:AVERAGE",
918                 "DEF:write_avg={file}:write:AVERAGE",
919                 "DEF:create_avg={file}:create:AVERAGE",
920                 "DEF:mkdir_avg={file}:mkdir:AVERAGE",
921                 "DEF:symlink_avg={file}:symlink:AVERAGE",
922                 "DEF:mknod_avg={file}:mknod:AVERAGE",
923                 "DEF:remove_avg={file}:remove:AVERAGE",
924                 "DEF:rmdir_avg={file}:rmdir:AVERAGE",
925                 "DEF:rename_avg={file}:rename:AVERAGE",
926                 "DEF:link_avg={file}:link:AVERAGE",
927                 "DEF:readdir_avg={file}:readdir:AVERAGE",
928                 "DEF:readdirplus_avg={file}:readdirplus:AVERAGE",
929                 "DEF:fsstat_avg={file}:fsstat:AVERAGE",
930                 "DEF:fsinfo_avg={file}:fsinfo:AVERAGE",
931                 "DEF:pathconf_avg={file}:pathconf:AVERAGE",
932                 "DEF:commit_avg={file}:commit:AVERAGE",
933                 "DEF:null_max={file}:null:MAX",
934                 "DEF:getattr_max={file}:getattr:MAX",
935                 "DEF:setattr_max={file}:setattr:MAX",
936                 "DEF:lookup_max={file}:lookup:MAX",
937                 "DEF:access_max={file}:access:MAX",
938                 "DEF:readlink_max={file}:readlink:MAX",
939                 "DEF:read_max={file}:read:MAX",
940                 "DEF:write_max={file}:write:MAX",
941                 "DEF:create_max={file}:create:MAX",
942                 "DEF:mkdir_max={file}:mkdir:MAX",
943                 "DEF:symlink_max={file}:symlink:MAX",
944                 "DEF:mknod_max={file}:mknod:MAX",
945                 "DEF:remove_max={file}:remove:MAX",
946                 "DEF:rmdir_max={file}:rmdir:MAX",
947                 "DEF:rename_max={file}:rename:MAX",
948                 "DEF:link_max={file}:link:MAX",
949                 "DEF:readdir_max={file}:readdir:MAX",
950                 "DEF:readdirplus_max={file}:readdirplus:MAX",
951                 "DEF:fsstat_max={file}:fsstat:MAX",
952                 "DEF:fsinfo_max={file}:fsinfo:MAX",
953                 "DEF:pathconf_max={file}:pathconf:MAX",
954                 "DEF:commit_max={file}:commit:MAX",
955                 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
956                 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
957                 "CDEF:stack_read=read_avg",
958                 "CDEF:stack_getattr=stack_read,getattr_avg,+",
959                 "CDEF:stack_access=stack_getattr,access_avg,+",
960                 "CDEF:stack_lookup=stack_access,lookup_avg,+",
961                 "CDEF:stack_write=stack_lookup,write_avg,+",
962                 "CDEF:stack_commit=stack_write,commit_avg,+",
963                 "CDEF:stack_setattr=stack_commit,setattr_avg,+",
964                 "CDEF:stack_other=stack_setattr,other_avg,+",
965                 "AREA:stack_other#$HalfRed",
966                 "AREA:stack_setattr#$HalfGreen",
967                 "AREA:stack_commit#$HalfYellow",
968                 "AREA:stack_write#$HalfGreen",
969                 "AREA:stack_lookup#$HalfBlue",
970                 "AREA:stack_access#$HalfMagenta",
971                 "AREA:stack_getattr#$HalfCyan",
972                 "AREA:stack_read#$HalfBlue",
973                 "LINE1:stack_other#$FullRed:Other  ",
974                 'GPRINT:other_max:MAX:%5.1lf Max,',
975                 'GPRINT:other_avg:AVERAGE:%5.1lf Avg,',
976                 'GPRINT:other_avg:LAST:%5.1lf Last\l',
977                 "LINE1:stack_setattr#$FullGreen:setattr",
978                 'GPRINT:setattr_max:MAX:%5.1lf Max,',
979                 'GPRINT:setattr_avg:AVERAGE:%5.1lf Avg,',
980                 'GPRINT:setattr_avg:LAST:%5.1lf Last\l',
981                 "LINE1:stack_commit#$FullYellow:commit ",
982                 'GPRINT:commit_max:MAX:%5.1lf Max,',
983                 'GPRINT:commit_avg:AVERAGE:%5.1lf Avg,',
984                 'GPRINT:commit_avg:LAST:%5.1lf Last\l',
985                 "LINE1:stack_write#$FullGreen:write  ",
986                 'GPRINT:write_max:MAX:%5.1lf Max,',
987                 'GPRINT:write_avg:AVERAGE:%5.1lf Avg,',
988                 'GPRINT:write_avg:LAST:%5.1lf Last\l',
989                 "LINE1:stack_lookup#$FullBlue:lookup ",
990                 'GPRINT:lookup_max:MAX:%5.1lf Max,',
991                 'GPRINT:lookup_avg:AVERAGE:%5.1lf Avg,',
992                 'GPRINT:lookup_avg:LAST:%5.1lf Last\l',
993                 "LINE1:stack_access#$FullMagenta:access ",
994                 'GPRINT:access_max:MAX:%5.1lf Max,',
995                 'GPRINT:access_avg:AVERAGE:%5.1lf Avg,',
996                 'GPRINT:access_avg:LAST:%5.1lf Last\l',
997                 "LINE1:stack_getattr#$FullCyan:getattr",
998                 'GPRINT:getattr_max:MAX:%5.1lf Max,',
999                 'GPRINT:getattr_avg:AVERAGE:%5.1lf Avg,',
1000                 'GPRINT:getattr_avg:LAST:%5.1lf Last\l',
1001                 "LINE1:stack_read#$FullBlue:read   ",
1002                 'GPRINT:read_max:MAX:%5.1lf Max,',
1003                 'GPRINT:read_avg:AVERAGE:%5.1lf Avg,',
1004                 'GPRINT:read_avg:LAST:%5.1lf Last\l');
1005         $GraphDefs['opcode'] = array(
1006                 'DEF:avg={file}:value:AVERAGE',
1007                 'DEF:min={file}:value:MIN',
1008                 'DEF:max={file}:value:MAX',
1009                 "AREA:max#$HalfBlue",
1010                 "AREA:min#$Canvas",
1011                 "LINE1:avg#$FullBlue:Queries/s",
1012                 'GPRINT:min:MIN:%9.3lf Min,',
1013                 'GPRINT:avg:AVERAGE:%9.3lf Average,',
1014                 'GPRINT:max:MAX:%9.3lf Max,',
1015                 'GPRINT:avg:LAST:%9.3lf Last\l');
1016         $GraphDefs['partition'] = array(
1017                 "DEF:rbyte_avg={file}:rbytes:AVERAGE",
1018                 "DEF:rbyte_min={file}:rbytes:MIN",
1019                 "DEF:rbyte_max={file}:rbytes:MAX",
1020                 "DEF:wbyte_avg={file}:wbytes:AVERAGE",
1021                 "DEF:wbyte_min={file}:wbytes:MIN",
1022                 "DEF:wbyte_max={file}:wbytes:MAX",
1023                 'CDEF:overlap=wbyte_avg,rbyte_avg,GT,rbyte_avg,wbyte_avg,IF',
1024                 "AREA:wbyte_avg#$HalfGreen",
1025                 "AREA:rbyte_avg#$HalfBlue",
1026                 "AREA:overlap#$HalfBlueGreen",    "LINE1:wbyte_avg#$FullGreen:Write",
1027                 'GPRINT:wbyte_min:MIN:%5.1lf%s Min,',
1028                 'GPRINT:wbyte_avg:AVERAGE:%5.1lf%s Avg,',
1029                 'GPRINT:wbyte_max:MAX:%5.1lf%s Max,',
1030                 'GPRINT:wbyte_avg:LAST:%5.1lf%s Last\l',
1031                 "LINE1:rbyte_avg#$FullBlue:Read ",
1032                 'GPRINT:rbyte_min:MIN:%5.1lf%s Min,',
1033                 'GPRINT:rbyte_avg:AVERAGE:%5.1lf%s Avg,',
1034                 'GPRINT:rbyte_max:MAX:%5.1lf%s Max,',
1035                 'GPRINT:rbyte_avg:LAST:%5.1lf%s Last\l');
1036         $GraphDefs['percent'] = array(
1037                 '-v', 'Percent',
1038                 'DEF:avg={file}:percent:AVERAGE',
1039                 'DEF:min={file}:percent:MIN',
1040                 'DEF:max={file}:percent:MAX',
1041                 "AREA:max#$HalfBlue",
1042                 "AREA:min#$Canvas",
1043                 "LINE1:avg#$FullBlue:Percent",
1044                 'GPRINT:min:MIN:%5.1lf%% Min,',
1045                 'GPRINT:avg:AVERAGE:%5.1lf%% Avg,',
1046                 'GPRINT:max:MAX:%5.1lf%% Max,',
1047                 'GPRINT:avg:LAST:%5.1lf%% Last\l');
1048         $GraphDefs['ping'] = array(
1049                 'DEF:ping_avg={file}:ping:AVERAGE',
1050                 'DEF:ping_min={file}:ping:MIN',
1051                 'DEF:ping_max={file}:ping:MAX',
1052                 "AREA:ping_max#$HalfBlue",
1053                 "AREA:ping_min#$Canvas",
1054                 "LINE1:ping_avg#$FullBlue:Ping",
1055                 'GPRINT:ping_min:MIN:%4.1lf ms Min,',
1056                 'GPRINT:ping_avg:AVERAGE:%4.1lf ms Avg,',
1057                 'GPRINT:ping_max:MAX:%4.1lf ms Max,',
1058                 'GPRINT:ping_avg:LAST:%4.1lf ms Last');
1059         $GraphDefs['power'] = array(
1060                 '-v', 'Watt',
1061                 'DEF:avg={file}:value:AVERAGE',
1062                 'DEF:min={file}:value:MIN',
1063                 'DEF:max={file}:value:MAX',
1064                 "AREA:max#$HalfBlue",
1065                 "AREA:min#$Canvas",
1066                 "LINE1:avg#$FullBlue:Watt",
1067                 'GPRINT:min:MIN:%5.1lf%sW Min,',
1068                 'GPRINT:avg:AVERAGE:%5.1lf%sW Avg,',
1069                 'GPRINT:max:MAX:%5.1lf%sW Max,',
1070                 'GPRINT:avg:LAST:%5.1lf%sW Last\l');
1071         $GraphDefs['processes'] = array(
1072                 "DEF:running_avg={file}:running:AVERAGE",
1073                 "DEF:running_min={file}:running:MIN",
1074                 "DEF:running_max={file}:running:MAX",
1075                 "DEF:sleeping_avg={file}:sleeping:AVERAGE",
1076                 "DEF:sleeping_min={file}:sleeping:MIN",
1077                 "DEF:sleeping_max={file}:sleeping:MAX",
1078                 "DEF:zombies_avg={file}:zombies:AVERAGE",
1079                 "DEF:zombies_min={file}:zombies:MIN",
1080                 "DEF:zombies_max={file}:zombies:MAX",
1081                 "DEF:stopped_avg={file}:stopped:AVERAGE",
1082                 "DEF:stopped_min={file}:stopped:MIN",
1083                 "DEF:stopped_max={file}:stopped:MAX",
1084                 "DEF:paging_avg={file}:paging:AVERAGE",
1085                 "DEF:paging_min={file}:paging:MIN",
1086                 "DEF:paging_max={file}:paging:MAX",
1087                 "DEF:blocked_avg={file}:blocked:AVERAGE",
1088                 "DEF:blocked_min={file}:blocked:MIN",
1089                 "DEF:blocked_max={file}:blocked:MAX",
1090                 'CDEF:paging_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,paging_avg,+,+,+,+,+',
1091                 'CDEF:blocked_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,+,+,+,+',
1092                 'CDEF:zombies_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,+,+,+',
1093                 'CDEF:stopped_acc=sleeping_avg,running_avg,stopped_avg,+,+',
1094                 'CDEF:running_acc=sleeping_avg,running_avg,+',
1095                 'CDEF:sleeping_acc=sleeping_avg',
1096                 "AREA:paging_acc#$HalfYellow",
1097                 "AREA:blocked_acc#$HalfCyan",
1098                 "AREA:zombies_acc#$HalfRed",
1099                 "AREA:stopped_acc#$HalfMagenta",
1100                 "AREA:running_acc#$HalfGreen",
1101                 "AREA:sleeping_acc#$HalfBlue",
1102                 "LINE1:paging_acc#$FullYellow:Paging  ",
1103                 'GPRINT:paging_min:MIN:%5.1lf Min,',
1104                 'GPRINT:paging_avg:AVERAGE:%5.1lf Average,',
1105                 'GPRINT:paging_max:MAX:%5.1lf Max,',
1106                 'GPRINT:paging_avg:LAST:%5.1lf Last\l',
1107                 "LINE1:blocked_acc#$FullCyan:Blocked ",
1108                 'GPRINT:blocked_min:MIN:%5.1lf Min,',
1109                 'GPRINT:blocked_avg:AVERAGE:%5.1lf Average,',
1110                 'GPRINT:blocked_max:MAX:%5.1lf Max,',
1111                 'GPRINT:blocked_avg:LAST:%5.1lf Last\l',
1112                 "LINE1:zombies_acc#$FullRed:Zombies ",
1113                 'GPRINT:zombies_min:MIN:%5.1lf Min,',
1114                 'GPRINT:zombies_avg:AVERAGE:%5.1lf Average,',
1115                 'GPRINT:zombies_max:MAX:%5.1lf Max,',
1116                 'GPRINT:zombies_avg:LAST:%5.1lf Last\l',
1117                 "LINE1:stopped_acc#$FullMagenta:Stopped ",
1118                 'GPRINT:stopped_min:MIN:%5.1lf Min,',
1119                 'GPRINT:stopped_avg:AVERAGE:%5.1lf Average,',
1120                 'GPRINT:stopped_max:MAX:%5.1lf Max,',
1121                 'GPRINT:stopped_avg:LAST:%5.1lf Last\l',
1122                 "LINE1:running_acc#$FullGreen:Running ",
1123                 'GPRINT:running_min:MIN:%5.1lf Min,',
1124                 'GPRINT:running_avg:AVERAGE:%5.1lf Average,',
1125                 'GPRINT:running_max:MAX:%5.1lf Max,',
1126                 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1127                 "LINE1:sleeping_acc#$FullBlue:Sleeping",
1128                 'GPRINT:sleeping_min:MIN:%5.1lf Min,',
1129                 'GPRINT:sleeping_avg:AVERAGE:%5.1lf Average,',
1130                 'GPRINT:sleeping_max:MAX:%5.1lf Max,',
1131                 'GPRINT:sleeping_avg:LAST:%5.1lf Last\l');
1132         $GraphDefs['ps_count'] = array(
1133                 '-v', 'Processes',
1134                 'DEF:procs_avg={file}:processes:AVERAGE',
1135                 'DEF:procs_min={file}:processes:MIN',
1136                 'DEF:procs_max={file}:processes:MAX',
1137                 'DEF:thrds_avg={file}:threads:AVERAGE',
1138                 'DEF:thrds_min={file}:threads:MIN',
1139                 'DEF:thrds_max={file}:threads:MAX',
1140                 "AREA:thrds_avg#$HalfBlue",
1141                 "AREA:procs_avg#$HalfRed",
1142                 "LINE1:thrds_avg#$FullBlue:Threads  ",
1143                 'GPRINT:thrds_min:MIN:%5.1lf Min,',
1144                 'GPRINT:thrds_avg:AVERAGE:%5.1lf Avg,',
1145                 'GPRINT:thrds_max:MAX:%5.1lf Max,',
1146                 'GPRINT:thrds_avg:LAST:%5.1lf Last\l',
1147                 "LINE1:procs_avg#$FullRed:Processes",
1148                 'GPRINT:procs_min:MIN:%5.1lf Min,',
1149                 'GPRINT:procs_avg:AVERAGE:%5.1lf Avg,',
1150                 'GPRINT:procs_max:MAX:%5.1lf Max,',
1151                 'GPRINT:procs_avg:LAST:%5.1lf Last\l');
1152         $GraphDefs['ps_cputime'] = array(
1153                 '-v', 'Jiffies',
1154                 'DEF:user_avg_raw={file}:user:AVERAGE',
1155                 'DEF:user_min_raw={file}:user:MIN',
1156                 'DEF:user_max_raw={file}:user:MAX',
1157                 'DEF:syst_avg_raw={file}:syst:AVERAGE',
1158                 'DEF:syst_min_raw={file}:syst:MIN',
1159                 'DEF:syst_max_raw={file}:syst:MAX',
1160                 'CDEF:user_avg=user_avg_raw,1000000,/',
1161                 'CDEF:user_min=user_min_raw,1000000,/',
1162                 'CDEF:user_max=user_max_raw,1000000,/',
1163                 'CDEF:syst_avg=syst_avg_raw,1000000,/',
1164                 'CDEF:syst_min=syst_min_raw,1000000,/',
1165                 'CDEF:syst_max=syst_max_raw,1000000,/',
1166                 'CDEF:user_syst=syst_avg,UN,0,syst_avg,IF,user_avg,+',
1167                 "AREA:user_syst#$HalfBlue",
1168                 "AREA:syst_avg#$HalfRed",
1169                 "LINE1:user_syst#$FullBlue:User  ",
1170                 'GPRINT:user_min:MIN:%5.1lf%s Min,',
1171                 'GPRINT:user_avg:AVERAGE:%5.1lf%s Avg,',
1172                 'GPRINT:user_max:MAX:%5.1lf%s Max,',
1173                 'GPRINT:user_avg:LAST:%5.1lf%s Last\l',
1174                 "LINE1:syst_avg#$FullRed:System",
1175                 'GPRINT:syst_min:MIN:%5.1lf%s Min,',
1176                 'GPRINT:syst_avg:AVERAGE:%5.1lf%s Avg,',
1177                 'GPRINT:syst_max:MAX:%5.1lf%s Max,',
1178                 'GPRINT:syst_avg:LAST:%5.1lf%s Last\l');
1179         $GraphDefs['ps_pagefaults'] = array(
1180                 '-v', 'Pagefaults/s',
1181                 'DEF:minor_avg={file}:minflt:AVERAGE',
1182                 'DEF:minor_min={file}:minflt:MIN',
1183                 'DEF:minor_max={file}:minflt:MAX',
1184                 'DEF:major_avg={file}:majflt:AVERAGE',
1185                 'DEF:major_min={file}:majflt:MIN',
1186                 'DEF:major_max={file}:majflt:MAX',
1187                 'CDEF:minor_major=major_avg,UN,0,major_avg,IF,minor_avg,+',
1188                 "AREA:minor_major#$HalfBlue",
1189                 "AREA:major_avg#$HalfRed",
1190                 "LINE1:minor_major#$FullBlue:Minor",
1191                 'GPRINT:minor_min:MIN:%5.1lf%s Min,',
1192                 'GPRINT:minor_avg:AVERAGE:%5.1lf%s Avg,',
1193                 'GPRINT:minor_max:MAX:%5.1lf%s Max,',
1194                 'GPRINT:minor_avg:LAST:%5.1lf%s Last\l',
1195                 "LINE1:major_avg#$FullRed:Major",
1196                 'GPRINT:major_min:MIN:%5.1lf%s Min,',
1197                 'GPRINT:major_avg:AVERAGE:%5.1lf%s Avg,',
1198                 'GPRINT:major_max:MAX:%5.1lf%s Max,',
1199                 'GPRINT:major_avg:LAST:%5.1lf%s Last\l');
1200         $GraphDefs['ps_rss'] = array(
1201                 '-v', 'Bytes',
1202                 'DEF:avg={file}:value:AVERAGE',
1203                 'DEF:min={file}:value:MIN',
1204                 'DEF:max={file}:value:MAX',
1205                 "AREA:avg#$HalfBlue",
1206                 "LINE1:avg#$FullBlue:RSS",
1207                 'GPRINT:min:MIN:%5.1lf%s Min,',
1208                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1209                 'GPRINT:max:MAX:%5.1lf%s Max,',
1210                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
1211         $GraphDefs['ps_state'] = array(
1212                 '-v', 'Processes',
1213                 'DEF:avg={file}:value:AVERAGE',
1214                 'DEF:min={file}:value:MIN',
1215                 'DEF:max={file}:value:MAX',
1216                 "AREA:max#$HalfBlue",
1217                 "AREA:min#$Canvas",
1218                 "LINE1:avg#$FullBlue:Processes",
1219                 'GPRINT:min:MIN:%6.2lf Min,',
1220                 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
1221                 'GPRINT:max:MAX:%6.2lf Max,',
1222                 'GPRINT:avg:LAST:%6.2lf Last\l');
1223         $GraphDefs['qtype'] = array(
1224                 'DEF:avg={file}:value:AVERAGE',
1225                 'DEF:min={file}:value:MIN',
1226                 'DEF:max={file}:value:MAX',
1227                 "AREA:max#$HalfBlue",
1228                 "AREA:min#$Canvas",
1229                 "LINE1:avg#$FullBlue:Queries/s",
1230                 'GPRINT:min:MIN:%9.3lf Min,',
1231                 'GPRINT:avg:AVERAGE:%9.3lf Average,',
1232                 'GPRINT:max:MAX:%9.3lf Max,',
1233                 'GPRINT:avg:LAST:%9.3lf Last\l');
1234         $GraphDefs['rcode'] = array(
1235                 'DEF:avg={file}:value:AVERAGE',
1236                 'DEF:min={file}:value:MIN',
1237                 'DEF:max={file}:value:MAX',
1238                 "AREA:max#$HalfBlue",
1239                 "AREA:min#$Canvas",
1240                 "LINE1:avg#$FullBlue:Queries/s",
1241                 'GPRINT:min:MIN:%9.3lf Min,',
1242                 'GPRINT:avg:AVERAGE:%9.3lf Average,',
1243                 'GPRINT:max:MAX:%9.3lf Max,',
1244                 'GPRINT:avg:LAST:%9.3lf Last\l');
1245         $GraphDefs['swap'] = array(
1246                 '-v', 'Bytes', '-b', '1024',
1247                 'DEF:avg={file}:value:AVERAGE',
1248                 'DEF:min={file}:value:MIN',
1249                 'DEF:max={file}:value:MAX',
1250                 "AREA:max#$HalfBlue",
1251                 "AREA:min#$Canvas",
1252                 "LINE1:avg#$FullBlue:Bytes",
1253                 'GPRINT:min:MIN:%6.2lf%sByte Min,',
1254                 'GPRINT:avg:AVERAGE:%6.2lf%sByte Avg,',
1255                 'GPRINT:max:MAX:%6.2lf%sByte Max,',
1256                 'GPRINT:avg:LAST:%6.2lf%sByte Last\l');
1257         $GraphDefs['old_swap'] = array(
1258                 'DEF:used_avg={file}:used:AVERAGE',
1259                 'DEF:used_min={file}:used:MIN',
1260                 'DEF:used_max={file}:used:MAX',
1261                 'DEF:free_avg={file}:free:AVERAGE',
1262                 'DEF:free_min={file}:free:MIN',
1263                 'DEF:free_max={file}:free:MAX',
1264                 'DEF:cach_avg={file}:cached:AVERAGE',
1265                 'DEF:cach_min={file}:cached:MIN',
1266                 'DEF:cach_max={file}:cached:MAX',
1267                 'DEF:resv_avg={file}:resv:AVERAGE',
1268                 'DEF:resv_min={file}:resv:MIN',
1269                 'DEF:resv_max={file}:resv:MAX',
1270                 'CDEF:cach_avg_notnull=cach_avg,UN,0,cach_avg,IF',
1271                 'CDEF:resv_avg_notnull=resv_avg,UN,0,resv_avg,IF',
1272                 'CDEF:used_acc=used_avg',
1273                 'CDEF:resv_acc=used_acc,resv_avg_notnull,+',
1274                 'CDEF:cach_acc=resv_acc,cach_avg_notnull,+',
1275                 'CDEF:free_acc=cach_acc,free_avg,+',
1276                 "AREA:free_acc#$HalfGreen",
1277                 "AREA:cach_acc#$HalfBlue",
1278                 "AREA:resv_acc#$HalfYellow",
1279                 "AREA:used_acc#$HalfRed",
1280                 "LINE1:free_acc#$FullGreen:Free    ",
1281                 'GPRINT:free_min:MIN:%5.1lf%s Min,',
1282                 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
1283                 'GPRINT:free_max:MAX:%5.1lf%s Max,',
1284                 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
1285                 "LINE1:cach_acc#$FullBlue:Cached  ",
1286                 'GPRINT:cach_min:MIN:%5.1lf%s Min,',
1287                 'GPRINT:cach_avg:AVERAGE:%5.1lf%s Avg,',
1288                 'GPRINT:cach_max:MAX:%5.1lf%s Max,',
1289                 'GPRINT:cach_avg:LAST:%5.1lf%s Last\l',
1290                 "LINE1:resv_acc#$FullYellow:Reserved",
1291                 'GPRINT:resv_min:MIN:%5.1lf%s Min,',
1292                 'GPRINT:resv_avg:AVERAGE:%5.1lf%s Avg,',
1293                 'GPRINT:resv_max:MAX:%5.1lf%s Max,',
1294                 'GPRINT:resv_avg:LAST:%5.1lf%s Last\n',
1295                 "LINE1:used_acc#$FullRed:Used    ",
1296                 'GPRINT:used_min:MIN:%5.1lf%s Min,',
1297                 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
1298                 'GPRINT:used_max:MAX:%5.1lf%s Max,',
1299                 'GPRINT:used_avg:LAST:%5.1lf%s Last\l');
1300         $GraphDefs['tcp_connections'] = array(
1301                 '-v', 'Connections',
1302                 'DEF:avg={file}:value:AVERAGE',
1303                 'DEF:min={file}:value:MIN',
1304                 'DEF:max={file}:value:MAX',
1305                 "AREA:max#$HalfBlue",
1306                 "AREA:min#$Canvas",
1307                 "LINE1:avg#$FullBlue:Connections",
1308                 'GPRINT:min:MIN:%4.1lf Min,',
1309                 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1310                 'GPRINT:max:MAX:%4.1lf Max,',
1311                 'GPRINT:avg:LAST:%4.1lf Last\l');
1312         $GraphDefs['temperature'] = array(
1313                 '-v', 'Celsius',
1314                 'DEF:temp_avg={file}:value:AVERAGE',
1315                 'DEF:temp_min={file}:value:MIN',
1316                 'DEF:temp_max={file}:value:MAX',
1317                 'CDEF:average=temp_avg,0.2,*,PREV,UN,temp_avg,PREV,IF,0.8,*,+',
1318                 "AREA:temp_max#$HalfRed",
1319                 "AREA:temp_min#$Canvas",
1320                 "LINE1:temp_avg#$FullRed:Temperature",
1321                 'GPRINT:temp_min:MIN:%4.1lf Min,',
1322                 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
1323                 'GPRINT:temp_max:MAX:%4.1lf Max,',
1324                 'GPRINT:temp_avg:LAST:%4.1lf Last\l');
1325         $GraphDefs['timeleft'] = array(
1326                 '-v', 'Minutes',
1327                 'DEF:avg={file}:timeleft:AVERAGE',
1328                 'DEF:min={file}:timeleft:MIN',
1329                 'DEF:max={file}:timeleft:MAX',
1330                 "AREA:max#$HalfBlue",
1331                 "AREA:min#$Canvas",
1332                 "LINE1:avg#$FullBlue:Time left [min]",
1333                 'GPRINT:min:MIN:%5.1lf%s Min,',
1334                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1335                 'GPRINT:max:MAX:%5.1lf%s Max,',
1336                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
1337         $GraphDefs['time_offset'] = array( # NTPd
1338                 'DEF:s_avg={file}:seconds:AVERAGE',
1339                 'DEF:s_min={file}:seconds:MIN',
1340                 'DEF:s_max={file}:seconds:MAX',
1341                 "AREA:s_max#$HalfBlue",
1342                 "AREA:s_min#$Canvas",
1343                 "LINE1:s_avg#$FullBlue:{inst}",
1344                 'GPRINT:s_min:MIN:%7.3lf%s Min,',
1345                 'GPRINT:s_avg:AVERAGE:%7.3lf%s Avg,',
1346                 'GPRINT:s_max:MAX:%7.3lf%s Max,',
1347                 'GPRINT:s_avg:LAST:%7.3lf%s Last');
1348         $GraphDefs['if_octets'] = array(
1349                 '-v', 'Bits/s', '--units=si',
1350                 'DEF:out_min_raw={file}:tx:MIN',
1351                 'DEF:out_avg_raw={file}:tx:AVERAGE',
1352                 'DEF:out_max_raw={file}:tx:MAX',
1353                 'DEF:inc_min_raw={file}:rx:MIN',
1354                 'DEF:inc_avg_raw={file}:rx:AVERAGE',
1355                 'DEF:inc_max_raw={file}:rx:MAX',
1356                 'CDEF:out_min=out_min_raw,8,*',
1357                 'CDEF:out_avg=out_avg_raw,8,*',
1358                 'CDEF:out_max=out_max_raw,8,*',
1359                 'CDEF:inc_min=inc_min_raw,8,*',
1360                 'CDEF:inc_avg=inc_avg_raw,8,*',
1361                 'CDEF:inc_max=inc_max_raw,8,*',
1362                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1363                 'CDEF:mytime=out_avg_raw,TIME,TIME,IF',
1364                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1365                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1366                 'CDEF:out_avg_sample=out_avg_raw,UN,0,out_avg_raw,IF,sample_len,*',
1367                 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
1368                 'CDEF:inc_avg_sample=inc_avg_raw,UN,0,inc_avg_raw,IF,sample_len,*',
1369                 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
1370                 "AREA:out_avg#$HalfGreen",
1371                 "AREA:inc_avg#$HalfBlue",
1372                 "AREA:overlap#$HalfBlueGreen",
1373                 "LINE1:out_avg#$FullGreen:Outgoing",
1374                 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
1375                 'GPRINT:out_max:MAX:%5.1lf%s Max,',
1376                 'GPRINT:out_avg:LAST:%5.1lf%s Last',
1377                 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1378                 "LINE1:inc_avg#$FullBlue:Incoming",
1379 //                      'GPRINT:inc_min:MIN:%5.1lf %s Min,',
1380                 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
1381                 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
1382                 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
1383                 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
1384         $GraphDefs['cpufreq'] = array(
1385                 'DEF:cpufreq_avg={file}:value:AVERAGE',
1386                 'DEF:cpufreq_min={file}:value:MIN',
1387                 'DEF:cpufreq_max={file}:value:MAX',
1388                 "AREA:cpufreq_max#$HalfBlue",
1389                 "AREA:cpufreq_min#$Canvas",
1390                 "LINE1:cpufreq_avg#$FullBlue:Frequency",
1391                 'GPRINT:cpufreq_min:MIN:%5.1lf%s Min,',
1392                 'GPRINT:cpufreq_avg:AVERAGE:%5.1lf%s Avg,',
1393                 'GPRINT:cpufreq_max:MAX:%5.1lf%s Max,',
1394                 'GPRINT:cpufreq_avg:LAST:%5.1lf%s Last\l');
1395         $GraphDefs['multimeter'] = array(
1396                 'DEF:multimeter_avg={file}:value:AVERAGE',
1397                 'DEF:multimeter_min={file}:value:MIN',
1398                 'DEF:multimeter_max={file}:value:MAX',
1399                 "AREA:multimeter_max#$HalfBlue",
1400                 "AREA:multimeter_min#$Canvas",
1401                 "LINE1:multimeter_avg#$FullBlue:Multimeter",
1402                 'GPRINT:multimeter_min:MIN:%4.1lf Min,',
1403                 'GPRINT:multimeter_avg:AVERAGE:%4.1lf Average,',
1404                 'GPRINT:multimeter_max:MAX:%4.1lf Max,',
1405                 'GPRINT:multimeter_avg:LAST:%4.1lf Last\l');
1406         $GraphDefs['users'] = array(
1407                 '-v', 'Users',
1408                 'DEF:users_avg={file}:users:AVERAGE',
1409                 'DEF:users_min={file}:users:MIN',
1410                 'DEF:users_max={file}:users:MAX',
1411                 "AREA:users_max#$HalfBlue",
1412                 "AREA:users_min#$Canvas",
1413                 "LINE1:users_avg#$FullBlue:Users",
1414                 'GPRINT:users_min:MIN:%4.1lf Min,',
1415                 'GPRINT:users_avg:AVERAGE:%4.1lf Average,',
1416                 'GPRINT:users_max:MAX:%4.1lf Max,',
1417                 'GPRINT:users_avg:LAST:%4.1lf Last\l');
1418         $GraphDefs['voltage'] = array(
1419                 '-v', 'Voltage',
1420                 'DEF:avg={file}:value:AVERAGE',
1421                 'DEF:min={file}:value:MIN',
1422                 'DEF:max={file}:value:MAX',
1423                 "AREA:max#$HalfBlue",
1424                 "AREA:min#$Canvas",
1425                 "LINE1:avg#$FullBlue:Voltage",
1426                 'GPRINT:min:MIN:%5.1lf%sV Min,',
1427                 'GPRINT:avg:AVERAGE:%5.1lf%sV Avg,',
1428                 'GPRINT:max:MAX:%5.1lf%sV Max,',
1429                 'GPRINT:avg:LAST:%5.1lf%sV Last\l');
1430         $GraphDefs['vmpage_action'] = array(
1431                 '-v', 'Actions',
1432                 'DEF:avg={file}:value:AVERAGE',
1433                 'DEF:min={file}:value:MIN',
1434                 'DEF:max={file}:value:MAX',
1435                 "AREA:max#$HalfBlue",
1436                 "AREA:min#$Canvas",
1437                 "LINE1:avg#$FullBlue:Action",
1438                 'GPRINT:min:MIN:%5.1lf%sV Min,',
1439                 'GPRINT:avg:AVERAGE:%5.1lf%sV Avg,',
1440                 'GPRINT:max:MAX:%5.1lf%sV Max,',
1441                 'GPRINT:avg:LAST:%5.1lf%sV Last\l');
1442         $GraphDefs['vmpage_faults'] = $GraphDefs['ps_pagefaults'];
1443         $GraphDefs['vmpage_io'] = array(
1444                 '-v', 'Bytes/s',
1445                 'DEF:out_min={file}:out:MIN',
1446                 'DEF:out_avg={file}:out:AVERAGE',
1447                 'DEF:out_max={file}:out:MAX',
1448                 'DEF:inc_min={file}:in:MIN',
1449                 'DEF:inc_avg={file}:in:AVERAGE',
1450                 'DEF:inc_max={file}:in:MAX',
1451                 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1452                 'CDEF:mytime=out_avg,TIME,TIME,IF',
1453                 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1454                 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1455                 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
1456                 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
1457                 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
1458                 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
1459                 "AREA:out_avg#$HalfGreen",
1460                 "AREA:inc_avg#$HalfBlue",
1461                 "AREA:overlap#$HalfBlueGreen",
1462                 "LINE1:out_avg#$FullGreen:Written",
1463                 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
1464                 'GPRINT:out_max:MAX:%5.1lf%s Max,',
1465                 'GPRINT:out_avg:LAST:%5.1lf%s Last',
1466                 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1467                 "LINE1:inc_avg#$FullBlue:Read   ",
1468                 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
1469                 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
1470                 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
1471                 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l');
1472         $GraphDefs['vmpage_number'] = array(
1473                 '-v', 'Count',
1474                 'DEF:avg={file}:value:AVERAGE',
1475                 'DEF:min={file}:value:MIN',
1476                 'DEF:max={file}:value:MAX',
1477                 "AREA:avg#$HalfBlue",
1478                 "LINE1:avg#$FullBlue:Count",
1479                 'GPRINT:min:MIN:%5.1lf%s Min,',
1480                 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1481                 'GPRINT:max:MAX:%5.1lf%s Max,',
1482                 'GPRINT:avg:LAST:%5.1lf%s Last\l');
1483         $GraphDefs['vs_threads'] = array(
1484                 "DEF:total_avg={file}:total:AVERAGE",
1485                 "DEF:total_min={file}:total:MIN",
1486                 "DEF:total_max={file}:total:MAX",
1487                 "DEF:running_avg={file}:running:AVERAGE",
1488                 "DEF:running_min={file}:running:MIN",
1489                 "DEF:running_max={file}:running:MAX",
1490                 "DEF:uninterruptible_avg={file}:uninterruptible:AVERAGE",
1491                 "DEF:uninterruptible_min={file}:uninterruptible:MIN",
1492                 "DEF:uninterruptible_max={file}:uninterruptible:MAX",
1493                 "DEF:onhold_avg={file}:onhold:AVERAGE",
1494                 "DEF:onhold_min={file}:onhold:MIN",
1495                 "DEF:onhold_max={file}:onhold:MAX",
1496                 "LINE1:total_avg#$FullYellow:Total   ",
1497                 'GPRINT:total_min:MIN:%5.1lf Min,',
1498                 'GPRINT:total_avg:AVERAGE:%5.1lf Avg.,',
1499                 'GPRINT:total_max:MAX:%5.1lf Max,',
1500                 'GPRINT:total_avg:LAST:%5.1lf Last\l',
1501                 "LINE1:running_avg#$FullRed:Running ",
1502                 'GPRINT:running_min:MIN:%5.1lf Min,',
1503                 'GPRINT:running_avg:AVERAGE:%5.1lf Avg.,',
1504                 'GPRINT:running_max:MAX:%5.1lf Max,',
1505                 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1506                 "LINE1:uninterruptible_avg#$FullGreen:Unintr  ",
1507                 'GPRINT:uninterruptible_min:MIN:%5.1lf Min,',
1508                 'GPRINT:uninterruptible_avg:AVERAGE:%5.1lf Avg.,',
1509                 'GPRINT:uninterruptible_max:MAX:%5.1lf Max,',
1510                 'GPRINT:uninterruptible_avg:LAST:%5.1lf Last\l',
1511                 "LINE1:onhold_avg#$FullBlue:Onhold  ",
1512                 'GPRINT:onhold_min:MIN:%5.1lf Min,',
1513                 'GPRINT:onhold_avg:AVERAGE:%5.1lf Avg.,',
1514                 'GPRINT:onhold_max:MAX:%5.1lf Max,',
1515                 'GPRINT:onhold_avg:LAST:%5.1lf Last\l');
1516         $GraphDefs['vs_memory'] = array(
1517                 'DEF:vm_avg={file}:vm:AVERAGE',
1518                 'DEF:vm_min={file}:vm:MIN',
1519                 'DEF:vm_max={file}:vm:MAX',
1520                 'DEF:vml_avg={file}:vml:AVERAGE',
1521                 'DEF:vml_min={file}:vml:MIN',
1522                 'DEF:vml_max={file}:vml:MAX',
1523                 'DEF:rss_avg={file}:rss:AVERAGE',
1524                 'DEF:rss_min={file}:rss:MIN',
1525                 'DEF:rss_max={file}:rss:MAX',
1526                 'DEF:anon_avg={file}:anon:AVERAGE',
1527                 'DEF:anon_min={file}:anon:MIN',
1528                 'DEF:anon_max={file}:anon:MAX',
1529                 "LINE1:vm_avg#$FullYellow:VM     ",
1530                 'GPRINT:vm_min:MIN:%5.1lf%s Min,',
1531                 'GPRINT:vm_avg:AVERAGE:%5.1lf%s Avg.,',
1532                 'GPRINT:vm_max:MAX:%5.1lf%s Avg.,',
1533                 'GPRINT:vm_avg:LAST:%5.1lf%s Last\l',
1534                 "LINE1:vml_avg#$FullRed:Locked ",
1535                 'GPRINT:vml_min:MIN:%5.1lf%s Min,',
1536                 'GPRINT:vml_avg:AVERAGE:%5.1lf%s Avg.,',
1537                 'GPRINT:vml_max:MAX:%5.1lf%s Avg.,',
1538                 'GPRINT:vml_avg:LAST:%5.1lf%s Last\l',
1539                 "LINE1:rss_avg#$FullGreen:RSS    ",
1540                 'GPRINT:rss_min:MIN:%5.1lf%s Min,',
1541                 'GPRINT:rss_avg:AVERAGE:%5.1lf%s Avg.,',
1542                 'GPRINT:rss_max:MAX:%5.1lf%s Avg.,',
1543                 'GPRINT:rss_avg:LAST:%5.1lf%s Last\l',
1544                 "LINE1:anon_avg#$FullBlue:Anon.  ",
1545                 'GPRINT:anon_min:MIN:%5.1lf%s Min,',
1546                 'GPRINT:anon_avg:AVERAGE:%5.1lf%s Avg.,',
1547                 'GPRINT:anon_max:MAX:%5.1lf%s Avg.,',
1548                 'GPRINT:anon_avg:LAST:%5.1lf%s Last\l');
1549         $GraphDefs['vs_processes'] = array(
1550                 '-v', 'Processes',
1551                 'DEF:proc_avg={file}:value:AVERAGE',
1552                 'DEF:proc_min={file}:value:MIN',
1553                 'DEF:proc_max={file}:value:MAX',
1554                 "AREA:proc_max#$HalfBlue",
1555                 "AREA:proc_min#$Canvas",
1556                 "LINE1:proc_avg#$FullBlue:Processes",
1557                 'GPRINT:proc_min:MIN:%4.1lf Min,',
1558                 'GPRINT:proc_avg:AVERAGE:%4.1lf Avg.,',
1559                 'GPRINT:proc_max:MAX:%4.1lf Max,',
1560                 'GPRINT:proc_avg:LAST:%4.1lf Last\l');
1561         $GraphDefs['if_multicast'] = $GraphDefs['ipt_packets'];
1562         $GraphDefs['if_tx_errors'] = $GraphDefs['if_rx_errors'];
1563
1564         $MetaGraphDefs['files_count']       = 'meta_graph_files_count';
1565         $MetaGraphDefs['files_size']        = 'meta_graph_files_size';
1566         $MetaGraphDefs['cpu']               = 'meta_graph_cpu';
1567         $MetaGraphDefs['if_rx_errors']      = 'meta_graph_if_rx_errors';
1568         $MetaGraphDefs['if_tx_errors']      = 'meta_graph_if_rx_errors';
1569         $MetaGraphDefs['memory']            = 'meta_graph_memory';
1570         $MetaGraphDefs['vs_memory']         = 'meta_graph_vs_memory';
1571         $MetaGraphDefs['vs_threads']        = 'meta_graph_vs_threads';
1572         $MetaGraphDefs['nfs_procedure']     = 'meta_graph_nfs_procedure';
1573         $MetaGraphDefs['ps_state']          = 'meta_graph_ps_state';
1574         $MetaGraphDefs['swap']              = 'meta_graph_swap';
1575         $MetaGraphDefs['apache_scoreboard'] = 'meta_graph_apache_scoreboard';
1576         $MetaGraphDefs['mysql_commands']    = 'meta_graph_mysql_commands';
1577         $MetaGraphDefs['mysql_handler']     = 'meta_graph_mysql_commands';
1578         $MetaGraphDefs['tcp_connections']   = 'meta_graph_tcp_connections';
1579         $MetaGraphDefs['dns_opcode']        = 'meta_graph_dns_event';
1580         $MetaGraphDefs['dns_qtype']         = 'meta_graph_dns_event';
1581         $MetaGraphDefs['dns_rcode']         = 'meta_graph_dns_event';
1582         $MetaGraphDefs['dns_request']       = 'meta_graph_dns_event';
1583         $MetaGraphDefs['dns_resolver']      = 'meta_graph_dns_event';
1584         $MetaGraphDefs['dns_update']        = 'meta_graph_dns_event';
1585         $MetaGraphDefs['dns_zops']          = 'meta_graph_dns_event';
1586         $MetaGraphDefs['dns_response']      = 'meta_graph_dns_event';
1587         $MetaGraphDefs['dns_query']         = 'meta_graph_dns_event';
1588         $MetaGraphDefs['dns_reject']        = 'meta_graph_dns_event';
1589         $MetaGraphDefs['dns_notify']        = 'meta_graph_dns_event';
1590         $MetaGraphDefs['dns_transfer']      = 'meta_graph_dns_event';
1591
1592         if (function_exists('load_graph_definitions_local'))
1593                 load_graph_definitions_local($logarithmic, $tinylegend);
1594
1595         if ($logarithmic)
1596                 foreach ($GraphDefs as &$GraphDef)
1597                         array_unshift($GraphDef, '-o');
1598         if ($tinylegend)
1599                 foreach ($GraphDefs as &$GraphDef)
1600                         for ($i = count($GraphDef)-1; $i >=0; $i--)
1601                                 if (strncmp('GPRINT:', $GraphDef[$i], 7) == 0)
1602                                         unset($GraphDef[$i]);
1603 }
1604
1605 function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1606         global $config;
1607         $sources = array();
1608
1609         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1610         if (!isset($opts['title']))
1611                 $opts['title'] = $title;
1612         $opts['rrd_opts'] = array('-v', 'Mails');
1613
1614         $files = array();
1615         $opts['colors'] = array(
1616                 'incoming' => '00e000',
1617                 'active'   => 'a0e000',
1618                 'deferred' => 'a00050'
1619         );
1620
1621         $type_instances = array('incoming', 'active', 'deferred');
1622         while (list($k, $inst) = each($type_instances)) {
1623                 $file  = '';
1624                 foreach ($config['datadirs'] as $datadir)
1625                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1626                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1627                                 break;
1628                         }
1629                 if ($file == '')
1630                         continue;
1631
1632                 $sources[] = array('name'=>$inst, 'file'=>$file);
1633         }
1634
1635         return collectd_draw_meta_stack($opts, $sources);
1636 }
1637
1638 function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1639         global $config;
1640         $sources = array();
1641
1642         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1643         if (!isset($opts['title']))
1644                 $opts['title'] = $title;
1645         $opts['rrd_opts'] = array('-v', 'Bytes');
1646
1647         $files = array();
1648         $opts['colors'] = array(
1649                 'incoming' => '00e000',
1650                 'active'   => 'a0e000',
1651                 'deferred' => 'a00050'
1652         );
1653
1654         $type_instances = array('incoming', 'active', 'deferred');
1655         while (list($k, $inst) = each($type_instances)) {
1656                 $file  = '';
1657                 foreach ($config['datadirs'] as $datadir)
1658                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1659                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1660                                 break;
1661                         }
1662                 if ($file == '')
1663                         continue;
1664
1665                 $sources[] = array('name'=>$inst, 'file'=>$file);
1666         }
1667
1668         return collectd_draw_meta_stack($opts, $sources);
1669 }
1670
1671 function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1672         global $config;
1673         $sources = array();
1674
1675         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1676         if (!isset($opts['title']))
1677                 $opts['title'] = $title;
1678         $opts['rrd_opts'] = array('-v', 'Percent', '-r', '-u', '100');
1679
1680         $files = array();
1681         $opts['colors'] = array(
1682                 'idle'      => 'ffffff',
1683                 'nice'      => '00e000',
1684                 'user'      => '0000ff',
1685                 'wait'      => 'ffb000',
1686                 'system'    => 'ff0000',
1687                 'softirq'   => 'ff00ff',
1688                 'interrupt' => 'a000a0',
1689                 'steal'     => '000000'
1690         );
1691
1692         $type_instances = array('idle', 'wait', 'nice', 'user', 'system', 'softirq', 'interrupt', 'steal');
1693         while (list($k, $inst) = each($type_instances)) {
1694                 $file  = '';
1695                 foreach ($config['datadirs'] as $datadir)
1696                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1697                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1698                                 break;
1699                         }
1700                 if ($file == '')
1701                         continue;
1702
1703                 $sources[] = array('name'=>$inst, 'file'=>$file);
1704         }
1705
1706         return collectd_draw_meta_stack($opts, $sources);
1707 }
1708
1709 function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1710         global $config;
1711         $sources = array();
1712
1713         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1714         if (!isset($opts['title']))
1715                 $opts['title'] = $title;
1716         $opts['number_format'] = '%5.1lf%s';
1717         $opts['rrd_opts']      = array('-b', '1024', '-v', 'Bytes');
1718
1719         $files = array();
1720         $opts['colors'] = array(
1721                 // Linux - System memoery
1722                 'free'     => '00e000',
1723                 'cached'   => '0000ff',
1724                 'buffered' => 'ffb000',
1725                 'used'     => 'ff0000',
1726                 // Bind - Server memory
1727                 'TotalUse'    => '00e000',
1728                 'InUse'       => 'ff0000',
1729                 'BlockSize'   => '8888dd',
1730                 'ContextSize' => '444499',
1731                 'Lost'        => '222222'
1732         );
1733
1734         $type_instances = array('free', 'cached', 'buffered', 'used',   'TotalUse', 'InUse', 'BlockSize', 'ContextSize', 'Lost');
1735         while (list($k, $inst) = each($type_instances)) {
1736                 $file = '';
1737                 foreach ($config['datadirs'] as $datadir)
1738                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1739                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1740                                 break;
1741                         }
1742                 if ($file == '')
1743                         continue;
1744
1745                 $sources[] = array('name'=>$inst, 'file'=>$file);
1746         }
1747
1748         return collectd_draw_meta_stack($opts, $sources);
1749 }
1750
1751 function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1752         global $config;
1753         $sources = array();
1754
1755         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1756         if (!isset($opts['title']))
1757                 $opts['title'] = $title;
1758         $opts['number_format'] = '%5.1lf%s';
1759         $opts['rrd_opts']      = array('-v', 'Threads');
1760
1761         $files = array();
1762         $opts['colors'] = array(
1763                 'total'   => 'F0A000',
1764                 'running'  => 'FF0000',
1765                 'onhold'  => '00E000',
1766                 'uninterruptable' => '0000FF'
1767         );
1768
1769         $type_instances = array('total', 'running', 'onhold', 'uninterruptable');
1770         while (list($k, $inst) = each($type_instances)) {
1771                 $file = '';
1772                 foreach ($config['datadirs'] as $datadir)
1773                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1774                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1775                                 break;
1776                         }
1777                 if ($file == '')
1778                         continue;
1779
1780                 $sources[] = array('name'=>$inst, 'file'=>$file);
1781         }
1782
1783         return collectd_draw_meta_line($opts, $sources);
1784 }
1785
1786 function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1787         global $config;
1788         $sources = array();
1789
1790         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1791         if (!isset($opts['title']))
1792                 $opts['title'] = $title;
1793         $opts['number_format'] = '%5.1lf%s';
1794         $opts['rrd_opts']      = array('-b', '1024', '-v', 'Bytes');
1795
1796         $files = array();
1797         $opts['colors'] = array(
1798                 'vm'   => 'F0A000',
1799                 'vml'  => 'FF0000',
1800                 'rss'  => '00E000',
1801                 'anon' => '0000FF'
1802         );
1803
1804         $type_instances = array('anon', 'rss', 'vml', 'vm');
1805         while (list($k, $inst) = each($type_instances)) {
1806                 $file = '';
1807                 foreach ($config['datadirs'] as $datadir)
1808                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1809                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1810                                 break;
1811                         }
1812                 if ($file == '')
1813                         continue;
1814
1815                 $sources[] = array('name'=>$inst, 'file'=>$file);
1816         }
1817
1818         return collectd_draw_meta_line($opts, $sources);
1819 }
1820
1821 function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1822         global $config;
1823         $sources = array();
1824
1825         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1826         if (!isset($opts['title']))
1827                 $opts['title'] = $title;
1828         $opts['number_format'] = '%5.2lf';
1829         $opts['rrd_opts']      = array('-v', 'Errors/s');
1830
1831         $files = array();
1832
1833         while (list($k, $inst) = each($type_instances)) {
1834                 $file = '';
1835                 foreach ($config['datadirs'] as $datadir)
1836                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1837                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1838                                 break;
1839                         }
1840                 if ($file == '')
1841                         continue;
1842
1843                 $sources[] = array('name'=>$inst, 'file'=>$file);
1844         }
1845
1846         return collectd_draw_meta_stack($opts, $sources);
1847 }
1848
1849 function meta_graph_mysql_commands($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1850         global $config;
1851         $sources = array();
1852
1853         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1854         if (!isset($opts['title']))
1855                 $opts['title'] = $title;
1856         $opts['rrd_opts'] = array('-v', 'Issues/s');
1857         $opts['number_format'] = '%5.2lf';
1858
1859         $files = array();
1860
1861         while (list($k, $inst) = each($type_instances)) {
1862                 $file  = '';
1863                 foreach ($config['datadirs'] as $datadir)
1864                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1865                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1866                                 break;
1867                         }
1868                 if ($file == '')
1869                         continue;
1870
1871                 $sources[] = array('name'=>$inst, 'file'=>$file);
1872         }
1873
1874         return collectd_draw_meta_stack($opts, $sources);
1875 }
1876
1877 function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1878         global $config;
1879         $sources = array();
1880
1881         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1882         if (!isset($opts['title']))
1883                 $opts['title'] = $title;
1884         $opts['number_format'] = '%5.1lf%s';
1885         $opts['rrd_opts'] = array('-v', 'Ops/s');
1886
1887         $files = array();
1888
1889         while (list($k, $inst) = each($type_instances)) {
1890                 $file  = '';
1891                 foreach ($config['datadirs'] as $datadir)
1892                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1893                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1894                                 break;
1895                         }
1896                 if ($file == '')
1897                         continue;
1898
1899                 $sources[] = array('name'=>$inst, 'file'=>$file);
1900         }
1901
1902         return collectd_draw_meta_stack($opts, $sources);
1903 }
1904
1905 function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1906         global $config;
1907         $sources = array();
1908
1909         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1910         if (!isset($opts['title']))
1911                 $opts['title'] = $title;
1912         $opts['rrd_opts'] = array('-v', 'Processes');
1913
1914         $files = array();
1915         $opts['colors'] = array(
1916                 'running'  => '00e000',
1917                 'sleeping' => '0000ff',
1918                 'paging'   => 'ffb000',
1919                 'zombies'  => 'ff0000',
1920                 'blocked'  => 'ff00ff',
1921                 'stopped'  => 'a000a0'
1922         );
1923
1924         $type_instances = array('paging', 'blocked', 'zombies', 'stopped', 'running', 'sleeping');
1925         while (list($k, $inst) = each($type_instances)) {
1926                 $file = '';
1927                 foreach ($config['datadirs'] as $datadir)
1928                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1929                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1930                                 break;
1931                         }
1932                 if ($file == '')
1933                         continue;
1934
1935                 $sources[] = array('name'=>$inst, 'file'=>$file);
1936         }
1937
1938         return collectd_draw_meta_stack($opts, $sources);
1939 }
1940
1941 function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1942         global $config;
1943         $sources = array();
1944
1945         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1946         if (!isset($opts['title']))
1947                 $opts['title'] = $title;
1948         $opts['number_format'] = '%5.1lf%s';
1949         $opts['rrd_opts']      = array('-b', '1024', '-v', 'Bytes');
1950
1951         $files = array();
1952         $opts['colors'] = array(
1953                 'free'     => '00e000',
1954                 'cached'   => '0000ff',
1955                 'used'     => 'ff0000'
1956         );
1957
1958         $type_instances = array('free', 'cached', 'used');
1959         while (list($k, $inst) = each($type_instances)) {
1960                 $file = '';
1961                 foreach ($config['datadirs'] as $datadir)
1962                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
1963                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
1964                                 break;
1965                         }
1966                 if ($file == '')
1967                         continue;
1968
1969                 $sources[] = array('name'=>$inst, 'file'=>$file);
1970         }
1971
1972         return collectd_draw_meta_stack($opts, $sources);
1973 }
1974
1975 function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
1976         global $config;
1977         $sources = array();
1978
1979         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
1980         if (!isset($opts['title']))
1981                 $opts['title'] = $title;
1982         $opts['number_format'] = '%6.2lf%s';
1983         $opts['rrd_opts']      = array('-v', 'Processes');
1984
1985         $files = array();
1986         $opts['colors'] = array(
1987                 'open'         => '00e000',
1988                 'waiting'      => '0000ff',
1989                 'starting'     => 'a00000',
1990                 'reading'      => 'ff0000',
1991                 'sending'      => '00ff00',
1992                 'keepalive'    => 'f000f0',
1993                 'dnslookup'    => '00a000',
1994                 'logging'      => '008080',
1995                 'closing'      => 'a000a0',
1996                 'finishing'    => '000080',
1997                 'idle_cleanup' => '000000',
1998         );
1999
2000         $type_instances = array(/* 'open',*/ 'waiting', 'starting', 'reading', 'sending', 'keepalive', 'dnslookup', 'logging', 'closing', 'finishing', 'idle_cleanup');
2001         while (list($k, $inst) = each($type_instances)) {
2002                 $file = '';
2003                 foreach ($config['datadirs'] as $datadir)
2004                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
2005                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
2006                                 break;
2007                         }
2008                 if ($file == '')
2009                         continue;
2010
2011                 $sources[] = array('name'=>$inst, 'file'=>$file, 'ds'=>'count');
2012         }
2013
2014         return collectd_draw_meta_stack($opts, $sources);
2015 }
2016
2017 function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
2018         global $config;
2019         $sources = array();
2020
2021         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
2022         if (!isset($opts['title']))
2023                 $opts['title'] = $title;
2024         $opts['number_format'] = '%6.2lf%s';
2025         $opts['rrd_opts']      = array('-v', 'Connections');
2026
2027         $files = array();
2028         $opts['colors'] = array(
2029                 'ESTABLISHED' => '00e000',
2030                 'SYN_SENT'    => '00e0ff',
2031                 'SYN_RECV'    => '00e0a0',
2032                 'FIN_WAIT1'   => 'f000f0',
2033                 'FIN_WAIT2'   => 'f000a0',
2034                 'TIME_WAIT'   => 'ffb000',
2035                 'CLOSE'       => '0000f0',
2036                 'CLOSE_WAIT'  => '0000a0',
2037                 'LAST_ACK'    => '000080',
2038                 'LISTEN'      => 'ff0000',
2039                 'CLOSING'     => '000000'
2040         );
2041
2042         $type_instances = array('ESTABLISHED', 'SYN_SENT', 'SYN_RECV', 'FIN_WAIT1', 'FIN_WAIT2', 'TIME_WAIT', 'CLOSE', 'CLOSE_WAIT', 'LAST_ACK', 'CLOSING', 'LISTEN');
2043         while (list($k, $inst) = each($type_instances)) {
2044                 $file = '';
2045                 foreach ($config['datadirs'] as $datadir)
2046                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
2047                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
2048                                 break;
2049                         }
2050                 if ($file == '')
2051                         continue;
2052
2053                 $sources[] = array('name'=>$inst, 'file'=>$file, 'ds'=>'value');
2054         }
2055
2056         return collectd_draw_meta_stack($opts, $sources);
2057 }
2058
2059 function meta_graph_dns_event($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
2060         global $config;
2061         $sources = array();
2062
2063         $title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
2064         if (!isset($opts['title']))
2065                 $opts['title'] = $title;
2066         $opts['rrd_opts'] = array('-v', 'Events', '-r', '-l', '0');
2067
2068         $files = array();
2069 //      $opts['colors'] = array(
2070 //      );
2071
2072 //      $type_instances = array('IQUERY', 'NOTIFY');
2073         while (list($k, $inst) = each($type_instances)) {
2074                 $file  = '';
2075                 $title = $opts['title'];
2076                 foreach ($config['datadirs'] as $datadir)
2077                         if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
2078                                 $file = $datadir.'/'.$title.'-'.$inst.'.rrd';
2079                                 break;
2080                         }
2081                 if ($file == '')
2082                         continue;
2083
2084                 $sources[] = array('name'=>$inst, 'file'=>$file);
2085         }
2086         return collectd_draw_meta_stack($opts, $sources);
2087 }
2088
2089 ?>