6 use Carp (qw(cluck confess));
8 use CGI::Carp ('fatalsToBrowser');
9 use HTML::Entities ('encode_entities');
10 use URI::Escape ('uri_escape');
14 our $Config = "/etc/collection.conf";
27 our @RRDDefaultArgs = ('-w', '400');
32 our $MetaGraphDefs = {};
33 load_graph_definitions ();
35 for (qw(action host plugin plugin_instance type type_instance timespan))
37 $Args->{$_} = param ($_);
45 open ($fh, "< $Config") or confess ("open ($Config): $!");
46 while (my $line = <$fh>)
50 next if ($line =~ m/^\s*#/);
51 next if ($line =~ m/^\s*$/);
56 if ($line =~ m/^([A-Za-z]+):\s*"((?:[^"\\]+|\\.)*)"$/)
58 $key = lc ($1); $value = $2;
59 $value =~ s/\\(.)/$1/g;
61 elsif ($line =~ m/([A-Za-z]+):\s*([0-9]+)$/)
63 $key = lc ($1); $value = 0 + $2;
67 print STDERR "Cannot parse line: $line\n";
71 if ($key eq 'datadir')
74 push (@DataDirs, $value);
76 elsif ($key eq 'libdir')
83 print STDERR "Unknown key: $key\n";
91 if ($Args->{'action'} && ($Args->{'action'} =~ m/^(overview|show_host|show_plugin|show_type|show_graph)$/))
93 $Args->{'action'} = $1;
97 $Args->{'action'} = 'overview';
100 if ($Args->{'host'} && ($Args->{'host'} =~ m#/#))
102 delete ($Args->{'host'});
105 if ($Args->{'plugin'} && ($Args->{'plugin'} =~ m#/#))
107 delete ($Args->{'plugin'});
110 if ($Args->{'type'} && ($Args->{'type'} =~ m#/#))
112 delete ($Args->{'type'});
115 if (!$Args->{'plugin'} || ($Args->{'plugin_instance'}
116 && ($Args->{'plugin_instance'} =~ m#/#)))
118 delete ($Args->{'plugin_instance'});
121 if (!$Args->{'type'} || ($Args->{'type_instance'}
122 && ($Args->{'type_instance'} =~ m#/#)))
124 delete ($Args->{'type_instance'});
127 if (defined ($Args->{'timespan'})
128 && ($Args->{'timespan'} =~ m/^(hour|day|week|month|year)$/))
130 $Args->{'timespan'} = $1;
134 $Args->{'timespan'} = 'day';
142 if (defined ($hosts))
144 return (keys %$hosts);
149 for (my $i = 0; $i < @DataDirs; $i++)
154 opendir ($dh, $DataDirs[$i]) or next;
155 @tmp = grep { ($_ !~ m/^\./) && (-d $DataDirs[$i] . '/' . $_) } (readdir ($dh));
158 $hosts->{$_} = 1 for (@tmp);
161 return (keys %$hosts);
167 my %all_hosts = map { $_ => 1 } (_find_hosts ());
168 my @selected_hosts = ();
171 if (defined ($all_hosts{$_}))
173 push (@selected_hosts, "$_");
176 return (@selected_hosts);
179 sub _get_param_timespan
181 my $timespan = param ('timespan');
184 $timespan = lc ($timespan);
186 if (!defined ($ValidTimespan->{$timespan}))
192 } # _get_param_timespan
199 for (my $i = 0; $i < @DataDirs; $i++)
201 my $dir = $DataDirs[$i] . "/$host";
205 opendir ($dh, $dir) or next;
206 @tmp = grep { ($_ !~ m/^\./) && (-d "$dir/$_") } (readdir ($dh));
211 my ($plugin, $instance) = split (m/-/, $_, 2);
212 $plugins{$plugin} = [] if (!exists $plugins{$plugin});
213 push (@{$plugins{$plugin}}, $instance);
224 my $plugin_instance = shift;
227 for (my $i = 0; $i < @DataDirs; $i++)
229 my $dir = $DataDirs[$i] . "/$host/$plugin" . (defined ($plugin_instance) ? "-$plugin_instance" : '');
233 opendir ($dh, $dir) or next;
234 @tmp = grep { ($_ !~ m/^\./) && ($_ =~ m/\.rrd$/i) && (-f "$dir/$_") } (readdir ($dh));
240 $name =~ s/\.rrd$//i;
241 my ($type, $instance) = split (m/-/, $name, 2);
242 $types{$type} = [] if (!$types{$type});
243 push (@{$types{$type}}, $instance) if (defined ($instance));
250 sub _find_files_for_host
255 my %plugins = _find_plugins ($host);
259 my $plugin_instances = $plugins{$plugin};
261 if (!$plugin_instances || !@$plugin_instances)
263 $plugin_instances = ['-'];
266 $ret->{$plugin} = {};
268 for (@$plugin_instances)
270 my $plugin_instance = defined ($_) ? $_ : '-';
271 my %types = _find_types ($host, $plugin,
272 ($plugin_instance ne '-')
276 $ret->{$plugin}{$plugin_instance} = {};
281 my $type_instances = $types{$type};
283 $ret->{$plugin}{$plugin_instance}{$type} = {};
285 for (@$type_instances)
287 $ret->{$plugin}{$plugin_instance}{$type}{$_} = 1;
290 if (!@$type_instances)
292 $ret->{$plugin}{$plugin_instance}{$type}{'-'} = 1;
294 } # for (keys %types)
295 } # for (@$plugin_instances)
296 } # for (keys %plugins)
299 } # _find_files_for_host
301 sub _find_files_for_hosts
304 my $all_plugins = {};
306 for (my $i = 0; $i < @hosts; $i++)
308 my $tmp = _find_files_for_host ($hosts[$i]);
309 _files_union ($all_plugins, $tmp);
312 return ($all_plugins);
313 } # _find_files_for_hosts
323 $dest->{$plugin} ||= {};
325 for (keys %{$src->{$plugin}})
328 $dest->{$plugin}{$pinst} ||= {};
330 for (keys %{$src->{$plugin}{$pinst}})
333 $dest->{$plugin}{$pinst}{$type} ||= {};
335 for (keys %{$src->{$plugin}{$pinst}{$type}})
338 $dest->{$plugin}{$pinst}{$type}{$tinst} = 1;
345 sub _files_plugin_inst_count
352 if (exists ($MetaGraphDefs->{$_}))
358 $i = $i + keys %{$src->{$_}};
362 } # _files_plugin_count
366 my @hosts = _find_hosts ();
367 @hosts = sort (@hosts);
370 for (my $i = 0; $i < @hosts; $i++)
372 my $host_html = encode_entities ($hosts[$i]);
373 my $host_url = uri_escape ($hosts[$i]);
375 print qq( <li><a href="${\script_name ()}?action=show_host;host=$host_url">$host_html</a></li>\n);
383 if ($color =~ m/([0-9A-Fa-f][0-9A-Fa-f])([0-9A-Fa-f][0-9A-Fa-f])([0-9A-Fa-f][0-9A-Fa-f])/)
385 return ([hex ($1) / 255.0, hex ($2) / 255.0, hex ($3) / 255.0]);
392 confess ("Wrong number of arguments") if (@_ != 1);
393 return (sprintf ('%02hx%02hx%02hx', map { int (255.0 * $_) } @{$_[0]}));
396 sub _get_random_color
398 my ($r, $g, $b) = (rand (), rand ());
404 $min = 1.0 - ($r + $g);
408 $max = 2.0 - ($r + $g);
411 $b = $min + (rand () * ($max - $min));
413 return ([$r, $g, $b]);
414 } # _get_random_color
421 my $ret = [undef, undef, undef];
423 $opts{'background'} ||= [1.0, 1.0, 1.0];
424 $opts{'alpha'} ||= 0.25;
426 if (!ref ($opts{'background'}))
428 $opts{'background'} = _string_to_color ($opts{'background'})
429 or confess ("Cannot parse background color " . $opts{'background'});
431 $bg = $opts{'background'};
433 for (my $i = 0; $i < 3; $i++)
435 $ret->[$i] = ($opts{'alpha'} * $fg->[$i])
436 + ((1.0 - $opts{'alpha'}) * $bg->[$i]);
442 sub _custom_sort_arrayref
444 my $array_ref = shift;
445 my $array_sort = shift;
447 my %elements = map { $_ => 1 } (@$array_ref);
448 splice (@$array_ref, 0);
452 next if (!exists ($elements{$_}));
453 push (@$array_ref, $_);
454 delete ($elements{$_});
456 push (@$array_ref, sort (keys %elements));
457 } # _custom_sort_arrayref
461 my @hosts = _get_param_host ();
462 @hosts = sort (@hosts);
464 my $timespan = _get_param_timespan ();
465 my $all_plugins = _find_files_for_hosts (@hosts);
467 my $url_prefix = script_name () . '?action=show_plugin'
468 . join ('', map { ';host=' . uri_escape ($_) } (@hosts))
469 . ';timespan=' . uri_escape ($timespan);
471 print qq( <div><a href="${\script_name ()}?action=overview">Back to list of hosts</a></div>\n);
473 print " <p>Available plugins:</p>\n"
475 for (sort (keys %$all_plugins))
478 my $plugin_html = encode_entities ($plugin);
479 my $url_plugin = $url_prefix . ';plugin=' . uri_escape ($plugin);
480 print qq( <li><a href="$url_plugin">$plugin_html</a></li>\n);
485 sub action_show_plugin
487 my @hosts = _get_param_host ();
489 my $plugin_instance = shift;
490 my $timespan = _get_param_timespan ();
492 my $hosts_url = join (';', map { 'host=' . uri_escape ($_) } (@hosts));
493 my $url_prefix = script_name () . "?$hosts_url";
495 my $all_plugins = {};
496 my $plugins_per_host = {};
497 my $selected_plugins = {};
499 for (my $i = 0; $i < @hosts; $i++)
501 $plugins_per_host->{$hosts[$i]} = _find_files_for_host ($hosts[$i]);
502 _files_union ($all_plugins, $plugins_per_host->{$hosts[$i]});
505 for (param ('plugin'))
507 if (defined ($all_plugins->{$_}))
509 $selected_plugins->{$_} = 1;
513 print qq( <div><a href="${\script_name ()}?action=show_host;$hosts_url">Back to list of plugins</a></div>\n);
517 <table class="graphs">
523 print "\t<th>", encode_entities ($_), "</th>\n";
527 for (sort (keys %$selected_plugins))
530 my $plugin_html = encode_entities ($plugin);
531 my $plugin_url = "$url_prefix;plugin=" . uri_escape ($plugin);
532 my $all_pinst = $all_plugins->{$plugin};
534 for (sort (keys %$all_pinst))
538 my $pinst_url = $plugin_url;
542 $pinst_html = encode_entities ($pinst);
543 $pinst_url .= ';plugin_instance=' . uri_escape ($pinst);
546 my $files_printed = 0;
547 my $files_num = _files_plugin_inst_count ($all_pinst->{$pinst});
552 my $rowspan = ($files_num == 1) ? '' : qq( rowspan="$files_num");
554 for (sort (keys %{$all_plugins->{$plugin}{$pinst}}))
557 my $type_html = encode_entities ($type);
558 my $type_url = "$pinst_url;type=" . uri_escape ($type);
560 if ($files_printed == 0)
562 my $title = $plugin_html;
565 $title .= " ($pinst_html)";
568 print "\t<td$rowspan>$title</td>\n";
571 if (exists ($MetaGraphDefs->{$type}))
573 my $graph_url = script_name () . '?action=show_graph'
574 . ';plugin=' . uri_escape ($plugin)
575 . ';type=' . uri_escape ($type)
576 . ';timespan=' . uri_escape ($timespan);
579 $graph_url .= ';plugin_instance=' . uri_escape ($pinst);
582 if ($files_printed != 0)
590 my $host_graph_url = $graph_url . ';host=' . uri_escape ($host);
593 if (exists $plugins_per_host->{$host}{$plugin}{$pinst}{$type})
595 print qq(<img src="$host_graph_url" />);
596 #print encode_entities (qq(<img src="${\script_name ()}?action=show_graph;host=$host_esc;$param_plugin;$param_type;timespan=$timespan" />));
599 } # for (my $k = 0; $k < @hosts; $k++)
605 } # if (exists ($MetaGraphDefs->{$type}))
607 for (sort (keys %{$all_plugins->{$plugin}{$pinst}{$type}}))
610 my $tinst_esc = encode_entities ($tinst);
611 my $graph_url = script_name () . '?action=show_graph'
612 . ';plugin=' . uri_escape ($plugin)
613 . ';type=' . uri_escape ($type)
614 . ';timespan=' . uri_escape ($timespan);
617 $graph_url .= ';plugin_instance=' . uri_escape ($pinst);
621 $graph_url .= ';type_instance=' . uri_escape ($tinst);
624 if ($files_printed != 0)
629 for (my $k = 0; $k < @hosts; $k++)
631 my $host = $hosts[$k];
632 my $host_graph_url = $graph_url . ';host=' . uri_escape ($host);
635 if ($plugins_per_host->{$host}{$plugin}{$pinst}{$type}{$tinst})
637 print qq(<img src="$host_graph_url" />);
638 #print encode_entities (qq(<img src="${\script_name ()}?action=show_graph;host=$host_esc;$param_plugin;$param_type;timespan=$timespan" />));
641 } # for (my $k = 0; $k < @hosts; $k++)
651 } # action_show_plugin
657 my $plugin_instance = shift;
659 my $type_instance = shift;
661 my $host_url = uri_escape ($host);
662 my $plugin_url = uri_escape ($plugin);
663 my $plugin_html = encode_entities ($plugin);
664 my $plugin_instance_url = defined ($plugin_instance) ? uri_escape ($plugin_instance) : undef;
665 my $type_url = uri_escape ($type);
666 my $type_instance_url = defined ($type_instance) ? uri_escape ($type_instance) : undef;
668 my $url_prefix = script_name () . "?action=show_plugin;host=$host_url;plugin=$plugin_url";
669 $url_prefix .= ";plugin_instance=$plugin_instance_url" if (defined ($plugin_instance));
671 print qq( <div><a href="$url_prefix">Back to plugin "$plugin_html"</a></div>\n);
673 $url_prefix = script_name () . "?action=show_graph;host=$host_url;plugin=$plugin_url";
674 $url_prefix .= ";plugin_instance=$plugin_instance_url" if (defined ($plugin_instance));
675 $url_prefix .= ";type=$type_url";
676 $url_prefix .= ";type_instance=$type_instance_url" if (defined ($type_instance));
678 for (qw(hour day week month year))
682 print qq# <div><img src="$url_prefix;timespan=$timespan" /></div>\n#;
686 sub action_show_graph
690 my $plugin_instance = shift;
692 my $type_instance = shift;
696 my %times = (hour => -3600, day => -86400, week => 7 * -86400, month => 31 * -86400, year => 366 * -86400);
697 my $start_time = $times{$Args->{'timespan'}} || -86400;
699 #print STDERR Data::Dumper->Dump ([$Args], ['Args']);
702 if (exists ($MetaGraphDefs->{$type}))
704 my %types = _find_types ($host, $plugin, $plugin_instance);
705 return $MetaGraphDefs->{$type}->($host, $plugin, $plugin_instance, $type, $types{$type});
708 return if (!defined ($GraphDefs->{$type}));
709 @rrd_args = @{$GraphDefs->{$type}};
711 $title = "$host/$plugin" . (defined ($plugin_instance) ? "-$plugin_instance" : '')
712 . "/$type" . (defined ($type_instance) ? "-$type_instance" : '');
714 for (my $i = 0; $i < @DataDirs; $i++)
716 my $file = $DataDirs[$i] . "/$title.rrd";
720 s/{file}/$file/ for (@rrd_args);
722 RRDs::graph ('-', '-a', 'PNG', '-s', $start_time, '-t', $title, @RRDDefaultArgs, @rrd_args);
723 if (my $err = RRDs::error ())
725 die ("RRDs::graph: $err");
728 } # action_show_graph
732 my @hosts = _find_hosts ();
733 @hosts = sort (@hosts);
735 my %selected_hosts = map { $_ => 1 } (_get_param_host ());
736 my $timespan_selected = _get_param_timespan ();
739 <form action="${\script_name ()}" method="get">
741 <legend>Selector</legend>
742 <select name="host" multiple="multiple" size="10">
744 for (my $i = 0; $i < @hosts; $i++)
746 my $host = encode_entities ($hosts[$i]);
747 my $selected = defined ($selected_hosts{$hosts[$i]}) ? ' selected="selected"' : '';
748 print qq(\t <option value="$host"$selected>$host</option>\n);
750 print "\t</select>\n";
752 if (keys %selected_hosts)
754 my $all_plugins = _find_files_for_hosts (keys %selected_hosts);
755 my %selected_plugins = map { $_ => 1 } (param ('plugin'));
757 print qq(\t<select name="plugin" multiple="multiple" size="10">\n);
758 for (sort (keys %$all_plugins))
761 my $plugin_html = encode_entities ($plugin);
762 my $selected = (defined ($selected_plugins{$plugin})
763 ? ' selected="selected"' : '');
764 print qq(\t <option value="$plugin_html"$selected>$plugin</option>\n);
767 } # if (keys %selected_hosts)
769 print qq(\t<select name="timespan">\n);
770 for (qw(Hour Day Week Month Year))
772 my $timespan_uc = $_;
773 my $timespan_lc = lc ($_);
774 my $selected = ($timespan_selected eq $timespan_lc)
775 ? ' selected="selected"' : '';
776 print qq(\t <option value="$timespan_lc"$selected>$timespan_uc</option>\n);
780 <input type="submit" name="button" value="Ok" />
789 Content-Type: application/xhtml+xml; charset=utf-8
790 Cache-Control: no-cache
792 <?xml version="1.0" encoding="utf-8"?>
793 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
794 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
796 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
798 <title>collection.cgi, Version 2</title>
799 <style type="text/css">
806 border-collapse: collapse;
811 border: 1px solid black;
835 if (defined ($Args->{'host'})
836 && defined ($Args->{'plugin'})
837 && defined ($Args->{'type'})
838 && ($Args->{'action'} eq 'show_graph'))
841 print STDOUT header (-Content_Type => 'image/png');
842 action_show_graph ($Args->{'host'},
843 $Args->{'plugin'}, $Args->{'plugin_instance'},
844 $Args->{'type'}, $Args->{'type_instance'});
850 if (!$Args->{'host'})
854 elsif (!$Args->{'plugin'})
856 action_show_host ($Args->{'host'});
858 elsif (!$Args->{'type'})
860 action_show_plugin ($Args->{'plugin'}, $Args->{'plugin_instance'});
864 action_show_type ($Args->{'host'},
865 $Args->{'plugin'}, $Args->{'plugin_instance'},
866 $Args->{'type'}, $Args->{'type_instance'});
874 sub load_graph_definitions
876 my $Canvas = 'FFFFFF';
878 my $FullRed = 'FF0000';
879 my $FullGreen = '00E000';
880 my $FullBlue = '0000FF';
881 my $FullYellow = 'F0A000';
882 my $FullCyan = '00A0FF';
883 my $FullMagenta= 'A000FF';
885 my $HalfRed = 'F7B7B7';
886 my $HalfGreen = 'B7EFB7';
887 my $HalfBlue = 'B7B7F7';
888 my $HalfYellow = 'F3DFB7';
889 my $HalfCyan = 'B7DFF7';
890 my $HalfMagenta= 'DFB7F7';
892 my $HalfBlueGreen = '89B3C9';
896 apache_bytes => ['DEF:min_raw={file}:count:MIN',
897 'DEF:avg_raw={file}:count:AVERAGE',
898 'DEF:max_raw={file}:count:MAX',
899 'CDEF:min=min_raw,8,*',
900 'CDEF:avg=avg_raw,8,*',
901 'CDEF:max=max_raw,8,*',
902 'CDEF:mytime=avg_raw,TIME,TIME,IF',
903 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
904 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
905 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
906 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
907 "AREA:avg#$HalfBlue",
908 "LINE1:avg#$FullBlue:Bit/s",
909 'GPRINT:min:MIN:%5.1lf%s Min,',
910 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
911 'GPRINT:max:MAX:%5.1lf%s Max,',
912 'GPRINT:avg:LAST:%5.1lf%s Last',
913 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
915 apache_requests => ['DEF:min={file}:count:MIN',
916 'DEF:avg={file}:count:AVERAGE',
917 'DEF:max={file}:count:MAX',
918 "AREA:max#$HalfBlue",
920 "LINE1:avg#$FullBlue:Requests/s",
921 'GPRINT:min:MIN:%6.2lf Min,',
922 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
923 'GPRINT:max:MAX:%6.2lf Max,',
924 'GPRINT:avg:LAST:%6.2lf Last'
926 apache_scoreboard => ['DEF:min={file}:count:MIN',
927 'DEF:avg={file}:count:AVERAGE',
928 'DEF:max={file}:count:MAX',
929 "AREA:max#$HalfBlue",
931 "LINE1:avg#$FullBlue:Processes",
932 'GPRINT:min:MIN:%6.2lf Min,',
933 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
934 'GPRINT:max:MAX:%6.2lf Max,',
935 'GPRINT:avg:LAST:%6.2lf Last'
937 bitrate => ['-v', 'Bits/s',
938 'DEF:avg={file}:value:AVERAGE',
939 'DEF:min={file}:value:MIN',
940 'DEF:max={file}:value:MAX',
941 "AREA:max#$HalfBlue",
943 "LINE1:avg#$FullBlue:Bits/s",
944 'GPRINT:min:MIN:%5.1lf%s Min,',
945 'GPRINT:avg:AVERAGE:%5.1lf%s Average,',
946 'GPRINT:max:MAX:%5.1lf%s Max,',
947 'GPRINT:avg:LAST:%5.1lf%s Last\l'
949 charge => ['-v', 'Ah',
950 'DEF:avg={file}:value:AVERAGE',
951 'DEF:min={file}:value:MIN',
952 'DEF:max={file}:value:MAX',
953 "AREA:max#$HalfBlue",
955 "LINE1:avg#$FullBlue:Charge",
956 'GPRINT:min:MIN:%5.1lf%sAh Min,',
957 'GPRINT:avg:AVERAGE:%5.1lf%sAh Avg,',
958 'GPRINT:max:MAX:%5.1lf%sAh Max,',
959 'GPRINT:avg:LAST:%5.1lf%sAh Last\l'
961 cpu => ['-v', 'CPU load',
962 'DEF:avg={file}:value:AVERAGE',
963 'DEF:min={file}:value:MIN',
964 'DEF:max={file}:value:MAX',
965 "AREA:max#$HalfBlue",
967 "LINE1:avg#$FullBlue:Percent",
968 'GPRINT:min:MIN:%6.2lf%% Min,',
969 'GPRINT:avg:AVERAGE:%6.2lf%% Avg,',
970 'GPRINT:max:MAX:%6.2lf%% Max,',
971 'GPRINT:avg:LAST:%6.2lf%% Last\l'
973 current => ['-v', 'Ampere',
974 'DEF:avg={file}:value:AVERAGE',
975 'DEF:min={file}:value:MIN',
976 'DEF:max={file}:value:MAX',
977 "AREA:max#$HalfBlue",
979 "LINE1:avg#$FullBlue:Current",
980 'GPRINT:min:MIN:%5.1lf%sA Min,',
981 'GPRINT:avg:AVERAGE:%5.1lf%sA Avg,',
982 'GPRINT:max:MAX:%5.1lf%sA Max,',
983 'GPRINT:avg:LAST:%5.1lf%sA Last\l'
985 df => ['-v', 'Percent', '-l', '0',
986 'DEF:free_avg={file}:free:AVERAGE',
987 'DEF:free_min={file}:free:MIN',
988 'DEF:free_max={file}:free:MAX',
989 'DEF:used_avg={file}:used:AVERAGE',
990 'DEF:used_min={file}:used:MIN',
991 'DEF:used_max={file}:used:MAX',
992 'CDEF:total=free_avg,used_avg,+',
993 'CDEF:free_pct=100,free_avg,*,total,/',
994 'CDEF:used_pct=100,used_avg,*,total,/',
995 'CDEF:free_acc=free_pct,used_pct,+',
996 'CDEF:used_acc=used_pct',
997 "AREA:free_acc#$HalfGreen",
998 "AREA:used_acc#$HalfRed",
999 "LINE1:free_acc#$FullGreen:Free",
1000 'GPRINT:free_min:MIN:%5.1lf%sB Min,',
1001 'GPRINT:free_avg:AVERAGE:%5.1lf%sB Avg,',
1002 'GPRINT:free_max:MAX:%5.1lf%sB Max,',
1003 'GPRINT:free_avg:LAST:%5.1lf%sB Last\l',
1004 "LINE1:used_acc#$FullRed:Used",
1005 'GPRINT:used_min:MIN:%5.1lf%sB Min,',
1006 'GPRINT:used_avg:AVERAGE:%5.1lf%sB Avg,',
1007 'GPRINT:used_max:MAX:%5.1lf%sB Max,',
1008 'GPRINT:used_avg:LAST:%5.1lf%sB Last\l'
1011 'DEF:rtime_avg={file}:rtime:AVERAGE',
1012 'DEF:rtime_min={file}:rtime:MIN',
1013 'DEF:rtime_max={file}:rtime:MAX',
1014 'DEF:wtime_avg={file}:wtime:AVERAGE',
1015 'DEF:wtime_min={file}:wtime:MIN',
1016 'DEF:wtime_max={file}:wtime:MAX',
1017 'CDEF:rtime_avg_ms=rtime_avg,1000,/',
1018 'CDEF:rtime_min_ms=rtime_min,1000,/',
1019 'CDEF:rtime_max_ms=rtime_max,1000,/',
1020 'CDEF:wtime_avg_ms=wtime_avg,1000,/',
1021 'CDEF:wtime_min_ms=wtime_min,1000,/',
1022 'CDEF:wtime_max_ms=wtime_max,1000,/',
1023 'CDEF:total_avg_ms=rtime_avg_ms,wtime_avg_ms,+',
1024 'CDEF:total_min_ms=rtime_min_ms,wtime_min_ms,+',
1025 'CDEF:total_max_ms=rtime_max_ms,wtime_max_ms,+',
1026 "AREA:total_max_ms#$HalfRed",
1027 "AREA:total_min_ms#$Canvas",
1028 "LINE1:wtime_avg_ms#$FullGreen:Write",
1029 'GPRINT:wtime_min_ms:MIN:%5.1lf%s Min,',
1030 'GPRINT:wtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
1031 'GPRINT:wtime_max_ms:MAX:%5.1lf%s Max,',
1032 'GPRINT:wtime_avg_ms:LAST:%5.1lf%s Last\n',
1033 "LINE1:rtime_avg_ms#$FullBlue:Read ",
1034 'GPRINT:rtime_min_ms:MIN:%5.1lf%s Min,',
1035 'GPRINT:rtime_avg_ms:AVERAGE:%5.1lf%s Avg,',
1036 'GPRINT:rtime_max_ms:MAX:%5.1lf%s Max,',
1037 'GPRINT:rtime_avg_ms:LAST:%5.1lf%s Last\n',
1038 "LINE1:total_avg_ms#$FullRed:Total",
1039 'GPRINT:total_min_ms:MIN:%5.1lf%s Min,',
1040 'GPRINT:total_avg_ms:AVERAGE:%5.1lf%s Avg,',
1041 'GPRINT:total_max_ms:MAX:%5.1lf%s Max,',
1042 'GPRINT:total_avg_ms:LAST:%5.1lf%s Last'
1044 disk_octets => ['-v', 'Bytes/s',
1045 'DEF:out_min={file}:write:MIN',
1046 'DEF:out_avg={file}:write:AVERAGE',
1047 'DEF:out_max={file}:write:MAX',
1048 'DEF:inc_min={file}:read:MIN',
1049 'DEF:inc_avg={file}:read:AVERAGE',
1050 'DEF:inc_max={file}:read:MAX',
1051 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1052 'CDEF:mytime=out_avg,TIME,TIME,IF',
1053 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1054 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1055 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
1056 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
1057 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
1058 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
1059 "AREA:out_avg#$HalfGreen",
1060 "AREA:inc_avg#$HalfBlue",
1061 "AREA:overlap#$HalfBlueGreen",
1062 "LINE1:out_avg#$FullGreen:Written",
1063 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
1064 'GPRINT:out_max:MAX:%5.1lf%s Max,',
1065 'GPRINT:out_avg:LAST:%5.1lf%s Last',
1066 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1067 "LINE1:inc_avg#$FullBlue:Read ",
1068 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
1069 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
1070 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
1071 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1073 disk_merged => ['-v', 'Merged Ops/s',
1074 'DEF:out_min={file}:write:MIN',
1075 'DEF:out_avg={file}:write:AVERAGE',
1076 'DEF:out_max={file}:write:MAX',
1077 'DEF:inc_min={file}:read:MIN',
1078 'DEF:inc_avg={file}:read:AVERAGE',
1079 'DEF:inc_max={file}:read:MAX',
1080 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1081 "AREA:out_avg#$HalfGreen",
1082 "AREA:inc_avg#$HalfBlue",
1083 "AREA:overlap#$HalfBlueGreen",
1084 "LINE1:out_avg#$FullGreen:Written",
1085 'GPRINT:out_avg:AVERAGE:%6.2lf Avg,',
1086 'GPRINT:out_max:MAX:%6.2lf Max,',
1087 'GPRINT:out_avg:LAST:%6.2lf Last\l',
1088 "LINE1:inc_avg#$FullBlue:Read ",
1089 'GPRINT:inc_avg:AVERAGE:%6.2lf Avg,',
1090 'GPRINT:inc_max:MAX:%6.2lf Max,',
1091 'GPRINT:inc_avg:LAST:%6.2lf Last\l'
1093 disk_ops => ['-v', 'Ops/s',
1094 'DEF:out_min={file}:write:MIN',
1095 'DEF:out_avg={file}:write:AVERAGE',
1096 'DEF:out_max={file}:write:MAX',
1097 'DEF:inc_min={file}:read:MIN',
1098 'DEF:inc_avg={file}:read:AVERAGE',
1099 'DEF:inc_max={file}:read:MAX',
1100 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1101 "AREA:out_avg#$HalfGreen",
1102 "AREA:inc_avg#$HalfBlue",
1103 "AREA:overlap#$HalfBlueGreen",
1104 "LINE1:out_avg#$FullGreen:Written",
1105 'GPRINT:out_avg:AVERAGE:%6.2lf Avg,',
1106 'GPRINT:out_max:MAX:%6.2lf Max,',
1107 'GPRINT:out_avg:LAST:%6.2lf Last\l',
1108 "LINE1:inc_avg#$FullBlue:Read ",
1109 'GPRINT:inc_avg:AVERAGE:%6.2lf Avg,',
1110 'GPRINT:inc_max:MAX:%6.2lf Max,',
1111 'GPRINT:inc_avg:LAST:%6.2lf Last\l'
1113 disk_time => ['-v', 'Seconds/s',
1114 'DEF:out_min_raw={file}:write:MIN',
1115 'DEF:out_avg_raw={file}:write:AVERAGE',
1116 'DEF:out_max_raw={file}:write:MAX',
1117 'DEF:inc_min_raw={file}:read:MIN',
1118 'DEF:inc_avg_raw={file}:read:AVERAGE',
1119 'DEF:inc_max_raw={file}:read:MAX',
1120 'CDEF:out_min=out_min_raw,1000,/',
1121 'CDEF:out_avg=out_avg_raw,1000,/',
1122 'CDEF:out_max=out_max_raw,1000,/',
1123 'CDEF:inc_min=inc_min_raw,1000,/',
1124 'CDEF:inc_avg=inc_avg_raw,1000,/',
1125 'CDEF:inc_max=inc_max_raw,1000,/',
1126 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
1127 "AREA:out_avg#$HalfGreen",
1128 "AREA:inc_avg#$HalfBlue",
1129 "AREA:overlap#$HalfBlueGreen",
1130 "LINE1:out_avg#$FullGreen:Written",
1131 'GPRINT:out_avg:AVERAGE:%5.1lf%ss Avg,',
1132 'GPRINT:out_max:MAX:%5.1lf%ss Max,',
1133 'GPRINT:out_avg:LAST:%5.1lf%ss Last\l',
1134 "LINE1:inc_avg#$FullBlue:Read ",
1135 'GPRINT:inc_avg:AVERAGE:%5.1lf%ss Avg,',
1136 'GPRINT:inc_max:MAX:%5.1lf%ss Max,',
1137 'GPRINT:inc_avg:LAST:%5.1lf%ss Last\l'
1139 dns_octets => ['DEF:rsp_min_raw={file}:responses:MIN',
1140 'DEF:rsp_avg_raw={file}:responses:AVERAGE',
1141 'DEF:rsp_max_raw={file}:responses:MAX',
1142 'DEF:qry_min_raw={file}:queries:MIN',
1143 'DEF:qry_avg_raw={file}:queries:AVERAGE',
1144 'DEF:qry_max_raw={file}:queries:MAX',
1145 'CDEF:rsp_min=rsp_min_raw,8,*',
1146 'CDEF:rsp_avg=rsp_avg_raw,8,*',
1147 'CDEF:rsp_max=rsp_max_raw,8,*',
1148 'CDEF:qry_min=qry_min_raw,8,*',
1149 'CDEF:qry_avg=qry_avg_raw,8,*',
1150 'CDEF:qry_max=qry_max_raw,8,*',
1151 'CDEF:overlap=rsp_avg,qry_avg,GT,qry_avg,rsp_avg,IF',
1152 'CDEF:mytime=rsp_avg_raw,TIME,TIME,IF',
1153 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1154 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1155 'CDEF:rsp_avg_sample=rsp_avg_raw,UN,0,rsp_avg_raw,IF,sample_len,*',
1156 'CDEF:rsp_avg_sum=PREV,UN,0,PREV,IF,rsp_avg_sample,+',
1157 'CDEF:qry_avg_sample=qry_avg_raw,UN,0,qry_avg_raw,IF,sample_len,*',
1158 'CDEF:qry_avg_sum=PREV,UN,0,PREV,IF,qry_avg_sample,+',
1159 "AREA:rsp_avg#$HalfGreen",
1160 "AREA:qry_avg#$HalfBlue",
1161 "AREA:overlap#$HalfBlueGreen",
1162 "LINE1:rsp_avg#$FullGreen:Responses",
1163 'GPRINT:rsp_avg:AVERAGE:%5.1lf%s Avg,',
1164 'GPRINT:rsp_max:MAX:%5.1lf%s Max,',
1165 'GPRINT:rsp_avg:LAST:%5.1lf%s Last',
1166 'GPRINT:rsp_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1167 "LINE1:qry_avg#$FullBlue:Queries ",
1168 #'GPRINT:qry_min:MIN:%5.1lf %s Min,',
1169 'GPRINT:qry_avg:AVERAGE:%5.1lf%s Avg,',
1170 'GPRINT:qry_max:MAX:%5.1lf%s Max,',
1171 'GPRINT:qry_avg:LAST:%5.1lf%s Last',
1172 'GPRINT:qry_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1175 'DEF:avg={file}:value:AVERAGE',
1176 'DEF:min={file}:value:MIN',
1177 'DEF:max={file}:value:MAX',
1178 "AREA:max#$HalfBlue",
1180 "LINE1:avg#$FullBlue:Queries/s",
1181 'GPRINT:min:MIN:%9.3lf Min,',
1182 'GPRINT:avg:AVERAGE:%9.3lf Average,',
1183 'GPRINT:max:MAX:%9.3lf Max,',
1184 'GPRINT:avg:LAST:%9.3lf Last\l'
1186 email_count => ['-v', 'Mails',
1187 'DEF:avg={file}:value:AVERAGE',
1188 'DEF:min={file}:value:MIN',
1189 'DEF:max={file}:value:MAX',
1190 "AREA:max#$HalfMagenta",
1192 "LINE1:avg#$FullMagenta:Count ",
1193 'GPRINT:min:MIN:%4.1lf Min,',
1194 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1195 'GPRINT:max:MAX:%4.1lf Max,',
1196 'GPRINT:avg:LAST:%4.1lf Last\l'
1198 email_size => ['-v', 'Bytes',
1199 'DEF:avg={file}:value:AVERAGE',
1200 'DEF:min={file}:value:MIN',
1201 'DEF:max={file}:value:MAX',
1202 "AREA:max#$HalfMagenta",
1204 "LINE1:avg#$FullMagenta:Count ",
1205 'GPRINT:min:MIN:%4.1lf Min,',
1206 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1207 'GPRINT:max:MAX:%4.1lf Max,',
1208 'GPRINT:avg:LAST:%4.1lf Last\l'
1210 spam_score => ['-v', 'Score',
1211 'DEF:avg={file}:value:AVERAGE',
1212 'DEF:min={file}:value:MIN',
1213 'DEF:max={file}:value:MAX',
1214 "AREA:max#$HalfBlue",
1216 "LINE1:avg#$FullBlue:Score ",
1217 'GPRINT:min:MIN:%4.1lf Min,',
1218 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1219 'GPRINT:max:MAX:%4.1lf Max,',
1220 'GPRINT:avg:LAST:%4.1lf Last\l'
1223 'DEF:avg={file}:hits:AVERAGE',
1224 'DEF:min={file}:hits:MIN',
1225 'DEF:max={file}:hits:MAX',
1226 "AREA:max#$HalfMagenta",
1228 "LINE1:avg#$FullMagenta:Count ",
1229 'GPRINT:min:MIN:%4.1lf Min,',
1230 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1231 'GPRINT:max:MAX:%4.1lf Max,',
1232 'GPRINT:avg:LAST:%4.1lf Last\l'
1234 entropy => ['-v', 'Bits',
1235 'DEF:avg={file}:entropy:AVERAGE',
1236 'DEF:min={file}:entropy:MIN',
1237 'DEF:max={file}:entropy:MAX',
1238 "AREA:max#$HalfBlue",
1240 "LINE1:avg#$FullBlue:Bits",
1241 'GPRINT:min:MIN:%4.0lfbit Min,',
1242 'GPRINT:avg:AVERAGE:%4.0lfbit Avg,',
1243 'GPRINT:max:MAX:%4.0lfbit Max,',
1244 'GPRINT:avg:LAST:%4.0lfbit Last\l'
1246 fanspeed => ['-v', 'RPM',
1247 'DEF:avg={file}:value:AVERAGE',
1248 'DEF:min={file}:value:MIN',
1249 'DEF:max={file}:value:MAX',
1250 "AREA:max#$HalfMagenta",
1252 "LINE1:avg#$FullMagenta:RPM",
1253 'GPRINT:min:MIN:%4.1lf Min,',
1254 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1255 'GPRINT:max:MAX:%4.1lf Max,',
1256 'GPRINT:avg:LAST:%4.1lf Last\l'
1258 frequency => ['-v', 'Hertz',
1259 'DEF:avg={file}:frequency:AVERAGE',
1260 'DEF:min={file}:frequency:MIN',
1261 'DEF:max={file}:frequency:MAX',
1262 "AREA:max#$HalfBlue",
1264 "LINE1:avg#$FullBlue:Frequency [Hz]",
1265 'GPRINT:min:MIN:%4.1lf Min,',
1266 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1267 'GPRINT:max:MAX:%4.1lf Max,',
1268 'GPRINT:avg:LAST:%4.1lf Last\l'
1270 frequency_offset => [ # NTPd
1271 'DEF:ppm_avg={file}:ppm:AVERAGE',
1272 'DEF:ppm_min={file}:ppm:MIN',
1273 'DEF:ppm_max={file}:ppm:MAX',
1274 "AREA:ppm_max#$HalfBlue",
1275 "AREA:ppm_min#$Canvas",
1276 "LINE1:ppm_avg#$FullBlue:{inst}",
1277 'GPRINT:ppm_min:MIN:%5.2lf Min,',
1278 'GPRINT:ppm_avg:AVERAGE:%5.2lf Avg,',
1279 'GPRINT:ppm_max:MAX:%5.2lf Max,',
1280 'GPRINT:ppm_avg:LAST:%5.2lf Last'
1282 gauge => ['-v', 'Exec value',
1283 'DEF:temp_avg={file}:value:AVERAGE',
1284 'DEF:temp_min={file}:value:MIN',
1285 'DEF:temp_max={file}:value:MAX',
1286 "AREA:temp_max#$HalfBlue",
1287 "AREA:temp_min#$Canvas",
1288 "LINE1:temp_avg#$FullBlue:Exec value",
1289 'GPRINT:temp_min:MIN:%6.2lf Min,',
1290 'GPRINT:temp_avg:AVERAGE:%6.2lf Avg,',
1291 'GPRINT:temp_max:MAX:%6.2lf Max,',
1292 'GPRINT:temp_avg:LAST:%6.2lf Last\l'
1295 'DEF:temp_avg={file}:value:AVERAGE',
1296 'DEF:temp_min={file}:value:MIN',
1297 'DEF:temp_max={file}:value:MAX',
1298 "AREA:temp_max#$HalfRed",
1299 "AREA:temp_min#$Canvas",
1300 "LINE1:temp_avg#$FullRed:Temperature",
1301 'GPRINT:temp_min:MIN:%4.1lf Min,',
1302 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
1303 'GPRINT:temp_max:MAX:%4.1lf Max,',
1304 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
1306 humidity => ['-v', 'Percent',
1307 'DEF:temp_avg={file}:value:AVERAGE',
1308 'DEF:temp_min={file}:value:MIN',
1309 'DEF:temp_max={file}:value:MAX',
1310 "AREA:temp_max#$HalfGreen",
1311 "AREA:temp_min#$Canvas",
1312 "LINE1:temp_avg#$FullGreen:Temperature",
1313 'GPRINT:temp_min:MIN:%4.1lf%% Min,',
1314 'GPRINT:temp_avg:AVERAGE:%4.1lf%% Avg,',
1315 'GPRINT:temp_max:MAX:%4.1lf%% Max,',
1316 'GPRINT:temp_avg:LAST:%4.1lf%% Last\l'
1318 if_errors => ['-v', 'Errors/s',
1319 'DEF:tx_min={file}:tx:MIN',
1320 'DEF:tx_avg={file}:tx:AVERAGE',
1321 'DEF:tx_max={file}:tx:MAX',
1322 'DEF:rx_min={file}:rx:MIN',
1323 'DEF:rx_avg={file}:rx:AVERAGE',
1324 'DEF:rx_max={file}:rx:MAX',
1325 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1326 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1327 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1328 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1329 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1330 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1331 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1332 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1333 "AREA:tx_avg#$HalfGreen",
1334 "AREA:rx_avg#$HalfBlue",
1335 "AREA:overlap#$HalfBlueGreen",
1336 "LINE1:tx_avg#$FullGreen:TX",
1337 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1338 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1339 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1340 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1341 "LINE1:rx_avg#$FullBlue:RX",
1342 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1343 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1344 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1345 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1346 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1348 if_collisions => ['-v', 'Collisions/s',
1349 'DEF:min_raw={file}:value:MIN',
1350 'DEF:avg_raw={file}:value:AVERAGE',
1351 'DEF:max_raw={file}:value:MAX',
1352 'CDEF:min=min_raw,8,*',
1353 'CDEF:avg=avg_raw,8,*',
1354 'CDEF:max=max_raw,8,*',
1355 "AREA:max#$HalfBlue",
1357 "LINE1:avg#$FullBlue:Collisions/s",
1358 'GPRINT:min:MIN:%5.1lf %s Min,',
1359 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1360 'GPRINT:max:MAX:%5.1lf%s Max,',
1361 'GPRINT:avg:LAST:%5.1lf%s Last\l'
1363 if_dropped => ['-v', 'Packets/s',
1364 'DEF:tx_min={file}:tx:MIN',
1365 'DEF:tx_avg={file}:tx:AVERAGE',
1366 'DEF:tx_max={file}:tx:MAX',
1367 'DEF:rx_min={file}:rx:MIN',
1368 'DEF:rx_avg={file}:rx:AVERAGE',
1369 'DEF:rx_max={file}:rx:MAX',
1370 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1371 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1372 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1373 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1374 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1375 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1376 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1377 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1378 "AREA:tx_avg#$HalfGreen",
1379 "AREA:rx_avg#$HalfBlue",
1380 "AREA:overlap#$HalfBlueGreen",
1381 "LINE1:tx_avg#$FullGreen:TX",
1382 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1383 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1384 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1385 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1386 "LINE1:rx_avg#$FullBlue:RX",
1387 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1388 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1389 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1390 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1391 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1393 if_packets => ['-v', 'Packets/s',
1394 'DEF:tx_min={file}:tx:MIN',
1395 'DEF:tx_avg={file}:tx:AVERAGE',
1396 'DEF:tx_max={file}:tx:MAX',
1397 'DEF:rx_min={file}:rx:MIN',
1398 'DEF:rx_avg={file}:rx:AVERAGE',
1399 'DEF:rx_max={file}:rx:MAX',
1400 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1401 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1402 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1403 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1404 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1405 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1406 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1407 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1408 "AREA:tx_avg#$HalfGreen",
1409 "AREA:rx_avg#$HalfBlue",
1410 "AREA:overlap#$HalfBlueGreen",
1411 "LINE1:tx_avg#$FullGreen:TX",
1412 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1413 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1414 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1415 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1416 "LINE1:rx_avg#$FullBlue:RX",
1417 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1418 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1419 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1420 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1421 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1423 if_rx_errors => ['-v', 'Errors/s',
1424 'DEF:min={file}:value:MIN',
1425 'DEF:avg={file}:value:AVERAGE',
1426 'DEF:max={file}:value:MAX',
1427 'CDEF:mytime=avg,TIME,TIME,IF',
1428 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1429 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1430 'CDEF:avg_sample=avg,UN,0,avg,IF,sample_len,*',
1431 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
1432 "AREA:avg#$HalfBlue",
1433 "LINE1:avg#$FullBlue:Errors/s",
1434 'GPRINT:avg:AVERAGE:%3.1lf%s Avg,',
1435 'GPRINT:max:MAX:%3.1lf%s Max,',
1436 'GPRINT:avg:LAST:%3.1lf%s Last',
1437 'GPRINT:avg_sum:LAST:(ca. %2.0lf%s Total)\l'
1439 ipt_bytes => ['-v', 'Bits/s',
1440 'DEF:min_raw={file}:value:MIN',
1441 'DEF:avg_raw={file}:value:AVERAGE',
1442 'DEF:max_raw={file}:value:MAX',
1443 'CDEF:min=min_raw,8,*',
1444 'CDEF:avg=avg_raw,8,*',
1445 'CDEF:max=max_raw,8,*',
1446 'CDEF:mytime=avg_raw,TIME,TIME,IF',
1447 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1448 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1449 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
1450 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
1451 "AREA:max#$HalfBlue",
1453 "LINE1:avg#$FullBlue:Bits/s",
1454 #'GPRINT:min:MIN:%5.1lf %s Min,',
1455 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1456 'GPRINT:max:MAX:%5.1lf%s Max,',
1457 'GPRINT:avg:LAST:%5.1lf%s Last',
1458 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1460 ipt_packets => ['-v', 'Packets/s',
1461 'DEF:min_raw={file}:value:MIN',
1462 'DEF:avg_raw={file}:value:AVERAGE',
1463 'DEF:max_raw={file}:value:MAX',
1464 'CDEF:min=min_raw,8,*',
1465 'CDEF:avg=avg_raw,8,*',
1466 'CDEF:max=max_raw,8,*',
1467 "AREA:max#$HalfBlue",
1469 "LINE1:avg#$FullBlue:Packets/s",
1470 'GPRINT:min:MIN:%5.1lf %s Min,',
1471 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1472 'GPRINT:max:MAX:%5.1lf%s Max,',
1473 'GPRINT:avg:LAST:%5.1lf%s Last\l'
1475 irq => ['-v', 'Issues/s',
1476 'DEF:avg={file}:value:AVERAGE',
1477 'DEF:min={file}:value:MIN',
1478 'DEF:max={file}:value:MAX',
1479 "AREA:max#$HalfBlue",
1481 "LINE1:avg#$FullBlue:Issues/s",
1482 'GPRINT:min:MIN:%6.2lf Min,',
1483 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
1484 'GPRINT:max:MAX:%6.2lf Max,',
1485 'GPRINT:avg:LAST:%6.2lf Last\l'
1487 load => ['-v', 'System load',
1488 'DEF:s_avg={file}:shortterm:AVERAGE',
1489 'DEF:s_min={file}:shortterm:MIN',
1490 'DEF:s_max={file}:shortterm:MAX',
1491 'DEF:m_avg={file}:midterm:AVERAGE',
1492 'DEF:m_min={file}:midterm:MIN',
1493 'DEF:m_max={file}:midterm:MAX',
1494 'DEF:l_avg={file}:longterm:AVERAGE',
1495 'DEF:l_min={file}:longterm:MIN',
1496 'DEF:l_max={file}:longterm:MAX',
1497 "AREA:s_max#$HalfGreen",
1498 "AREA:s_min#$Canvas",
1499 "LINE1:s_avg#$FullGreen: 1m average",
1500 'GPRINT:s_min:MIN:%4.2lf Min,',
1501 'GPRINT:s_avg:AVERAGE:%4.2lf Avg,',
1502 'GPRINT:s_max:MAX:%4.2lf Max,',
1503 'GPRINT:s_avg:LAST:%4.2lf Last\n',
1504 "LINE1:m_avg#$FullBlue: 5m average",
1505 'GPRINT:m_min:MIN:%4.2lf Min,',
1506 'GPRINT:m_avg:AVERAGE:%4.2lf Avg,',
1507 'GPRINT:m_max:MAX:%4.2lf Max,',
1508 'GPRINT:m_avg:LAST:%4.2lf Last\n',
1509 "LINE1:l_avg#$FullRed:15m average",
1510 'GPRINT:l_min:MIN:%4.2lf Min,',
1511 'GPRINT:l_avg:AVERAGE:%4.2lf Avg,',
1512 'GPRINT:l_max:MAX:%4.2lf Max,',
1513 'GPRINT:l_avg:LAST:%4.2lf Last'
1516 'DEF:avg={file}:percent:AVERAGE',
1517 'DEF:min={file}:percent:MIN',
1518 'DEF:max={file}:percent:MAX',
1519 "AREA:max#$HalfBlue",
1521 "LINE1:avg#$FullBlue:Load",
1522 'GPRINT:min:MIN:%5.1lf%s%% Min,',
1523 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
1524 'GPRINT:max:MAX:%5.1lf%s%% Max,',
1525 'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
1527 mails => ['DEF:rawgood={file}:good:AVERAGE',
1528 'DEF:rawspam={file}:spam:AVERAGE',
1529 'CDEF:good=rawgood,UN,0,rawgood,IF',
1530 'CDEF:spam=rawspam,UN,0,rawspam,IF',
1531 'CDEF:negspam=spam,-1,*',
1532 "AREA:good#$HalfGreen",
1533 "LINE1:good#$FullGreen:Good mails",
1534 'GPRINT:good:AVERAGE:%4.1lf Avg,',
1535 'GPRINT:good:MAX:%4.1lf Max,',
1536 'GPRINT:good:LAST:%4.1lf Last\n',
1537 "AREA:negspam#$HalfRed",
1538 "LINE1:negspam#$FullRed:Spam mails",
1539 'GPRINT:spam:AVERAGE:%4.1lf Avg,',
1540 'GPRINT:spam:MAX:%4.1lf Max,',
1541 'GPRINT:spam:LAST:%4.1lf Last',
1544 memory => ['-b', '1024', '-v', 'Bytes',
1545 'DEF:avg={file}:value:AVERAGE',
1546 'DEF:min={file}:value:MIN',
1547 'DEF:max={file}:value:MAX',
1548 "AREA:max#$HalfBlue",
1550 "LINE1:avg#$FullBlue:Memory",
1551 'GPRINT:min:MIN:%5.1lf%sbyte Min,',
1552 'GPRINT:avg:AVERAGE:%5.1lf%sbyte Avg,',
1553 'GPRINT:max:MAX:%5.1lf%sbyte Max,',
1554 'GPRINT:avg:LAST:%5.1lf%sbyte Last\l'
1557 'DEF:used_avg={file}:used:AVERAGE',
1558 'DEF:free_avg={file}:free:AVERAGE',
1559 'DEF:buffers_avg={file}:buffers:AVERAGE',
1560 'DEF:cached_avg={file}:cached:AVERAGE',
1561 'DEF:used_min={file}:used:MIN',
1562 'DEF:free_min={file}:free:MIN',
1563 'DEF:buffers_min={file}:buffers:MIN',
1564 'DEF:cached_min={file}:cached:MIN',
1565 'DEF:used_max={file}:used:MAX',
1566 'DEF:free_max={file}:free:MAX',
1567 'DEF:buffers_max={file}:buffers:MAX',
1568 'DEF:cached_max={file}:cached:MAX',
1569 'CDEF:cached_avg_nn=cached_avg,UN,0,cached_avg,IF',
1570 'CDEF:buffers_avg_nn=buffers_avg,UN,0,buffers_avg,IF',
1571 'CDEF:free_cached_buffers_used=free_avg,cached_avg_nn,+,buffers_avg_nn,+,used_avg,+',
1572 'CDEF:cached_buffers_used=cached_avg,buffers_avg_nn,+,used_avg,+',
1573 'CDEF:buffers_used=buffers_avg,used_avg,+',
1574 "AREA:free_cached_buffers_used#$HalfGreen",
1575 "AREA:cached_buffers_used#$HalfBlue",
1576 "AREA:buffers_used#$HalfYellow",
1577 "AREA:used_avg#$HalfRed",
1578 "LINE1:free_cached_buffers_used#$FullGreen:Free ",
1579 'GPRINT:free_min:MIN:%5.1lf%s Min,',
1580 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
1581 'GPRINT:free_max:MAX:%5.1lf%s Max,',
1582 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
1583 "LINE1:cached_buffers_used#$FullBlue:Page cache ",
1584 'GPRINT:cached_min:MIN:%5.1lf%s Min,',
1585 'GPRINT:cached_avg:AVERAGE:%5.1lf%s Avg,',
1586 'GPRINT:cached_max:MAX:%5.1lf%s Max,',
1587 'GPRINT:cached_avg:LAST:%5.1lf%s Last\n',
1588 "LINE1:buffers_used#$FullYellow:Buffer cache",
1589 'GPRINT:buffers_min:MIN:%5.1lf%s Min,',
1590 'GPRINT:buffers_avg:AVERAGE:%5.1lf%s Avg,',
1591 'GPRINT:buffers_max:MAX:%5.1lf%s Max,',
1592 'GPRINT:buffers_avg:LAST:%5.1lf%s Last\n',
1593 "LINE1:used_avg#$FullRed:Used ",
1594 'GPRINT:used_min:MIN:%5.1lf%s Min,',
1595 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
1596 'GPRINT:used_max:MAX:%5.1lf%s Max,',
1597 'GPRINT:used_avg:LAST:%5.1lf%s Last'
1599 mysql_commands => ['-v', 'Issues/s',
1600 "DEF:val_avg={file}:value:AVERAGE",
1601 "DEF:val_min={file}:value:MIN",
1602 "DEF:val_max={file}:value:MAX",
1603 "AREA:val_max#$HalfBlue",
1604 "AREA:val_min#$Canvas",
1605 "LINE1:val_avg#$FullBlue:Issues/s",
1606 'GPRINT:val_min:MIN:%5.2lf Min,',
1607 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
1608 'GPRINT:val_max:MAX:%5.2lf Max,',
1609 'GPRINT:val_avg:LAST:%5.2lf Last'
1611 mysql_handler => ['-v', 'Issues/s',
1612 "DEF:val_avg={file}:value:AVERAGE",
1613 "DEF:val_min={file}:value:MIN",
1614 "DEF:val_max={file}:value:MAX",
1615 "AREA:val_max#$HalfBlue",
1616 "AREA:val_min#$Canvas",
1617 "LINE1:val_avg#$FullBlue:Issues/s",
1618 'GPRINT:val_min:MIN:%5.2lf Min,',
1619 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
1620 'GPRINT:val_max:MAX:%5.2lf Max,',
1621 'GPRINT:val_avg:LAST:%5.2lf Last'
1623 mysql_octets => ['-v', 'Bits/s',
1624 'DEF:out_min={file}:tx:MIN',
1625 'DEF:out_avg={file}:tx:AVERAGE',
1626 'DEF:out_max={file}:tx:MAX',
1627 'DEF:inc_min={file}:rx:MIN',
1628 'DEF:inc_avg={file}:rx:AVERAGE',
1629 'DEF:inc_max={file}:rx:MAX',
1630 'CDEF:mytime=out_avg,TIME,TIME,IF',
1631 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1632 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1633 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
1634 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
1635 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
1636 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
1637 'CDEF:out_bit_min=out_min,8,*',
1638 'CDEF:out_bit_avg=out_avg,8,*',
1639 'CDEF:out_bit_max=out_max,8,*',
1640 'CDEF:inc_bit_min=inc_min,8,*',
1641 'CDEF:inc_bit_avg=inc_avg,8,*',
1642 'CDEF:inc_bit_max=inc_max,8,*',
1643 'CDEF:overlap=out_bit_avg,inc_bit_avg,GT,inc_bit_avg,out_bit_avg,IF',
1644 "AREA:out_bit_avg#$HalfGreen",
1645 "AREA:inc_bit_avg#$HalfBlue",
1646 "AREA:overlap#$HalfBlueGreen",
1647 "LINE1:out_bit_avg#$FullGreen:Written",
1648 'GPRINT:out_bit_avg:AVERAGE:%5.1lf%s Avg,',
1649 'GPRINT:out_bit_max:MAX:%5.1lf%s Max,',
1650 'GPRINT:out_bit_avg:LAST:%5.1lf%s Last',
1651 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1652 "LINE1:inc_bit_avg#$FullBlue:Read ",
1653 'GPRINT:inc_bit_avg:AVERAGE:%5.1lf%s Avg,',
1654 'GPRINT:inc_bit_max:MAX:%5.1lf%s Max,',
1655 'GPRINT:inc_bit_avg:LAST:%5.1lf%s Last',
1656 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1658 mysql_qcache => ['-v', 'Queries/s',
1659 "DEF:hits_min={file}:hits:MIN",
1660 "DEF:hits_avg={file}:hits:AVERAGE",
1661 "DEF:hits_max={file}:hits:MAX",
1662 "DEF:inserts_min={file}:inserts:MIN",
1663 "DEF:inserts_avg={file}:inserts:AVERAGE",
1664 "DEF:inserts_max={file}:inserts:MAX",
1665 "DEF:not_cached_min={file}:not_cached:MIN",
1666 "DEF:not_cached_avg={file}:not_cached:AVERAGE",
1667 "DEF:not_cached_max={file}:not_cached:MAX",
1668 "DEF:lowmem_prunes_min={file}:lowmem_prunes:MIN",
1669 "DEF:lowmem_prunes_avg={file}:lowmem_prunes:AVERAGE",
1670 "DEF:lowmem_prunes_max={file}:lowmem_prunes:MAX",
1671 "DEF:queries_min={file}:queries_in_cache:MIN",
1672 "DEF:queries_avg={file}:queries_in_cache:AVERAGE",
1673 "DEF:queries_max={file}:queries_in_cache:MAX",
1674 "CDEF:unknown=queries_avg,UNKN,+",
1675 "CDEF:not_cached_agg=hits_avg,inserts_avg,+,not_cached_avg,+",
1676 "CDEF:inserts_agg=hits_avg,inserts_avg,+",
1677 "CDEF:hits_agg=hits_avg",
1678 "AREA:not_cached_agg#$HalfYellow",
1679 "AREA:inserts_agg#$HalfBlue",
1680 "AREA:hits_agg#$HalfGreen",
1681 "LINE1:not_cached_agg#$FullYellow:Not Cached ",
1682 'GPRINT:not_cached_min:MIN:%5.2lf Min,',
1683 'GPRINT:not_cached_avg:AVERAGE:%5.2lf Avg,',
1684 'GPRINT:not_cached_max:MAX:%5.2lf Max,',
1685 'GPRINT:not_cached_avg:LAST:%5.2lf Last\l',
1686 "LINE1:inserts_agg#$FullBlue:Inserts ",
1687 'GPRINT:inserts_min:MIN:%5.2lf Min,',
1688 'GPRINT:inserts_avg:AVERAGE:%5.2lf Avg,',
1689 'GPRINT:inserts_max:MAX:%5.2lf Max,',
1690 'GPRINT:inserts_avg:LAST:%5.2lf Last\l',
1691 "LINE1:hits_agg#$FullGreen:Hits ",
1692 'GPRINT:hits_min:MIN:%5.2lf Min,',
1693 'GPRINT:hits_avg:AVERAGE:%5.2lf Avg,',
1694 'GPRINT:hits_max:MAX:%5.2lf Max,',
1695 'GPRINT:hits_avg:LAST:%5.2lf Last\l',
1696 "LINE1:lowmem_prunes_avg#$FullRed:Lowmem Prunes ",
1697 'GPRINT:lowmem_prunes_min:MIN:%5.2lf Min,',
1698 'GPRINT:lowmem_prunes_avg:AVERAGE:%5.2lf Avg,',
1699 'GPRINT:lowmem_prunes_max:MAX:%5.2lf Max,',
1700 'GPRINT:lowmem_prunes_avg:LAST:%5.2lf Last\l',
1701 "LINE1:unknown#$Canvas:Queries in cache",
1702 'GPRINT:queries_min:MIN:%5.0lf Min,',
1703 'GPRINT:queries_avg:AVERAGE:%5.0lf Avg,',
1704 'GPRINT:queries_max:MAX:%5.0lf Max,',
1705 'GPRINT:queries_avg:LAST:%5.0lf Last\l'
1707 mysql_threads => ['-v', 'Threads',
1708 "DEF:running_min={file}:running:MIN",
1709 "DEF:running_avg={file}:running:AVERAGE",
1710 "DEF:running_max={file}:running:MAX",
1711 "DEF:connected_min={file}:connected:MIN",
1712 "DEF:connected_avg={file}:connected:AVERAGE",
1713 "DEF:connected_max={file}:connected:MAX",
1714 "DEF:cached_min={file}:cached:MIN",
1715 "DEF:cached_avg={file}:cached:AVERAGE",
1716 "DEF:cached_max={file}:cached:MAX",
1717 "DEF:created_min={file}:created:MIN",
1718 "DEF:created_avg={file}:created:AVERAGE",
1719 "DEF:created_max={file}:created:MAX",
1720 "CDEF:unknown=created_avg,UNKN,+",
1721 "CDEF:cached_agg=connected_avg,cached_avg,+",
1722 "AREA:cached_agg#$HalfGreen",
1723 "AREA:connected_avg#$HalfBlue",
1724 "AREA:running_avg#$HalfRed",
1725 "LINE1:cached_agg#$FullGreen:Cached ",
1726 'GPRINT:cached_min:MIN:%5.1lf Min,',
1727 'GPRINT:cached_avg:AVERAGE:%5.1lf Avg,',
1728 'GPRINT:cached_max:MAX:%5.1lf Max,',
1729 'GPRINT:cached_avg:LAST:%5.1lf Last\l',
1730 "LINE1:connected_avg#$FullBlue:Connected",
1731 'GPRINT:connected_min:MIN:%5.1lf Min,',
1732 'GPRINT:connected_avg:AVERAGE:%5.1lf Avg,',
1733 'GPRINT:connected_max:MAX:%5.1lf Max,',
1734 'GPRINT:connected_avg:LAST:%5.1lf Last\l',
1735 "LINE1:running_avg#$FullRed:Running ",
1736 'GPRINT:running_min:MIN:%5.1lf Min,',
1737 'GPRINT:running_avg:AVERAGE:%5.1lf Avg,',
1738 'GPRINT:running_max:MAX:%5.1lf Max,',
1739 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1740 "LINE1:unknown#$Canvas:Created ",
1741 'GPRINT:created_min:MIN:%5.0lf Min,',
1742 'GPRINT:created_avg:AVERAGE:%5.0lf Avg,',
1743 'GPRINT:created_max:MAX:%5.0lf Max,',
1744 'GPRINT:created_avg:LAST:%5.0lf Last\l'
1746 nfs_procedure => ['-v', 'Issues/s',
1747 'DEF:avg={file}:value:AVERAGE',
1748 'DEF:min={file}:value:MIN',
1749 'DEF:max={file}:value:MAX',
1750 "AREA:max#$HalfBlue",
1752 "LINE1:avg#$FullBlue:Issues/s",
1753 'GPRINT:min:MIN:%6.2lf Min,',
1754 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
1755 'GPRINT:max:MAX:%6.2lf Max,',
1756 'GPRINT:avg:LAST:%6.2lf Last\l'
1758 nfs3_procedures => [
1759 "DEF:null_avg={file}:null:AVERAGE",
1760 "DEF:getattr_avg={file}:getattr:AVERAGE",
1761 "DEF:setattr_avg={file}:setattr:AVERAGE",
1762 "DEF:lookup_avg={file}:lookup:AVERAGE",
1763 "DEF:access_avg={file}:access:AVERAGE",
1764 "DEF:readlink_avg={file}:readlink:AVERAGE",
1765 "DEF:read_avg={file}:read:AVERAGE",
1766 "DEF:write_avg={file}:write:AVERAGE",
1767 "DEF:create_avg={file}:create:AVERAGE",
1768 "DEF:mkdir_avg={file}:mkdir:AVERAGE",
1769 "DEF:symlink_avg={file}:symlink:AVERAGE",
1770 "DEF:mknod_avg={file}:mknod:AVERAGE",
1771 "DEF:remove_avg={file}:remove:AVERAGE",
1772 "DEF:rmdir_avg={file}:rmdir:AVERAGE",
1773 "DEF:rename_avg={file}:rename:AVERAGE",
1774 "DEF:link_avg={file}:link:AVERAGE",
1775 "DEF:readdir_avg={file}:readdir:AVERAGE",
1776 "DEF:readdirplus_avg={file}:readdirplus:AVERAGE",
1777 "DEF:fsstat_avg={file}:fsstat:AVERAGE",
1778 "DEF:fsinfo_avg={file}:fsinfo:AVERAGE",
1779 "DEF:pathconf_avg={file}:pathconf:AVERAGE",
1780 "DEF:commit_avg={file}:commit:AVERAGE",
1781 "DEF:null_max={file}:null:MAX",
1782 "DEF:getattr_max={file}:getattr:MAX",
1783 "DEF:setattr_max={file}:setattr:MAX",
1784 "DEF:lookup_max={file}:lookup:MAX",
1785 "DEF:access_max={file}:access:MAX",
1786 "DEF:readlink_max={file}:readlink:MAX",
1787 "DEF:read_max={file}:read:MAX",
1788 "DEF:write_max={file}:write:MAX",
1789 "DEF:create_max={file}:create:MAX",
1790 "DEF:mkdir_max={file}:mkdir:MAX",
1791 "DEF:symlink_max={file}:symlink:MAX",
1792 "DEF:mknod_max={file}:mknod:MAX",
1793 "DEF:remove_max={file}:remove:MAX",
1794 "DEF:rmdir_max={file}:rmdir:MAX",
1795 "DEF:rename_max={file}:rename:MAX",
1796 "DEF:link_max={file}:link:MAX",
1797 "DEF:readdir_max={file}:readdir:MAX",
1798 "DEF:readdirplus_max={file}:readdirplus:MAX",
1799 "DEF:fsstat_max={file}:fsstat:MAX",
1800 "DEF:fsinfo_max={file}:fsinfo:MAX",
1801 "DEF:pathconf_max={file}:pathconf:MAX",
1802 "DEF:commit_max={file}:commit:MAX",
1803 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
1804 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
1805 "CDEF:stack_read=read_avg",
1806 "CDEF:stack_getattr=stack_read,getattr_avg,+",
1807 "CDEF:stack_access=stack_getattr,access_avg,+",
1808 "CDEF:stack_lookup=stack_access,lookup_avg,+",
1809 "CDEF:stack_write=stack_lookup,write_avg,+",
1810 "CDEF:stack_commit=stack_write,commit_avg,+",
1811 "CDEF:stack_setattr=stack_commit,setattr_avg,+",
1812 "CDEF:stack_other=stack_setattr,other_avg,+",
1813 "AREA:stack_other#$HalfRed",
1814 "AREA:stack_setattr#$HalfGreen",
1815 "AREA:stack_commit#$HalfYellow",
1816 "AREA:stack_write#$HalfGreen",
1817 "AREA:stack_lookup#$HalfBlue",
1818 "AREA:stack_access#$HalfMagenta",
1819 "AREA:stack_getattr#$HalfCyan",
1820 "AREA:stack_read#$HalfBlue",
1821 "LINE1:stack_other#$FullRed:Other ",
1822 'GPRINT:other_max:MAX:%5.1lf Max,',
1823 'GPRINT:other_avg:AVERAGE:%5.1lf Avg,',
1824 'GPRINT:other_avg:LAST:%5.1lf Last\l',
1825 "LINE1:stack_setattr#$FullGreen:setattr",
1826 'GPRINT:setattr_max:MAX:%5.1lf Max,',
1827 'GPRINT:setattr_avg:AVERAGE:%5.1lf Avg,',
1828 'GPRINT:setattr_avg:LAST:%5.1lf Last\l',
1829 "LINE1:stack_commit#$FullYellow:commit ",
1830 'GPRINT:commit_max:MAX:%5.1lf Max,',
1831 'GPRINT:commit_avg:AVERAGE:%5.1lf Avg,',
1832 'GPRINT:commit_avg:LAST:%5.1lf Last\l',
1833 "LINE1:stack_write#$FullGreen:write ",
1834 'GPRINT:write_max:MAX:%5.1lf Max,',
1835 'GPRINT:write_avg:AVERAGE:%5.1lf Avg,',
1836 'GPRINT:write_avg:LAST:%5.1lf Last\l',
1837 "LINE1:stack_lookup#$FullBlue:lookup ",
1838 'GPRINT:lookup_max:MAX:%5.1lf Max,',
1839 'GPRINT:lookup_avg:AVERAGE:%5.1lf Avg,',
1840 'GPRINT:lookup_avg:LAST:%5.1lf Last\l',
1841 "LINE1:stack_access#$FullMagenta:access ",
1842 'GPRINT:access_max:MAX:%5.1lf Max,',
1843 'GPRINT:access_avg:AVERAGE:%5.1lf Avg,',
1844 'GPRINT:access_avg:LAST:%5.1lf Last\l',
1845 "LINE1:stack_getattr#$FullCyan:getattr",
1846 'GPRINT:getattr_max:MAX:%5.1lf Max,',
1847 'GPRINT:getattr_avg:AVERAGE:%5.1lf Avg,',
1848 'GPRINT:getattr_avg:LAST:%5.1lf Last\l',
1849 "LINE1:stack_read#$FullBlue:read ",
1850 'GPRINT:read_max:MAX:%5.1lf Max,',
1851 'GPRINT:read_avg:AVERAGE:%5.1lf Avg,',
1852 'GPRINT:read_avg:LAST:%5.1lf Last\l'
1855 "DEF:rbyte_avg={file}:rbytes:AVERAGE",
1856 "DEF:rbyte_min={file}:rbytes:MIN",
1857 "DEF:rbyte_max={file}:rbytes:MAX",
1858 "DEF:wbyte_avg={file}:wbytes:AVERAGE",
1859 "DEF:wbyte_min={file}:wbytes:MIN",
1860 "DEF:wbyte_max={file}:wbytes:MAX",
1861 'CDEF:overlap=wbyte_avg,rbyte_avg,GT,rbyte_avg,wbyte_avg,IF',
1862 "AREA:wbyte_avg#$HalfGreen",
1863 "AREA:rbyte_avg#$HalfBlue",
1864 "AREA:overlap#$HalfBlueGreen",
1865 "LINE1:wbyte_avg#$FullGreen:Write",
1866 'GPRINT:wbyte_min:MIN:%5.1lf%s Min,',
1867 'GPRINT:wbyte_avg:AVERAGE:%5.1lf%s Avg,',
1868 'GPRINT:wbyte_max:MAX:%5.1lf%s Max,',
1869 'GPRINT:wbyte_avg:LAST:%5.1lf%s Last\l',
1870 "LINE1:rbyte_avg#$FullBlue:Read ",
1871 'GPRINT:rbyte_min:MIN:%5.1lf%s Min,',
1872 'GPRINT:rbyte_avg:AVERAGE:%5.1lf%s Avg,',
1873 'GPRINT:rbyte_max:MAX:%5.1lf%s Max,',
1874 'GPRINT:rbyte_avg:LAST:%5.1lf%s Last\l'
1876 percent => ['-v', 'Percent',
1877 'DEF:avg={file}:percent:AVERAGE',
1878 'DEF:min={file}:percent:MIN',
1879 'DEF:max={file}:percent:MAX',
1880 "AREA:max#$HalfBlue",
1882 "LINE1:avg#$FullBlue:Percent",
1883 'GPRINT:min:MIN:%5.1lf%% Min,',
1884 'GPRINT:avg:AVERAGE:%5.1lf%% Avg,',
1885 'GPRINT:max:MAX:%5.1lf%% Max,',
1886 'GPRINT:avg:LAST:%5.1lf%% Last\l'
1888 ping => ['DEF:ping_avg={file}:ping:AVERAGE',
1889 'DEF:ping_min={file}:ping:MIN',
1890 'DEF:ping_max={file}:ping:MAX',
1891 "AREA:ping_max#$HalfBlue",
1892 "AREA:ping_min#$Canvas",
1893 "LINE1:ping_avg#$FullBlue:Ping",
1894 'GPRINT:ping_min:MIN:%4.1lf ms Min,',
1895 'GPRINT:ping_avg:AVERAGE:%4.1lf ms Avg,',
1896 'GPRINT:ping_max:MAX:%4.1lf ms Max,',
1897 'GPRINT:ping_avg:LAST:%4.1lf ms Last'],
1898 power => ['-v', 'Watt',
1899 'DEF:avg={file}:value:AVERAGE',
1900 'DEF:min={file}:value:MIN',
1901 'DEF:max={file}:value:MAX',
1902 "AREA:max#$HalfBlue",
1904 "LINE1:avg#$FullBlue:Watt",
1905 'GPRINT:min:MIN:%5.1lf%sW Min,',
1906 'GPRINT:avg:AVERAGE:%5.1lf%sW Avg,',
1907 'GPRINT:max:MAX:%5.1lf%sW Max,',
1908 'GPRINT:avg:LAST:%5.1lf%sW Last\l'
1911 "DEF:running_avg={file}:running:AVERAGE",
1912 "DEF:running_min={file}:running:MIN",
1913 "DEF:running_max={file}:running:MAX",
1914 "DEF:sleeping_avg={file}:sleeping:AVERAGE",
1915 "DEF:sleeping_min={file}:sleeping:MIN",
1916 "DEF:sleeping_max={file}:sleeping:MAX",
1917 "DEF:zombies_avg={file}:zombies:AVERAGE",
1918 "DEF:zombies_min={file}:zombies:MIN",
1919 "DEF:zombies_max={file}:zombies:MAX",
1920 "DEF:stopped_avg={file}:stopped:AVERAGE",
1921 "DEF:stopped_min={file}:stopped:MIN",
1922 "DEF:stopped_max={file}:stopped:MAX",
1923 "DEF:paging_avg={file}:paging:AVERAGE",
1924 "DEF:paging_min={file}:paging:MIN",
1925 "DEF:paging_max={file}:paging:MAX",
1926 "DEF:blocked_avg={file}:blocked:AVERAGE",
1927 "DEF:blocked_min={file}:blocked:MIN",
1928 "DEF:blocked_max={file}:blocked:MAX",
1929 'CDEF:paging_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,paging_avg,+,+,+,+,+',
1930 'CDEF:blocked_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,blocked_avg,+,+,+,+',
1931 'CDEF:zombies_acc=sleeping_avg,running_avg,stopped_avg,zombies_avg,+,+,+',
1932 'CDEF:stopped_acc=sleeping_avg,running_avg,stopped_avg,+,+',
1933 'CDEF:running_acc=sleeping_avg,running_avg,+',
1934 'CDEF:sleeping_acc=sleeping_avg',
1935 "AREA:paging_acc#$HalfYellow",
1936 "AREA:blocked_acc#$HalfCyan",
1937 "AREA:zombies_acc#$HalfRed",
1938 "AREA:stopped_acc#$HalfMagenta",
1939 "AREA:running_acc#$HalfGreen",
1940 "AREA:sleeping_acc#$HalfBlue",
1941 "LINE1:paging_acc#$FullYellow:Paging ",
1942 'GPRINT:paging_min:MIN:%5.1lf Min,',
1943 'GPRINT:paging_avg:AVERAGE:%5.1lf Average,',
1944 'GPRINT:paging_max:MAX:%5.1lf Max,',
1945 'GPRINT:paging_avg:LAST:%5.1lf Last\l',
1946 "LINE1:blocked_acc#$FullCyan:Blocked ",
1947 'GPRINT:blocked_min:MIN:%5.1lf Min,',
1948 'GPRINT:blocked_avg:AVERAGE:%5.1lf Average,',
1949 'GPRINT:blocked_max:MAX:%5.1lf Max,',
1950 'GPRINT:blocked_avg:LAST:%5.1lf Last\l',
1951 "LINE1:zombies_acc#$FullRed:Zombies ",
1952 'GPRINT:zombies_min:MIN:%5.1lf Min,',
1953 'GPRINT:zombies_avg:AVERAGE:%5.1lf Average,',
1954 'GPRINT:zombies_max:MAX:%5.1lf Max,',
1955 'GPRINT:zombies_avg:LAST:%5.1lf Last\l',
1956 "LINE1:stopped_acc#$FullMagenta:Stopped ",
1957 'GPRINT:stopped_min:MIN:%5.1lf Min,',
1958 'GPRINT:stopped_avg:AVERAGE:%5.1lf Average,',
1959 'GPRINT:stopped_max:MAX:%5.1lf Max,',
1960 'GPRINT:stopped_avg:LAST:%5.1lf Last\l',
1961 "LINE1:running_acc#$FullGreen:Running ",
1962 'GPRINT:running_min:MIN:%5.1lf Min,',
1963 'GPRINT:running_avg:AVERAGE:%5.1lf Average,',
1964 'GPRINT:running_max:MAX:%5.1lf Max,',
1965 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1966 "LINE1:sleeping_acc#$FullBlue:Sleeping",
1967 'GPRINT:sleeping_min:MIN:%5.1lf Min,',
1968 'GPRINT:sleeping_avg:AVERAGE:%5.1lf Average,',
1969 'GPRINT:sleeping_max:MAX:%5.1lf Max,',
1970 'GPRINT:sleeping_avg:LAST:%5.1lf Last\l'
1972 ps_count => ['-v', 'Processes',
1973 'DEF:procs_avg={file}:processes:AVERAGE',
1974 'DEF:procs_min={file}:processes:MIN',
1975 'DEF:procs_max={file}:processes:MAX',
1976 'DEF:thrds_avg={file}:threads:AVERAGE',
1977 'DEF:thrds_min={file}:threads:MIN',
1978 'DEF:thrds_max={file}:threads:MAX',
1979 "AREA:thrds_avg#$HalfBlue",
1980 "AREA:procs_avg#$HalfRed",
1981 "LINE1:thrds_avg#$FullBlue:Threads ",
1982 'GPRINT:thrds_min:MIN:%5.1lf Min,',
1983 'GPRINT:thrds_avg:AVERAGE:%5.1lf Avg,',
1984 'GPRINT:thrds_max:MAX:%5.1lf Max,',
1985 'GPRINT:thrds_avg:LAST:%5.1lf Last\l',
1986 "LINE1:procs_avg#$FullRed:Processes",
1987 'GPRINT:procs_min:MIN:%5.1lf Min,',
1988 'GPRINT:procs_avg:AVERAGE:%5.1lf Avg,',
1989 'GPRINT:procs_max:MAX:%5.1lf Max,',
1990 'GPRINT:procs_avg:LAST:%5.1lf Last\l'
1992 ps_cputime => ['-v', 'Jiffies',
1993 'DEF:user_avg_raw={file}:user:AVERAGE',
1994 'DEF:user_min_raw={file}:user:MIN',
1995 'DEF:user_max_raw={file}:user:MAX',
1996 'DEF:syst_avg_raw={file}:syst:AVERAGE',
1997 'DEF:syst_min_raw={file}:syst:MIN',
1998 'DEF:syst_max_raw={file}:syst:MAX',
1999 'CDEF:user_avg=user_avg_raw,1000000,/',
2000 'CDEF:user_min=user_min_raw,1000000,/',
2001 'CDEF:user_max=user_max_raw,1000000,/',
2002 'CDEF:syst_avg=syst_avg_raw,1000000,/',
2003 'CDEF:syst_min=syst_min_raw,1000000,/',
2004 'CDEF:syst_max=syst_max_raw,1000000,/',
2005 'CDEF:user_syst=syst_avg,UN,0,syst_avg,IF,user_avg,+',
2006 "AREA:user_syst#$HalfBlue",
2007 "AREA:syst_avg#$HalfRed",
2008 "LINE1:user_syst#$FullBlue:User ",
2009 'GPRINT:user_min:MIN:%5.1lf%s Min,',
2010 'GPRINT:user_avg:AVERAGE:%5.1lf%s Avg,',
2011 'GPRINT:user_max:MAX:%5.1lf%s Max,',
2012 'GPRINT:user_avg:LAST:%5.1lf%s Last\l',
2013 "LINE1:syst_avg#$FullRed:System",
2014 'GPRINT:syst_min:MIN:%5.1lf%s Min,',
2015 'GPRINT:syst_avg:AVERAGE:%5.1lf%s Avg,',
2016 'GPRINT:syst_max:MAX:%5.1lf%s Max,',
2017 'GPRINT:syst_avg:LAST:%5.1lf%s Last\l'
2019 ps_pagefaults => ['-v', 'Pagefaults/s',
2020 'DEF:minor_avg={file}:minflt:AVERAGE',
2021 'DEF:minor_min={file}:minflt:MIN',
2022 'DEF:minor_max={file}:minflt:MAX',
2023 'DEF:major_avg={file}:majflt:AVERAGE',
2024 'DEF:major_min={file}:majflt:MIN',
2025 'DEF:major_max={file}:majflt:MAX',
2026 'CDEF:minor_major=major_avg,UN,0,major_avg,IF,minor_avg,+',
2027 "AREA:minor_major#$HalfBlue",
2028 "AREA:major_avg#$HalfRed",
2029 "LINE1:minor_major#$FullBlue:Minor",
2030 'GPRINT:minor_min:MIN:%5.1lf%s Min,',
2031 'GPRINT:minor_avg:AVERAGE:%5.1lf%s Avg,',
2032 'GPRINT:minor_max:MAX:%5.1lf%s Max,',
2033 'GPRINT:minor_avg:LAST:%5.1lf%s Last\l',
2034 "LINE1:major_avg#$FullRed:Major",
2035 'GPRINT:major_min:MIN:%5.1lf%s Min,',
2036 'GPRINT:major_avg:AVERAGE:%5.1lf%s Avg,',
2037 'GPRINT:major_max:MAX:%5.1lf%s Max,',
2038 'GPRINT:major_avg:LAST:%5.1lf%s Last\l'
2040 ps_rss => ['-v', 'Bytes',
2041 'DEF:avg={file}:value:AVERAGE',
2042 'DEF:min={file}:value:MIN',
2043 'DEF:max={file}:value:MAX',
2044 "AREA:avg#$HalfBlue",
2045 "LINE1:avg#$FullBlue:RSS",
2046 'GPRINT:min:MIN:%5.1lf%s Min,',
2047 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
2048 'GPRINT:max:MAX:%5.1lf%s Max,',
2049 'GPRINT:avg:LAST:%5.1lf%s Last\l'
2051 ps_state => ['-v', 'Processes',
2052 'DEF:avg={file}:value:AVERAGE',
2053 'DEF:min={file}:value:MIN',
2054 'DEF:max={file}:value:MAX',
2055 "AREA:max#$HalfBlue",
2057 "LINE1:avg#$FullBlue:Processes",
2058 'GPRINT:min:MIN:%6.2lf Min,',
2059 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
2060 'GPRINT:max:MAX:%6.2lf Max,',
2061 'GPRINT:avg:LAST:%6.2lf Last\l'
2063 signal_noise => ['-v', 'dBm',
2064 'DEF:avg={file}:value:AVERAGE',
2065 'DEF:min={file}:value:MIN',
2066 'DEF:max={file}:value:MAX',
2067 "AREA:max#$HalfBlue",
2069 "LINE1:avg#$FullBlue:Noise",
2070 'GPRINT:min:MIN:%5.1lf%sdBm Min,',
2071 'GPRINT:avg:AVERAGE:%5.1lf%sdBm Avg,',
2072 'GPRINT:max:MAX:%5.1lf%sdBm Max,',
2073 'GPRINT:avg:LAST:%5.1lf%sdBm Last\l'
2075 signal_power => ['-v', 'dBm',
2076 'DEF:avg={file}:value:AVERAGE',
2077 'DEF:min={file}:value:MIN',
2078 'DEF:max={file}:value:MAX',
2079 "AREA:max#$HalfBlue",
2081 "LINE1:avg#$FullBlue:Power",
2082 'GPRINT:min:MIN:%5.1lf%sdBm Min,',
2083 'GPRINT:avg:AVERAGE:%5.1lf%sdBm Avg,',
2084 'GPRINT:max:MAX:%5.1lf%sdBm Max,',
2085 'GPRINT:avg:LAST:%5.1lf%sdBm Last\l'
2087 signal_quality => ['-v', '%',
2088 'DEF:avg={file}:value:AVERAGE',
2089 'DEF:min={file}:value:MIN',
2090 'DEF:max={file}:value:MAX',
2091 "AREA:max#$HalfBlue",
2093 "LINE1:avg#$FullBlue:Quality",
2094 'GPRINT:min:MIN:%5.1lf%s%% Min,',
2095 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
2096 'GPRINT:max:MAX:%5.1lf%s%% Max,',
2097 'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
2099 swap => ['-v', 'Bytes', '-b', '1024',
2100 'DEF:avg={file}:value:AVERAGE',
2101 'DEF:min={file}:value:MIN',
2102 'DEF:max={file}:value:MAX',
2103 "AREA:max#$HalfBlue",
2105 "LINE1:avg#$FullBlue:Bytes",
2106 'GPRINT:min:MIN:%6.2lf%sByte Min,',
2107 'GPRINT:avg:AVERAGE:%6.2lf%sByte Avg,',
2108 'GPRINT:max:MAX:%6.2lf%sByte Max,',
2109 'GPRINT:avg:LAST:%6.2lf%sByte Last\l'
2112 'DEF:used_avg={file}:used:AVERAGE',
2113 'DEF:used_min={file}:used:MIN',
2114 'DEF:used_max={file}:used:MAX',
2115 'DEF:free_avg={file}:free:AVERAGE',
2116 'DEF:free_min={file}:free:MIN',
2117 'DEF:free_max={file}:free:MAX',
2118 'DEF:cach_avg={file}:cached:AVERAGE',
2119 'DEF:cach_min={file}:cached:MIN',
2120 'DEF:cach_max={file}:cached:MAX',
2121 'DEF:resv_avg={file}:resv:AVERAGE',
2122 'DEF:resv_min={file}:resv:MIN',
2123 'DEF:resv_max={file}:resv:MAX',
2124 'CDEF:cach_avg_notnull=cach_avg,UN,0,cach_avg,IF',
2125 'CDEF:resv_avg_notnull=resv_avg,UN,0,resv_avg,IF',
2126 'CDEF:used_acc=used_avg',
2127 'CDEF:resv_acc=used_acc,resv_avg_notnull,+',
2128 'CDEF:cach_acc=resv_acc,cach_avg_notnull,+',
2129 'CDEF:free_acc=cach_acc,free_avg,+',
2130 "AREA:free_acc#$HalfGreen",
2131 "AREA:cach_acc#$HalfBlue",
2132 "AREA:resv_acc#$HalfYellow",
2133 "AREA:used_acc#$HalfRed",
2134 "LINE1:free_acc#$FullGreen:Free ",
2135 'GPRINT:free_min:MIN:%5.1lf%s Min,',
2136 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
2137 'GPRINT:free_max:MAX:%5.1lf%s Max,',
2138 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
2139 "LINE1:cach_acc#$FullBlue:Cached ",
2140 'GPRINT:cach_min:MIN:%5.1lf%s Min,',
2141 'GPRINT:cach_avg:AVERAGE:%5.1lf%s Avg,',
2142 'GPRINT:cach_max:MAX:%5.1lf%s Max,',
2143 'GPRINT:cach_avg:LAST:%5.1lf%s Last\l',
2144 "LINE1:resv_acc#$FullYellow:Reserved",
2145 'GPRINT:resv_min:MIN:%5.1lf%s Min,',
2146 'GPRINT:resv_avg:AVERAGE:%5.1lf%s Avg,',
2147 'GPRINT:resv_max:MAX:%5.1lf%s Max,',
2148 'GPRINT:resv_avg:LAST:%5.1lf%s Last\n',
2149 "LINE1:used_acc#$FullRed:Used ",
2150 'GPRINT:used_min:MIN:%5.1lf%s Min,',
2151 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
2152 'GPRINT:used_max:MAX:%5.1lf%s Max,',
2153 'GPRINT:used_avg:LAST:%5.1lf%s Last\l'
2155 tcp_connections => ['-v', 'Connections',
2156 'DEF:avg={file}:value:AVERAGE',
2157 'DEF:min={file}:value:MIN',
2158 'DEF:max={file}:value:MAX',
2159 "AREA:max#$HalfBlue",
2161 "LINE1:avg#$FullBlue:Connections",
2162 'GPRINT:min:MIN:%4.1lf Min,',
2163 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
2164 'GPRINT:max:MAX:%4.1lf Max,',
2165 'GPRINT:avg:LAST:%4.1lf Last\l'
2167 temperature => ['-v', 'Celsius',
2168 'DEF:temp_avg={file}:value:AVERAGE',
2169 'DEF:temp_min={file}:value:MIN',
2170 'DEF:temp_max={file}:value:MAX',
2171 'CDEF:average=temp_avg,0.2,*,PREV,UN,temp_avg,PREV,IF,0.8,*,+',
2172 "AREA:temp_max#$HalfRed",
2173 "AREA:temp_min#$Canvas",
2174 "LINE1:temp_avg#$FullRed:Temperature",
2175 'GPRINT:temp_min:MIN:%4.1lf Min,',
2176 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
2177 'GPRINT:temp_max:MAX:%4.1lf Max,',
2178 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
2180 timeleft => ['-v', 'Minutes',
2181 'DEF:avg={file}:timeleft:AVERAGE',
2182 'DEF:min={file}:timeleft:MIN',
2183 'DEF:max={file}:timeleft:MAX',
2184 "AREA:max#$HalfBlue",
2186 "LINE1:avg#$FullBlue:Time left [min]",
2187 'GPRINT:min:MIN:%5.1lf%s Min,',
2188 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
2189 'GPRINT:max:MAX:%5.1lf%s Max,',
2190 'GPRINT:avg:LAST:%5.1lf%s Last\l'
2192 time_offset => [ # NTPd
2193 'DEF:s_avg={file}:seconds:AVERAGE',
2194 'DEF:s_min={file}:seconds:MIN',
2195 'DEF:s_max={file}:seconds:MAX',
2196 "AREA:s_max#$HalfBlue",
2197 "AREA:s_min#$Canvas",
2198 "LINE1:s_avg#$FullBlue:{inst}",
2199 'GPRINT:s_min:MIN:%7.3lf%s Min,',
2200 'GPRINT:s_avg:AVERAGE:%7.3lf%s Avg,',
2201 'GPRINT:s_max:MAX:%7.3lf%s Max,',
2202 'GPRINT:s_avg:LAST:%7.3lf%s Last'
2204 if_octets => ['-v', 'Bits/s', '-l', '0',
2205 'DEF:out_min_raw={file}:tx:MIN',
2206 'DEF:out_avg_raw={file}:tx:AVERAGE',
2207 'DEF:out_max_raw={file}:tx:MAX',
2208 'DEF:inc_min_raw={file}:rx:MIN',
2209 'DEF:inc_avg_raw={file}:rx:AVERAGE',
2210 'DEF:inc_max_raw={file}:rx:MAX',
2211 'CDEF:out_min=out_min_raw,8,*',
2212 'CDEF:out_avg=out_avg_raw,8,*',
2213 'CDEF:out_max=out_max_raw,8,*',
2214 'CDEF:inc_min=inc_min_raw,8,*',
2215 'CDEF:inc_avg=inc_avg_raw,8,*',
2216 'CDEF:inc_max=inc_max_raw,8,*',
2217 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
2218 'CDEF:mytime=out_avg_raw,TIME,TIME,IF',
2219 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
2220 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
2221 'CDEF:out_avg_sample=out_avg_raw,UN,0,out_avg_raw,IF,sample_len,*',
2222 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
2223 'CDEF:inc_avg_sample=inc_avg_raw,UN,0,inc_avg_raw,IF,sample_len,*',
2224 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
2225 "AREA:out_avg#$HalfGreen",
2226 "AREA:inc_avg#$HalfBlue",
2227 "AREA:overlap#$HalfBlueGreen",
2228 "LINE1:out_avg#$FullGreen:Outgoing",
2229 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
2230 'GPRINT:out_max:MAX:%5.1lf%s Max,',
2231 'GPRINT:out_avg:LAST:%5.1lf%s Last',
2232 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
2233 "LINE1:inc_avg#$FullBlue:Incoming",
2234 #'GPRINT:inc_min:MIN:%5.1lf %s Min,',
2235 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
2236 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
2237 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
2238 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
2241 'DEF:cpufreq_avg={file}:value:AVERAGE',
2242 'DEF:cpufreq_min={file}:value:MIN',
2243 'DEF:cpufreq_max={file}:value:MAX',
2244 "AREA:cpufreq_max#$HalfBlue",
2245 "AREA:cpufreq_min#$Canvas",
2246 "LINE1:cpufreq_avg#$FullBlue:Frequency",
2247 'GPRINT:cpufreq_min:MIN:%5.1lf%s Min,',
2248 'GPRINT:cpufreq_avg:AVERAGE:%5.1lf%s Avg,',
2249 'GPRINT:cpufreq_max:MAX:%5.1lf%s Max,',
2250 'GPRINT:cpufreq_avg:LAST:%5.1lf%s Last\l'
2253 'DEF:multimeter_avg={file}:value:AVERAGE',
2254 'DEF:multimeter_min={file}:value:MIN',
2255 'DEF:multimeter_max={file}:value:MAX',
2256 "AREA:multimeter_max#$HalfBlue",
2257 "AREA:multimeter_min#$Canvas",
2258 "LINE1:multimeter_avg#$FullBlue:Multimeter",
2259 'GPRINT:multimeter_min:MIN:%4.1lf Min,',
2260 'GPRINT:multimeter_avg:AVERAGE:%4.1lf Average,',
2261 'GPRINT:multimeter_max:MAX:%4.1lf Max,',
2262 'GPRINT:multimeter_avg:LAST:%4.1lf Last\l'
2264 users => ['-v', 'Users',
2265 'DEF:users_avg={file}:users:AVERAGE',
2266 'DEF:users_min={file}:users:MIN',
2267 'DEF:users_max={file}:users:MAX',
2268 "AREA:users_max#$HalfBlue",
2269 "AREA:users_min#$Canvas",
2270 "LINE1:users_avg#$FullBlue:Users",
2271 'GPRINT:users_min:MIN:%4.1lf Min,',
2272 'GPRINT:users_avg:AVERAGE:%4.1lf Average,',
2273 'GPRINT:users_max:MAX:%4.1lf Max,',
2274 'GPRINT:users_avg:LAST:%4.1lf Last\l'
2276 voltage => ['-v', 'Voltage',
2277 'DEF:avg={file}:value:AVERAGE',
2278 'DEF:min={file}:value:MIN',
2279 'DEF:max={file}:value:MAX',
2280 "AREA:max#$HalfBlue",
2282 "LINE1:avg#$FullBlue:Voltage",
2283 'GPRINT:min:MIN:%5.1lf%sV Min,',
2284 'GPRINT:avg:AVERAGE:%5.1lf%sV Avg,',
2285 'GPRINT:max:MAX:%5.1lf%sV Max,',
2286 'GPRINT:avg:LAST:%5.1lf%sV Last\l'
2289 "DEF:total_avg={file}:total:AVERAGE",
2290 "DEF:total_min={file}:total:MIN",
2291 "DEF:total_max={file}:total:MAX",
2292 "DEF:running_avg={file}:running:AVERAGE",
2293 "DEF:running_min={file}:running:MIN",
2294 "DEF:running_max={file}:running:MAX",
2295 "DEF:uninterruptible_avg={file}:uninterruptible:AVERAGE",
2296 "DEF:uninterruptible_min={file}:uninterruptible:MIN",
2297 "DEF:uninterruptible_max={file}:uninterruptible:MAX",
2298 "DEF:onhold_avg={file}:onhold:AVERAGE",
2299 "DEF:onhold_min={file}:onhold:MIN",
2300 "DEF:onhold_max={file}:onhold:MAX",
2301 "LINE1:total_avg#$FullYellow:Total ",
2302 'GPRINT:total_min:MIN:%5.1lf Min,',
2303 'GPRINT:total_avg:AVERAGE:%5.1lf Avg.,',
2304 'GPRINT:total_max:MAX:%5.1lf Max,',
2305 'GPRINT:total_avg:LAST:%5.1lf Last\l',
2306 "LINE1:running_avg#$FullRed:Running ",
2307 'GPRINT:running_min:MIN:%5.1lf Min,',
2308 'GPRINT:running_avg:AVERAGE:%5.1lf Avg.,',
2309 'GPRINT:running_max:MAX:%5.1lf Max,',
2310 'GPRINT:running_avg:LAST:%5.1lf Last\l',
2311 "LINE1:uninterruptible_avg#$FullGreen:Unintr ",
2312 'GPRINT:uninterruptible_min:MIN:%5.1lf Min,',
2313 'GPRINT:uninterruptible_avg:AVERAGE:%5.1lf Avg.,',
2314 'GPRINT:uninterruptible_max:MAX:%5.1lf Max,',
2315 'GPRINT:uninterruptible_avg:LAST:%5.1lf Last\l',
2316 "LINE1:onhold_avg#$FullBlue:Onhold ",
2317 'GPRINT:onhold_min:MIN:%5.1lf Min,',
2318 'GPRINT:onhold_avg:AVERAGE:%5.1lf Avg.,',
2319 'GPRINT:onhold_max:MAX:%5.1lf Max,',
2320 'GPRINT:onhold_avg:LAST:%5.1lf Last\l'
2323 'DEF:vm_avg={file}:vm:AVERAGE',
2324 'DEF:vm_min={file}:vm:MIN',
2325 'DEF:vm_max={file}:vm:MAX',
2326 'DEF:vml_avg={file}:vml:AVERAGE',
2327 'DEF:vml_min={file}:vml:MIN',
2328 'DEF:vml_max={file}:vml:MAX',
2329 'DEF:rss_avg={file}:rss:AVERAGE',
2330 'DEF:rss_min={file}:rss:MIN',
2331 'DEF:rss_max={file}:rss:MAX',
2332 'DEF:anon_avg={file}:anon:AVERAGE',
2333 'DEF:anon_min={file}:anon:MIN',
2334 'DEF:anon_max={file}:anon:MAX',
2335 "LINE1:vm_avg#$FullYellow:VM ",
2336 'GPRINT:vm_min:MIN:%5.1lf%s Min,',
2337 'GPRINT:vm_avg:AVERAGE:%5.1lf%s Avg.,',
2338 'GPRINT:vm_max:MAX:%5.1lf%s Avg.,',
2339 'GPRINT:vm_avg:LAST:%5.1lf%s Last\l',
2340 "LINE1:vml_avg#$FullRed:Locked ",
2341 'GPRINT:vml_min:MIN:%5.1lf%s Min,',
2342 'GPRINT:vml_avg:AVERAGE:%5.1lf%s Avg.,',
2343 'GPRINT:vml_max:MAX:%5.1lf%s Avg.,',
2344 'GPRINT:vml_avg:LAST:%5.1lf%s Last\l',
2345 "LINE1:rss_avg#$FullGreen:RSS ",
2346 'GPRINT:rss_min:MIN:%5.1lf%s Min,',
2347 'GPRINT:rss_avg:AVERAGE:%5.1lf%s Avg.,',
2348 'GPRINT:rss_max:MAX:%5.1lf%s Avg.,',
2349 'GPRINT:rss_avg:LAST:%5.1lf%s Last\l',
2350 "LINE1:anon_avg#$FullBlue:Anon. ",
2351 'GPRINT:anon_min:MIN:%5.1lf%s Min,',
2352 'GPRINT:anon_avg:AVERAGE:%5.1lf%s Avg.,',
2353 'GPRINT:anon_max:MAX:%5.1lf%s Avg.,',
2354 'GPRINT:anon_avg:LAST:%5.1lf%s Last\l',
2357 'DEF:proc_avg={file}:total:AVERAGE',
2358 'DEF:proc_min={file}:total:MIN',
2359 'DEF:proc_max={file}:total:MAX',
2360 "AREA:proc_max#$HalfBlue",
2361 "AREA:proc_min#$Canvas",
2362 "LINE1:proc_avg#$FullBlue:Processes",
2363 'GPRINT:proc_min:MIN:%4.1lf Min,',
2364 'GPRINT:proc_avg:AVERAGE:%4.1lf Avg.,',
2365 'GPRINT:proc_max:MAX:%4.1lf Max,',
2366 'GPRINT:proc_avg:LAST:%4.1lf Last\l'
2369 $GraphDefs->{'if_multicast'} = $GraphDefs->{'ipt_packets'};
2370 $GraphDefs->{'if_tx_errors'} = $GraphDefs->{'if_rx_errors'};
2371 $GraphDefs->{'dns_qtype'} = $GraphDefs->{'dns_opcode'};
2372 $GraphDefs->{'dns_rcode'} = $GraphDefs->{'dns_opcode'};
2374 $MetaGraphDefs->{'cpu'} = \&meta_graph_cpu;
2375 $MetaGraphDefs->{'if_rx_errors'} = \&meta_graph_if_rx_errors;
2376 $MetaGraphDefs->{'if_tx_errors'} = \&meta_graph_if_rx_errors;
2377 $MetaGraphDefs->{'memory'} = \&meta_graph_memory;
2378 $MetaGraphDefs->{'nfs_procedure'} = \&meta_graph_nfs_procedure;
2379 $MetaGraphDefs->{'ps_state'} = \&meta_graph_ps_state;
2380 $MetaGraphDefs->{'swap'} = \&meta_graph_swap;
2381 $MetaGraphDefs->{'mysql_commands'} = \&meta_graph_mysql_commands;
2382 $MetaGraphDefs->{'mysql_handler'} = \&meta_graph_mysql_commands;
2383 $MetaGraphDefs->{'tcp_connections'} = \&meta_graph_tcp_connections;
2384 } # load_graph_definitions
2386 sub meta_graph_generic_stack
2388 confess ("Wrong number of arguments") if (@_ != 2);
2391 my $sources = shift;
2394 my $timespan_str = _get_param_timespan ();
2395 my $timespan_int = (-1) * $ValidTimespan->{$timespan_str};
2397 $opts->{'title'} ||= 'Unknown title';
2398 $opts->{'rrd_opts'} ||= [];
2399 $opts->{'colors'} ||= {};
2401 my @cmd = ('-', '-a', 'PNG', '-s', $timespan_int,
2402 '-t', $opts->{'title'} || 'Unknown title',
2403 @RRDDefaultArgs, @{$opts->{'rrd_opts'}});
2405 my $max_inst_name = 0;
2407 for ($i = 0; $i < @$sources; $i++)
2409 my $inst_data = $sources->[$i];
2410 my $inst_name = $inst_data->{'name'} || confess;
2411 my $file = $inst_data->{'file'} || confess;
2413 if (length ($inst_name) > $max_inst_name)
2415 $max_inst_name = length ($inst_name);
2418 confess ("No such file: $file") if (!-e $file);
2421 qq#DEF:${inst_name}_min=$file:value:MIN#,
2422 qq#DEF:${inst_name}_avg=$file:value:AVERAGE#,
2423 qq#DEF:${inst_name}_max=$file:value:MAX#,
2424 qq#CDEF:${inst_name}_nnl=${inst_name}_avg,UN,0,${inst_name}_avg,IF#);
2428 my $inst_data = $sources->[@$sources - 1];
2429 my $inst_name = $inst_data->{'name'};
2431 push (@cmd, qq#CDEF:${inst_name}_stk=${inst_name}_nnl#);
2433 for (my $i = 1; $i < @$sources; $i++)
2435 my $inst_data0 = $sources->[@$sources - ($i + 1)];
2436 my $inst_data1 = $sources->[@$sources - $i];
2438 my $inst_name0 = $inst_data0->{'name'};
2439 my $inst_name1 = $inst_data1->{'name'};
2441 push (@cmd, qq#CDEF:${inst_name0}_stk=${inst_name0}_nnl,${inst_name1}_stk,+#);
2444 for (my $i = 0; $i < @$sources; $i++)
2446 my $inst_data = $sources->[$i];
2447 my $inst_name = $inst_data->{'name'};
2449 my $legend = sprintf ('%-*s', $max_inst_name, $inst_name);
2454 my $number_format = $opts->{'number_format'} || '%6.1lf';
2456 if (exists ($opts->{'colors'}{$inst_name}))
2458 $line_color = $opts->{'colors'}{$inst_name};
2459 $area_color = _string_to_color ($line_color);
2463 $area_color = _get_random_color ();
2464 $line_color = _color_to_string ($area_color);
2466 $area_color = _color_to_string (_get_faded_color ($area_color));
2468 push (@cmd, qq(AREA:${inst_name}_stk#$area_color),
2469 qq(LINE1:${inst_name}_stk#$line_color:$legend),
2470 qq(GPRINT:${inst_name}_min:MIN:$number_format Min,),
2471 qq(GPRINT:${inst_name}_avg:AVERAGE:$number_format Avg,),
2472 qq(GPRINT:${inst_name}_max:MAX:$number_format Max,),
2473 qq(GPRINT:${inst_name}_avg:LAST:$number_format Last\\l),
2478 if (my $errmsg = RRDs::error ())
2480 confess ("RRDs::graph: $errmsg");
2482 } # meta_graph_generic_stack
2486 confess ("Wrong number of arguments") if (@_ != 5);
2490 my $plugin_instance = shift;
2492 my $type_instances = shift;
2497 $opts->{'title'} = "$host/$plugin"
2498 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2500 $opts->{'rrd_opts'} = ['-v', 'Percent'];
2510 'system' => 'ff0000',
2511 'softirq' => 'ff00ff',
2512 'interrupt' => 'a000a0',
2516 _custom_sort_arrayref ($type_instances,
2517 [qw(idle nice user wait system softirq interrupt steal)]);
2519 for (@$type_instances)
2523 my $title = $opts->{'title'};
2527 if (-e "$_/$title-$inst.rrd")
2529 $file = "$_/$title-$inst.rrd";
2533 confess ("No file found for $title") if ($file eq '');
2541 } # for (@$type_instances)
2543 return (meta_graph_generic_stack ($opts, $sources));
2546 sub meta_graph_memory
2548 confess ("Wrong number of arguments") if (@_ != 5);
2552 my $plugin_instance = shift;
2554 my $type_instances = shift;
2559 $opts->{'title'} = "$host/$plugin"
2560 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2561 $opts->{'number_format'} = '%5.1lf%s';
2563 $opts->{'rrd_opts'} = ['-b', '1024', '-v', 'Bytes'];
2570 'cached' => '0000ff',
2571 'buffered' => 'ffb000',
2575 _custom_sort_arrayref ($type_instances,
2576 [qw(free cached buffered used)]);
2578 for (@$type_instances)
2582 my $title = $opts->{'title'};
2586 if (-e "$_/$title-$inst.rrd")
2588 $file = "$_/$title-$inst.rrd";
2592 confess ("No file found for $title") if ($file eq '');
2600 } # for (@$type_instances)
2602 return (meta_graph_generic_stack ($opts, $sources));
2605 sub meta_graph_if_rx_errors
2607 confess ("Wrong number of arguments") if (@_ != 5);
2611 my $plugin_instance = shift;
2613 my $type_instances = shift;
2618 $opts->{'title'} = "$host/$plugin"
2619 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2620 $opts->{'number_format'} = '%5.2lf';
2621 $opts->{'rrd_opts'} = ['-v', 'Errors/s'];
2625 for (sort @$type_instances)
2629 my $title = $opts->{'title'};
2633 if (-e "$_/$title-$inst.rrd")
2635 $file = "$_/$title-$inst.rrd";
2639 confess ("No file found for $title") if ($file eq '');
2647 } # for (@$type_instances)
2649 return (meta_graph_generic_stack ($opts, $sources));
2650 } # meta_graph_if_rx_errors
2652 sub meta_graph_mysql_commands
2654 confess ("Wrong number of arguments") if (@_ != 5);
2658 my $plugin_instance = shift;
2660 my $type_instances = shift;
2665 $opts->{'title'} = "$host/$plugin"
2666 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2667 $opts->{'number_format'} = '%5.2lf';
2671 for (sort @$type_instances)
2675 my $title = $opts->{'title'};
2679 if (-e "$_/$title-$inst.rrd")
2681 $file = "$_/$title-$inst.rrd";
2685 confess ("No file found for $title") if ($file eq '');
2693 } # for (@$type_instances)
2695 return (meta_graph_generic_stack ($opts, $sources));
2696 } # meta_graph_mysql_commands
2698 sub meta_graph_nfs_procedure
2700 confess ("Wrong number of arguments") if (@_ != 5);
2704 my $plugin_instance = shift;
2706 my $type_instances = shift;
2711 $opts->{'title'} = "$host/$plugin"
2712 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2713 $opts->{'number_format'} = '%5.1lf%s';
2717 for (sort @$type_instances)
2721 my $title = $opts->{'title'};
2725 if (-e "$_/$title-$inst.rrd")
2727 $file = "$_/$title-$inst.rrd";
2731 confess ("No file found for $title") if ($file eq '');
2739 } # for (@$type_instances)
2741 return (meta_graph_generic_stack ($opts, $sources));
2742 } # meta_graph_nfs_procedure
2744 sub meta_graph_ps_state
2746 confess ("Wrong number of arguments") if (@_ != 5);
2750 my $plugin_instance = shift;
2752 my $type_instances = shift;
2757 $opts->{'title'} = "$host/$plugin"
2758 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2759 $opts->{'rrd_opts'} = ['-v', 'Processes'];
2765 'Running' => '00e000',
2766 'Sleeping' => '0000ff',
2767 'Paging' => 'ffb000',
2768 'Zombies' => 'ff0000',
2769 'Blocked' => 'ff00ff',
2770 'Stopped' => 'a000a0'
2773 _custom_sort_arrayref ($type_instances,
2774 [qw(paging blocked zombies stopped running sleeping)]);
2776 for (@$type_instances)
2780 my $title = $opts->{'title'};
2784 if (-e "$_/$title-$inst.rrd")
2786 $file = "$_/$title-$inst.rrd";
2790 confess ("No file found for $title") if ($file eq '');
2794 name => ucfirst ($inst),
2798 } # for (@$type_instances)
2800 return (meta_graph_generic_stack ($opts, $sources));
2801 } # meta_graph_ps_state
2805 confess ("Wrong number of arguments") if (@_ != 5);
2809 my $plugin_instance = shift;
2811 my $type_instances = shift;
2816 $opts->{'title'} = "$host/$plugin"
2817 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2818 $opts->{'number_format'} = '%5.1lf%s';
2819 $opts->{'rrd_opts'} = ['-v', 'Bytes'];
2826 'Cached' => '0000ff',
2827 'Reserved' => 'ffb000',
2831 _custom_sort_arrayref ($type_instances,
2832 [qw(free cached reserved used)]);
2834 for (@$type_instances)
2838 my $title = $opts->{'title'};
2842 if (-e "$_/$title-$inst.rrd")
2844 $file = "$_/$title-$inst.rrd";
2848 confess ("No file found for $title") if ($file eq '');
2852 name => ucfirst ($inst),
2856 } # for (@$type_instances)
2858 return (meta_graph_generic_stack ($opts, $sources));
2861 sub meta_graph_tcp_connections
2863 confess ("Wrong number of arguments") if (@_ != 5);
2867 my $plugin_instance = shift;
2869 my $type_instances = shift;
2874 $opts->{'title'} = "$host/$plugin"
2875 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2876 $opts->{'number_format'} = '%6.2lf';
2878 $opts->{'rrd_opts'} = ['-v', 'Connections'];
2884 ESTABLISHED => '00e000',
2885 SYN_SENT => '00e0ff',
2886 SYN_RECV => '00e0a0',
2887 FIN_WAIT1 => 'f000f0',
2888 FIN_WAIT2 => 'f000a0',
2889 TIME_WAIT => 'ffb000',
2891 CLOSE_WAIT => '0000a0',
2892 LAST_ACK => '000080',
2897 _custom_sort_arrayref ($type_instances,
2898 [reverse qw(ESTABLISHED SYN_SENT SYN_RECV FIN_WAIT1 FIN_WAIT2 TIME_WAIT CLOSE
2899 CLOSE_WAIT LAST_ACK CLOSING LISTEN)]);
2901 for (@$type_instances)
2905 my $title = $opts->{'title'};
2909 if (-e "$_/$title-$inst.rrd")
2911 $file = "$_/$title-$inst.rrd";
2915 confess ("No file found for $title") if ($file eq '');
2923 } # for (@$type_instances)
2925 return (meta_graph_generic_stack ($opts, $sources));
2926 } # meta_graph_tcp_connections
2927 # vim: shiftwidth=2:softtabstop=2:tabstop=8