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_traffic => ['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'
1174 email_count => ['-v', 'Mails',
1175 'DEF:avg={file}:value:AVERAGE',
1176 'DEF:min={file}:value:MIN',
1177 'DEF:max={file}:value:MAX',
1178 "AREA:max#$HalfMagenta",
1180 "LINE1:avg#$FullMagenta:Count ",
1181 'GPRINT:min:MIN:%4.1lf Min,',
1182 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1183 'GPRINT:max:MAX:%4.1lf Max,',
1184 'GPRINT:avg:LAST:%4.1lf Last\l'
1186 email_size => ['-v', 'Bytes',
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 spam_score => ['-v', 'Score',
1199 'DEF:avg={file}:value:AVERAGE',
1200 'DEF:min={file}:value:MIN',
1201 'DEF:max={file}:value:MAX',
1202 "AREA:max#$HalfBlue",
1204 "LINE1:avg#$FullBlue:Score ",
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'
1211 'DEF:avg={file}:hits:AVERAGE',
1212 'DEF:min={file}:hits:MIN',
1213 'DEF:max={file}:hits:MAX',
1214 "AREA:max#$HalfMagenta",
1216 "LINE1:avg#$FullMagenta:Count ",
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'
1222 entropy => ['-v', 'Bits',
1223 'DEF:avg={file}:entropy:AVERAGE',
1224 'DEF:min={file}:entropy:MIN',
1225 'DEF:max={file}:entropy:MAX',
1226 "AREA:max#$HalfBlue",
1228 "LINE1:avg#$FullBlue:Bits",
1229 'GPRINT:min:MIN:%4.0lfbit Min,',
1230 'GPRINT:avg:AVERAGE:%4.0lfbit Avg,',
1231 'GPRINT:max:MAX:%4.0lfbit Max,',
1232 'GPRINT:avg:LAST:%4.0lfbit Last\l'
1234 fanspeed => ['-v', 'RPM',
1235 'DEF:avg={file}:value:AVERAGE',
1236 'DEF:min={file}:value:MIN',
1237 'DEF:max={file}:value:MAX',
1238 "AREA:max#$HalfMagenta",
1240 "LINE1:avg#$FullMagenta:RPM",
1241 'GPRINT:min:MIN:%4.1lf Min,',
1242 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
1243 'GPRINT:max:MAX:%4.1lf Max,',
1244 'GPRINT:avg:LAST:%4.1lf Last\l'
1246 frequency => ['-v', 'Hertz',
1247 'DEF:avg={file}:frequency:AVERAGE',
1248 'DEF:min={file}:frequency:MIN',
1249 'DEF:max={file}:frequency:MAX',
1250 "AREA:max#$HalfBlue",
1252 "LINE1:avg#$FullBlue:Frequency [Hz]",
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_offset => [ # NTPd
1259 'DEF:ppm_avg={file}:ppm:AVERAGE',
1260 'DEF:ppm_min={file}:ppm:MIN',
1261 'DEF:ppm_max={file}:ppm:MAX',
1262 "AREA:ppm_max#$HalfBlue",
1263 "AREA:ppm_min#$Canvas",
1264 "LINE1:ppm_avg#$FullBlue:{inst}",
1265 'GPRINT:ppm_min:MIN:%5.2lf Min,',
1266 'GPRINT:ppm_avg:AVERAGE:%5.2lf Avg,',
1267 'GPRINT:ppm_max:MAX:%5.2lf Max,',
1268 'GPRINT:ppm_avg:LAST:%5.2lf Last'
1270 gauge => ['-v', 'Exec value',
1271 'DEF:temp_avg={file}:value:AVERAGE',
1272 'DEF:temp_min={file}:value:MIN',
1273 'DEF:temp_max={file}:value:MAX',
1274 "AREA:temp_max#$HalfBlue",
1275 "AREA:temp_min#$Canvas",
1276 "LINE1:temp_avg#$FullBlue:Exec value",
1277 'GPRINT:temp_min:MIN:%6.2lf Min,',
1278 'GPRINT:temp_avg:AVERAGE:%6.2lf Avg,',
1279 'GPRINT:temp_max:MAX:%6.2lf Max,',
1280 'GPRINT:temp_avg:LAST:%6.2lf Last\l'
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#$HalfRed",
1287 "AREA:temp_min#$Canvas",
1288 "LINE1:temp_avg#$FullRed:Temperature",
1289 'GPRINT:temp_min:MIN:%4.1lf Min,',
1290 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
1291 'GPRINT:temp_max:MAX:%4.1lf Max,',
1292 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
1294 humidity => ['-v', 'Percent',
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#$HalfGreen",
1299 "AREA:temp_min#$Canvas",
1300 "LINE1:temp_avg#$FullGreen: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 if_errors => ['-v', 'Errors/s',
1307 'DEF:tx_min={file}:tx:MIN',
1308 'DEF:tx_avg={file}:tx:AVERAGE',
1309 'DEF:tx_max={file}:tx:MAX',
1310 'DEF:rx_min={file}:rx:MIN',
1311 'DEF:rx_avg={file}:rx:AVERAGE',
1312 'DEF:rx_max={file}:rx:MAX',
1313 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1314 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1315 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1316 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1317 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1318 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1319 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1320 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1321 "AREA:tx_avg#$HalfGreen",
1322 "AREA:rx_avg#$HalfBlue",
1323 "AREA:overlap#$HalfBlueGreen",
1324 "LINE1:tx_avg#$FullGreen:TX",
1325 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1326 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1327 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1328 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1329 "LINE1:rx_avg#$FullBlue:RX",
1330 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1331 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1332 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1333 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1334 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1336 if_collisions => ['-v', 'Collisions/s',
1337 'DEF:min_raw={file}:value:MIN',
1338 'DEF:avg_raw={file}:value:AVERAGE',
1339 'DEF:max_raw={file}:value:MAX',
1340 'CDEF:min=min_raw,8,*',
1341 'CDEF:avg=avg_raw,8,*',
1342 'CDEF:max=max_raw,8,*',
1343 "AREA:max#$HalfBlue",
1345 "LINE1:avg#$FullBlue:Collisions/s",
1346 'GPRINT:min:MIN:%5.1lf %s Min,',
1347 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1348 'GPRINT:max:MAX:%5.1lf%s Max,',
1349 'GPRINT:avg:LAST:%5.1lf%s Last\l'
1351 if_dropped => ['-v', 'Packets/s',
1352 'DEF:tx_min={file}:tx:MIN',
1353 'DEF:tx_avg={file}:tx:AVERAGE',
1354 'DEF:tx_max={file}:tx:MAX',
1355 'DEF:rx_min={file}:rx:MIN',
1356 'DEF:rx_avg={file}:rx:AVERAGE',
1357 'DEF:rx_max={file}:rx:MAX',
1358 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1359 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1360 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1361 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1362 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1363 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1364 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1365 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1366 "AREA:tx_avg#$HalfGreen",
1367 "AREA:rx_avg#$HalfBlue",
1368 "AREA:overlap#$HalfBlueGreen",
1369 "LINE1:tx_avg#$FullGreen:TX",
1370 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1371 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1372 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1373 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1374 "LINE1:rx_avg#$FullBlue:RX",
1375 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1376 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1377 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1378 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1379 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1381 if_packets => ['-v', 'Packets/s',
1382 'DEF:tx_min={file}:tx:MIN',
1383 'DEF:tx_avg={file}:tx:AVERAGE',
1384 'DEF:tx_max={file}:tx:MAX',
1385 'DEF:rx_min={file}:rx:MIN',
1386 'DEF:rx_avg={file}:rx:AVERAGE',
1387 'DEF:rx_max={file}:rx:MAX',
1388 'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
1389 'CDEF:mytime=tx_avg,TIME,TIME,IF',
1390 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1391 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1392 'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
1393 'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
1394 'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
1395 'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
1396 "AREA:tx_avg#$HalfGreen",
1397 "AREA:rx_avg#$HalfBlue",
1398 "AREA:overlap#$HalfBlueGreen",
1399 "LINE1:tx_avg#$FullGreen:TX",
1400 'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
1401 'GPRINT:tx_max:MAX:%5.1lf%s Max,',
1402 'GPRINT:tx_avg:LAST:%5.1lf%s Last',
1403 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l',
1404 "LINE1:rx_avg#$FullBlue:RX",
1405 #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
1406 'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
1407 'GPRINT:rx_max:MAX:%5.1lf%s Max,',
1408 'GPRINT:rx_avg:LAST:%5.1lf%s Last',
1409 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'
1411 if_rx_errors => ['-v', 'Errors/s',
1412 'DEF:min={file}:value:MIN',
1413 'DEF:avg={file}:value:AVERAGE',
1414 'DEF:max={file}:value:MAX',
1415 'CDEF:mytime=avg,TIME,TIME,IF',
1416 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1417 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1418 'CDEF:avg_sample=avg,UN,0,avg,IF,sample_len,*',
1419 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
1420 "AREA:avg#$HalfBlue",
1421 "LINE1:avg#$FullBlue:Errors/s",
1422 'GPRINT:avg:AVERAGE:%3.1lf%s Avg,',
1423 'GPRINT:max:MAX:%3.1lf%s Max,',
1424 'GPRINT:avg:LAST:%3.1lf%s Last',
1425 'GPRINT:avg_sum:LAST:(ca. %2.0lf%s Total)\l'
1427 ipt_bytes => ['-v', 'Bits/s',
1428 'DEF:min_raw={file}:value:MIN',
1429 'DEF:avg_raw={file}:value:AVERAGE',
1430 'DEF:max_raw={file}:value:MAX',
1431 'CDEF:min=min_raw,8,*',
1432 'CDEF:avg=avg_raw,8,*',
1433 'CDEF:max=max_raw,8,*',
1434 'CDEF:mytime=avg_raw,TIME,TIME,IF',
1435 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1436 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1437 'CDEF:avg_sample=avg_raw,UN,0,avg_raw,IF,sample_len,*',
1438 'CDEF:avg_sum=PREV,UN,0,PREV,IF,avg_sample,+',
1439 "AREA:max#$HalfBlue",
1441 "LINE1:avg#$FullBlue:Bits/s",
1442 #'GPRINT:min:MIN:%5.1lf %s Min,',
1443 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1444 'GPRINT:max:MAX:%5.1lf%s Max,',
1445 'GPRINT:avg:LAST:%5.1lf%s Last',
1446 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1448 ipt_packets => ['-v', 'Packets/s',
1449 'DEF:min_raw={file}:value:MIN',
1450 'DEF:avg_raw={file}:value:AVERAGE',
1451 'DEF:max_raw={file}:value:MAX',
1452 'CDEF:min=min_raw,8,*',
1453 'CDEF:avg=avg_raw,8,*',
1454 'CDEF:max=max_raw,8,*',
1455 "AREA:max#$HalfBlue",
1457 "LINE1:avg#$FullBlue:Packets/s",
1458 'GPRINT:min:MIN:%5.1lf %s Min,',
1459 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
1460 'GPRINT:max:MAX:%5.1lf%s Max,',
1461 'GPRINT:avg:LAST:%5.1lf%s Last\l'
1463 irq => ['-v', 'Issues/s',
1464 'DEF:avg={file}:value:AVERAGE',
1465 'DEF:min={file}:value:MIN',
1466 'DEF:max={file}:value:MAX',
1467 "AREA:max#$HalfBlue",
1469 "LINE1:avg#$FullBlue:Issues/s",
1470 'GPRINT:min:MIN:%6.2lf Min,',
1471 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
1472 'GPRINT:max:MAX:%6.2lf Max,',
1473 'GPRINT:avg:LAST:%6.2lf Last\l'
1475 load => ['-v', 'System load',
1476 'DEF:s_avg={file}:shortterm:AVERAGE',
1477 'DEF:s_min={file}:shortterm:MIN',
1478 'DEF:s_max={file}:shortterm:MAX',
1479 'DEF:m_avg={file}:midterm:AVERAGE',
1480 'DEF:m_min={file}:midterm:MIN',
1481 'DEF:m_max={file}:midterm:MAX',
1482 'DEF:l_avg={file}:longterm:AVERAGE',
1483 'DEF:l_min={file}:longterm:MIN',
1484 'DEF:l_max={file}:longterm:MAX',
1485 "AREA:s_max#$HalfGreen",
1486 "AREA:s_min#$Canvas",
1487 "LINE1:s_avg#$FullGreen: 1m average",
1488 'GPRINT:s_min:MIN:%4.2lf Min,',
1489 'GPRINT:s_avg:AVERAGE:%4.2lf Avg,',
1490 'GPRINT:s_max:MAX:%4.2lf Max,',
1491 'GPRINT:s_avg:LAST:%4.2lf Last\n',
1492 "LINE1:m_avg#$FullBlue: 5m average",
1493 'GPRINT:m_min:MIN:%4.2lf Min,',
1494 'GPRINT:m_avg:AVERAGE:%4.2lf Avg,',
1495 'GPRINT:m_max:MAX:%4.2lf Max,',
1496 'GPRINT:m_avg:LAST:%4.2lf Last\n',
1497 "LINE1:l_avg#$FullRed:15m average",
1498 'GPRINT:l_min:MIN:%4.2lf Min,',
1499 'GPRINT:l_avg:AVERAGE:%4.2lf Avg,',
1500 'GPRINT:l_max:MAX:%4.2lf Max,',
1501 'GPRINT:l_avg:LAST:%4.2lf Last'
1504 'DEF:avg={file}:percent:AVERAGE',
1505 'DEF:min={file}:percent:MIN',
1506 'DEF:max={file}:percent:MAX',
1507 "AREA:max#$HalfBlue",
1509 "LINE1:avg#$FullBlue:Load",
1510 'GPRINT:min:MIN:%5.1lf%s%% Min,',
1511 'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
1512 'GPRINT:max:MAX:%5.1lf%s%% Max,',
1513 'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
1515 mails => ['DEF:rawgood={file}:good:AVERAGE',
1516 'DEF:rawspam={file}:spam:AVERAGE',
1517 'CDEF:good=rawgood,UN,0,rawgood,IF',
1518 'CDEF:spam=rawspam,UN,0,rawspam,IF',
1519 'CDEF:negspam=spam,-1,*',
1520 "AREA:good#$HalfGreen",
1521 "LINE1:good#$FullGreen:Good mails",
1522 'GPRINT:good:AVERAGE:%4.1lf Avg,',
1523 'GPRINT:good:MAX:%4.1lf Max,',
1524 'GPRINT:good:LAST:%4.1lf Last\n',
1525 "AREA:negspam#$HalfRed",
1526 "LINE1:negspam#$FullRed:Spam mails",
1527 'GPRINT:spam:AVERAGE:%4.1lf Avg,',
1528 'GPRINT:spam:MAX:%4.1lf Max,',
1529 'GPRINT:spam:LAST:%4.1lf Last',
1532 memory => ['-b', '1024', '-v', 'Bytes',
1533 'DEF:avg={file}:value:AVERAGE',
1534 'DEF:min={file}:value:MIN',
1535 'DEF:max={file}:value:MAX',
1536 "AREA:max#$HalfBlue",
1538 "LINE1:avg#$FullBlue:Memory",
1539 'GPRINT:min:MIN:%5.1lf%sbyte Min,',
1540 'GPRINT:avg:AVERAGE:%5.1lf%sbyte Avg,',
1541 'GPRINT:max:MAX:%5.1lf%sbyte Max,',
1542 'GPRINT:avg:LAST:%5.1lf%sbyte Last\l'
1545 'DEF:used_avg={file}:used:AVERAGE',
1546 'DEF:free_avg={file}:free:AVERAGE',
1547 'DEF:buffers_avg={file}:buffers:AVERAGE',
1548 'DEF:cached_avg={file}:cached:AVERAGE',
1549 'DEF:used_min={file}:used:MIN',
1550 'DEF:free_min={file}:free:MIN',
1551 'DEF:buffers_min={file}:buffers:MIN',
1552 'DEF:cached_min={file}:cached:MIN',
1553 'DEF:used_max={file}:used:MAX',
1554 'DEF:free_max={file}:free:MAX',
1555 'DEF:buffers_max={file}:buffers:MAX',
1556 'DEF:cached_max={file}:cached:MAX',
1557 'CDEF:cached_avg_nn=cached_avg,UN,0,cached_avg,IF',
1558 'CDEF:buffers_avg_nn=buffers_avg,UN,0,buffers_avg,IF',
1559 'CDEF:free_cached_buffers_used=free_avg,cached_avg_nn,+,buffers_avg_nn,+,used_avg,+',
1560 'CDEF:cached_buffers_used=cached_avg,buffers_avg_nn,+,used_avg,+',
1561 'CDEF:buffers_used=buffers_avg,used_avg,+',
1562 "AREA:free_cached_buffers_used#$HalfGreen",
1563 "AREA:cached_buffers_used#$HalfBlue",
1564 "AREA:buffers_used#$HalfYellow",
1565 "AREA:used_avg#$HalfRed",
1566 "LINE1:free_cached_buffers_used#$FullGreen:Free ",
1567 'GPRINT:free_min:MIN:%5.1lf%s Min,',
1568 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
1569 'GPRINT:free_max:MAX:%5.1lf%s Max,',
1570 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
1571 "LINE1:cached_buffers_used#$FullBlue:Page cache ",
1572 'GPRINT:cached_min:MIN:%5.1lf%s Min,',
1573 'GPRINT:cached_avg:AVERAGE:%5.1lf%s Avg,',
1574 'GPRINT:cached_max:MAX:%5.1lf%s Max,',
1575 'GPRINT:cached_avg:LAST:%5.1lf%s Last\n',
1576 "LINE1:buffers_used#$FullYellow:Buffer cache",
1577 'GPRINT:buffers_min:MIN:%5.1lf%s Min,',
1578 'GPRINT:buffers_avg:AVERAGE:%5.1lf%s Avg,',
1579 'GPRINT:buffers_max:MAX:%5.1lf%s Max,',
1580 'GPRINT:buffers_avg:LAST:%5.1lf%s Last\n',
1581 "LINE1:used_avg#$FullRed:Used ",
1582 'GPRINT:used_min:MIN:%5.1lf%s Min,',
1583 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
1584 'GPRINT:used_max:MAX:%5.1lf%s Max,',
1585 'GPRINT:used_avg:LAST:%5.1lf%s Last'
1587 mysql_commands => ['-v', 'Issues/s',
1588 "DEF:val_avg={file}:value:AVERAGE",
1589 "DEF:val_min={file}:value:MIN",
1590 "DEF:val_max={file}:value:MAX",
1591 "AREA:val_max#$HalfBlue",
1592 "AREA:val_min#$Canvas",
1593 "LINE1:val_avg#$FullBlue:Issues/s",
1594 'GPRINT:val_min:MIN:%5.2lf Min,',
1595 'GPRINT:val_avg:AVERAGE:%5.2lf Avg,',
1596 'GPRINT:val_max:MAX:%5.2lf Max,',
1597 'GPRINT:val_avg:LAST:%5.2lf Last'
1599 mysql_handler => ['-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_octets => ['-v', 'Bits/s',
1612 'DEF:out_min={file}:tx:MIN',
1613 'DEF:out_avg={file}:tx:AVERAGE',
1614 'DEF:out_max={file}:tx:MAX',
1615 'DEF:inc_min={file}:rx:MIN',
1616 'DEF:inc_avg={file}:rx:AVERAGE',
1617 'DEF:inc_max={file}:rx:MAX',
1618 'CDEF:mytime=out_avg,TIME,TIME,IF',
1619 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
1620 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
1621 'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
1622 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
1623 'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
1624 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
1625 'CDEF:out_bit_min=out_min,8,*',
1626 'CDEF:out_bit_avg=out_avg,8,*',
1627 'CDEF:out_bit_max=out_max,8,*',
1628 'CDEF:inc_bit_min=inc_min,8,*',
1629 'CDEF:inc_bit_avg=inc_avg,8,*',
1630 'CDEF:inc_bit_max=inc_max,8,*',
1631 'CDEF:overlap=out_bit_avg,inc_bit_avg,GT,inc_bit_avg,out_bit_avg,IF',
1632 "AREA:out_bit_avg#$HalfGreen",
1633 "AREA:inc_bit_avg#$HalfBlue",
1634 "AREA:overlap#$HalfBlueGreen",
1635 "LINE1:out_bit_avg#$FullGreen:Written",
1636 'GPRINT:out_bit_avg:AVERAGE:%5.1lf%s Avg,',
1637 'GPRINT:out_bit_max:MAX:%5.1lf%s Max,',
1638 'GPRINT:out_bit_avg:LAST:%5.1lf%s Last',
1639 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
1640 "LINE1:inc_bit_avg#$FullBlue:Read ",
1641 'GPRINT:inc_bit_avg:AVERAGE:%5.1lf%s Avg,',
1642 'GPRINT:inc_bit_max:MAX:%5.1lf%s Max,',
1643 'GPRINT:inc_bit_avg:LAST:%5.1lf%s Last',
1644 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
1646 mysql_qcache => ['-v', 'Queries/s',
1647 "DEF:hits_min={file}:hits:MIN",
1648 "DEF:hits_avg={file}:hits:AVERAGE",
1649 "DEF:hits_max={file}:hits:MAX",
1650 "DEF:inserts_min={file}:inserts:MIN",
1651 "DEF:inserts_avg={file}:inserts:AVERAGE",
1652 "DEF:inserts_max={file}:inserts:MAX",
1653 "DEF:not_cached_min={file}:not_cached:MIN",
1654 "DEF:not_cached_avg={file}:not_cached:AVERAGE",
1655 "DEF:not_cached_max={file}:not_cached:MAX",
1656 "DEF:lowmem_prunes_min={file}:lowmem_prunes:MIN",
1657 "DEF:lowmem_prunes_avg={file}:lowmem_prunes:AVERAGE",
1658 "DEF:lowmem_prunes_max={file}:lowmem_prunes:MAX",
1659 "DEF:queries_min={file}:queries_in_cache:MIN",
1660 "DEF:queries_avg={file}:queries_in_cache:AVERAGE",
1661 "DEF:queries_max={file}:queries_in_cache:MAX",
1662 "CDEF:unknown=queries_avg,UNKN,+",
1663 "CDEF:not_cached_agg=hits_avg,inserts_avg,+,not_cached_avg,+",
1664 "CDEF:inserts_agg=hits_avg,inserts_avg,+",
1665 "CDEF:hits_agg=hits_avg",
1666 "AREA:not_cached_agg#$HalfYellow",
1667 "AREA:inserts_agg#$HalfBlue",
1668 "AREA:hits_agg#$HalfGreen",
1669 "LINE1:not_cached_agg#$FullYellow:Not Cached ",
1670 'GPRINT:not_cached_min:MIN:%5.2lf Min,',
1671 'GPRINT:not_cached_avg:AVERAGE:%5.2lf Avg,',
1672 'GPRINT:not_cached_max:MAX:%5.2lf Max,',
1673 'GPRINT:not_cached_avg:LAST:%5.2lf Last\l',
1674 "LINE1:inserts_agg#$FullBlue:Inserts ",
1675 'GPRINT:inserts_min:MIN:%5.2lf Min,',
1676 'GPRINT:inserts_avg:AVERAGE:%5.2lf Avg,',
1677 'GPRINT:inserts_max:MAX:%5.2lf Max,',
1678 'GPRINT:inserts_avg:LAST:%5.2lf Last\l',
1679 "LINE1:hits_agg#$FullGreen:Hits ",
1680 'GPRINT:hits_min:MIN:%5.2lf Min,',
1681 'GPRINT:hits_avg:AVERAGE:%5.2lf Avg,',
1682 'GPRINT:hits_max:MAX:%5.2lf Max,',
1683 'GPRINT:hits_avg:LAST:%5.2lf Last\l',
1684 "LINE1:lowmem_prunes_avg#$FullRed:Lowmem Prunes ",
1685 'GPRINT:lowmem_prunes_min:MIN:%5.2lf Min,',
1686 'GPRINT:lowmem_prunes_avg:AVERAGE:%5.2lf Avg,',
1687 'GPRINT:lowmem_prunes_max:MAX:%5.2lf Max,',
1688 'GPRINT:lowmem_prunes_avg:LAST:%5.2lf Last\l',
1689 "LINE1:unknown#$Canvas:Queries in cache",
1690 'GPRINT:queries_min:MIN:%5.0lf Min,',
1691 'GPRINT:queries_avg:AVERAGE:%5.0lf Avg,',
1692 'GPRINT:queries_max:MAX:%5.0lf Max,',
1693 'GPRINT:queries_avg:LAST:%5.0lf Last\l'
1695 mysql_threads => ['-v', 'Threads',
1696 "DEF:running_min={file}:running:MIN",
1697 "DEF:running_avg={file}:running:AVERAGE",
1698 "DEF:running_max={file}:running:MAX",
1699 "DEF:connected_min={file}:connected:MIN",
1700 "DEF:connected_avg={file}:connected:AVERAGE",
1701 "DEF:connected_max={file}:connected:MAX",
1702 "DEF:cached_min={file}:cached:MIN",
1703 "DEF:cached_avg={file}:cached:AVERAGE",
1704 "DEF:cached_max={file}:cached:MAX",
1705 "DEF:created_min={file}:created:MIN",
1706 "DEF:created_avg={file}:created:AVERAGE",
1707 "DEF:created_max={file}:created:MAX",
1708 "CDEF:unknown=created_avg,UNKN,+",
1709 "CDEF:cached_agg=connected_avg,cached_avg,+",
1710 "AREA:cached_agg#$HalfGreen",
1711 "AREA:connected_avg#$HalfBlue",
1712 "AREA:running_avg#$HalfRed",
1713 "LINE1:cached_agg#$FullGreen:Cached ",
1714 'GPRINT:cached_min:MIN:%5.1lf Min,',
1715 'GPRINT:cached_avg:AVERAGE:%5.1lf Avg,',
1716 'GPRINT:cached_max:MAX:%5.1lf Max,',
1717 'GPRINT:cached_avg:LAST:%5.1lf Last\l',
1718 "LINE1:connected_avg#$FullBlue:Connected",
1719 'GPRINT:connected_min:MIN:%5.1lf Min,',
1720 'GPRINT:connected_avg:AVERAGE:%5.1lf Avg,',
1721 'GPRINT:connected_max:MAX:%5.1lf Max,',
1722 'GPRINT:connected_avg:LAST:%5.1lf Last\l',
1723 "LINE1:running_avg#$FullRed:Running ",
1724 'GPRINT:running_min:MIN:%5.1lf Min,',
1725 'GPRINT:running_avg:AVERAGE:%5.1lf Avg,',
1726 'GPRINT:running_max:MAX:%5.1lf Max,',
1727 'GPRINT:running_avg:LAST:%5.1lf Last\l',
1728 "LINE1:unknown#$Canvas:Created ",
1729 'GPRINT:created_min:MIN:%5.0lf Min,',
1730 'GPRINT:created_avg:AVERAGE:%5.0lf Avg,',
1731 'GPRINT:created_max:MAX:%5.0lf Max,',
1732 'GPRINT:created_avg:LAST:%5.0lf Last\l'
1734 nfs_procedure => ['-v', 'Issues/s',
1735 'DEF:avg={file}:value:AVERAGE',
1736 'DEF:min={file}:value:MIN',
1737 'DEF:max={file}:value:MAX',
1738 "AREA:max#$HalfBlue",
1740 "LINE1:avg#$FullBlue:Issues/s",
1741 'GPRINT:min:MIN:%6.2lf Min,',
1742 'GPRINT:avg:AVERAGE:%6.2lf Avg,',
1743 'GPRINT:max:MAX:%6.2lf Max,',
1744 'GPRINT:avg:LAST:%6.2lf Last\l'
1746 nfs3_procedures => [
1747 "DEF:null_avg={file}:null:AVERAGE",
1748 "DEF:getattr_avg={file}:getattr:AVERAGE",
1749 "DEF:setattr_avg={file}:setattr:AVERAGE",
1750 "DEF:lookup_avg={file}:lookup:AVERAGE",
1751 "DEF:access_avg={file}:access:AVERAGE",
1752 "DEF:readlink_avg={file}:readlink:AVERAGE",
1753 "DEF:read_avg={file}:read:AVERAGE",
1754 "DEF:write_avg={file}:write:AVERAGE",
1755 "DEF:create_avg={file}:create:AVERAGE",
1756 "DEF:mkdir_avg={file}:mkdir:AVERAGE",
1757 "DEF:symlink_avg={file}:symlink:AVERAGE",
1758 "DEF:mknod_avg={file}:mknod:AVERAGE",
1759 "DEF:remove_avg={file}:remove:AVERAGE",
1760 "DEF:rmdir_avg={file}:rmdir:AVERAGE",
1761 "DEF:rename_avg={file}:rename:AVERAGE",
1762 "DEF:link_avg={file}:link:AVERAGE",
1763 "DEF:readdir_avg={file}:readdir:AVERAGE",
1764 "DEF:readdirplus_avg={file}:readdirplus:AVERAGE",
1765 "DEF:fsstat_avg={file}:fsstat:AVERAGE",
1766 "DEF:fsinfo_avg={file}:fsinfo:AVERAGE",
1767 "DEF:pathconf_avg={file}:pathconf:AVERAGE",
1768 "DEF:commit_avg={file}:commit:AVERAGE",
1769 "DEF:null_max={file}:null:MAX",
1770 "DEF:getattr_max={file}:getattr:MAX",
1771 "DEF:setattr_max={file}:setattr:MAX",
1772 "DEF:lookup_max={file}:lookup:MAX",
1773 "DEF:access_max={file}:access:MAX",
1774 "DEF:readlink_max={file}:readlink:MAX",
1775 "DEF:read_max={file}:read:MAX",
1776 "DEF:write_max={file}:write:MAX",
1777 "DEF:create_max={file}:create:MAX",
1778 "DEF:mkdir_max={file}:mkdir:MAX",
1779 "DEF:symlink_max={file}:symlink:MAX",
1780 "DEF:mknod_max={file}:mknod:MAX",
1781 "DEF:remove_max={file}:remove:MAX",
1782 "DEF:rmdir_max={file}:rmdir:MAX",
1783 "DEF:rename_max={file}:rename:MAX",
1784 "DEF:link_max={file}:link:MAX",
1785 "DEF:readdir_max={file}:readdir:MAX",
1786 "DEF:readdirplus_max={file}:readdirplus:MAX",
1787 "DEF:fsstat_max={file}:fsstat:MAX",
1788 "DEF:fsinfo_max={file}:fsinfo:MAX",
1789 "DEF:pathconf_max={file}:pathconf:MAX",
1790 "DEF:commit_max={file}:commit:MAX",
1791 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
1792 "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,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
1793 "CDEF:stack_read=read_avg",
1794 "CDEF:stack_getattr=stack_read,getattr_avg,+",
1795 "CDEF:stack_access=stack_getattr,access_avg,+",
1796 "CDEF:stack_lookup=stack_access,lookup_avg,+",
1797 "CDEF:stack_write=stack_lookup,write_avg,+",
1798 "CDEF:stack_commit=stack_write,commit_avg,+",
1799 "CDEF:stack_setattr=stack_commit,setattr_avg,+",
1800 "CDEF:stack_other=stack_setattr,other_avg,+",
1801 "AREA:stack_other#$HalfRed",
1802 "AREA:stack_setattr#$HalfGreen",
1803 "AREA:stack_commit#$HalfYellow",
1804 "AREA:stack_write#$HalfGreen",
1805 "AREA:stack_lookup#$HalfBlue",
1806 "AREA:stack_access#$HalfMagenta",
1807 "AREA:stack_getattr#$HalfCyan",
1808 "AREA:stack_read#$HalfBlue",
1809 "LINE1:stack_other#$FullRed:Other ",
1810 'GPRINT:other_max:MAX:%5.1lf Max,',
1811 'GPRINT:other_avg:AVERAGE:%5.1lf Avg,',
1812 'GPRINT:other_avg:LAST:%5.1lf Last\l',
1813 "LINE1:stack_setattr#$FullGreen:setattr",
1814 'GPRINT:setattr_max:MAX:%5.1lf Max,',
1815 'GPRINT:setattr_avg:AVERAGE:%5.1lf Avg,',
1816 'GPRINT:setattr_avg:LAST:%5.1lf Last\l',
1817 "LINE1:stack_commit#$FullYellow:commit ",
1818 'GPRINT:commit_max:MAX:%5.1lf Max,',
1819 'GPRINT:commit_avg:AVERAGE:%5.1lf Avg,',
1820 'GPRINT:commit_avg:LAST:%5.1lf Last\l',
1821 "LINE1:stack_write#$FullGreen:write ",
1822 'GPRINT:write_max:MAX:%5.1lf Max,',
1823 'GPRINT:write_avg:AVERAGE:%5.1lf Avg,',
1824 'GPRINT:write_avg:LAST:%5.1lf Last\l',
1825 "LINE1:stack_lookup#$FullBlue:lookup ",
1826 'GPRINT:lookup_max:MAX:%5.1lf Max,',
1827 'GPRINT:lookup_avg:AVERAGE:%5.1lf Avg,',
1828 'GPRINT:lookup_avg:LAST:%5.1lf Last\l',
1829 "LINE1:stack_access#$FullMagenta:access ",
1830 'GPRINT:access_max:MAX:%5.1lf Max,',
1831 'GPRINT:access_avg:AVERAGE:%5.1lf Avg,',
1832 'GPRINT:access_avg:LAST:%5.1lf Last\l',
1833 "LINE1:stack_getattr#$FullCyan:getattr",
1834 'GPRINT:getattr_max:MAX:%5.1lf Max,',
1835 'GPRINT:getattr_avg:AVERAGE:%5.1lf Avg,',
1836 'GPRINT:getattr_avg:LAST:%5.1lf Last\l',
1837 "LINE1:stack_read#$FullBlue:read ",
1838 'GPRINT:read_max:MAX:%5.1lf Max,',
1839 'GPRINT:read_avg:AVERAGE:%5.1lf Avg,',
1840 'GPRINT:read_avg:LAST:%5.1lf Last\l'
1843 'DEF:avg={file}:value:AVERAGE',
1844 'DEF:min={file}:value:MIN',
1845 'DEF:max={file}:value:MAX',
1846 "AREA:max#$HalfBlue",
1848 "LINE1:avg#$FullBlue:Queries/s",
1849 'GPRINT:min:MIN:%9.3lf Min,',
1850 'GPRINT:avg:AVERAGE:%9.3lf Average,',
1851 'GPRINT:max:MAX:%9.3lf Max,',
1852 'GPRINT:avg:LAST:%9.3lf 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'
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:Queries/s",
2070 'GPRINT:min:MIN:%9.3lf Min,',
2071 'GPRINT:avg:AVERAGE:%9.3lf Average,',
2072 'GPRINT:max:MAX:%9.3lf Max,',
2073 'GPRINT:avg:LAST:%9.3lf Last\l'
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:Queries/s",
2082 'GPRINT:min:MIN:%9.3lf Min,',
2083 'GPRINT:avg:AVERAGE:%9.3lf Average,',
2084 'GPRINT:max:MAX:%9.3lf Max,',
2085 'GPRINT:avg:LAST:%9.3lf Last\l'
2087 swap => ['-v', 'Bytes', '-b', '1024',
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:Bytes",
2094 'GPRINT:min:MIN:%6.2lf%sByte Min,',
2095 'GPRINT:avg:AVERAGE:%6.2lf%sByte Avg,',
2096 'GPRINT:max:MAX:%6.2lf%sByte Max,',
2097 'GPRINT:avg:LAST:%6.2lf%sByte Last\l'
2100 'DEF:used_avg={file}:used:AVERAGE',
2101 'DEF:used_min={file}:used:MIN',
2102 'DEF:used_max={file}:used:MAX',
2103 'DEF:free_avg={file}:free:AVERAGE',
2104 'DEF:free_min={file}:free:MIN',
2105 'DEF:free_max={file}:free:MAX',
2106 'DEF:cach_avg={file}:cached:AVERAGE',
2107 'DEF:cach_min={file}:cached:MIN',
2108 'DEF:cach_max={file}:cached:MAX',
2109 'DEF:resv_avg={file}:resv:AVERAGE',
2110 'DEF:resv_min={file}:resv:MIN',
2111 'DEF:resv_max={file}:resv:MAX',
2112 'CDEF:cach_avg_notnull=cach_avg,UN,0,cach_avg,IF',
2113 'CDEF:resv_avg_notnull=resv_avg,UN,0,resv_avg,IF',
2114 'CDEF:used_acc=used_avg',
2115 'CDEF:resv_acc=used_acc,resv_avg_notnull,+',
2116 'CDEF:cach_acc=resv_acc,cach_avg_notnull,+',
2117 'CDEF:free_acc=cach_acc,free_avg,+',
2118 "AREA:free_acc#$HalfGreen",
2119 "AREA:cach_acc#$HalfBlue",
2120 "AREA:resv_acc#$HalfYellow",
2121 "AREA:used_acc#$HalfRed",
2122 "LINE1:free_acc#$FullGreen:Free ",
2123 'GPRINT:free_min:MIN:%5.1lf%s Min,',
2124 'GPRINT:free_avg:AVERAGE:%5.1lf%s Avg,',
2125 'GPRINT:free_max:MAX:%5.1lf%s Max,',
2126 'GPRINT:free_avg:LAST:%5.1lf%s Last\n',
2127 "LINE1:cach_acc#$FullBlue:Cached ",
2128 'GPRINT:cach_min:MIN:%5.1lf%s Min,',
2129 'GPRINT:cach_avg:AVERAGE:%5.1lf%s Avg,',
2130 'GPRINT:cach_max:MAX:%5.1lf%s Max,',
2131 'GPRINT:cach_avg:LAST:%5.1lf%s Last\l',
2132 "LINE1:resv_acc#$FullYellow:Reserved",
2133 'GPRINT:resv_min:MIN:%5.1lf%s Min,',
2134 'GPRINT:resv_avg:AVERAGE:%5.1lf%s Avg,',
2135 'GPRINT:resv_max:MAX:%5.1lf%s Max,',
2136 'GPRINT:resv_avg:LAST:%5.1lf%s Last\n',
2137 "LINE1:used_acc#$FullRed:Used ",
2138 'GPRINT:used_min:MIN:%5.1lf%s Min,',
2139 'GPRINT:used_avg:AVERAGE:%5.1lf%s Avg,',
2140 'GPRINT:used_max:MAX:%5.1lf%s Max,',
2141 'GPRINT:used_avg:LAST:%5.1lf%s Last\l'
2143 tcp_connections => ['-v', 'Connections',
2144 'DEF:avg={file}:value:AVERAGE',
2145 'DEF:min={file}:value:MIN',
2146 'DEF:max={file}:value:MAX',
2147 "AREA:max#$HalfBlue",
2149 "LINE1:avg#$FullBlue:Connections",
2150 'GPRINT:min:MIN:%4.1lf Min,',
2151 'GPRINT:avg:AVERAGE:%4.1lf Avg,',
2152 'GPRINT:max:MAX:%4.1lf Max,',
2153 'GPRINT:avg:LAST:%4.1lf Last\l'
2155 temperature => ['-v', 'Celsius',
2156 'DEF:temp_avg={file}:value:AVERAGE',
2157 'DEF:temp_min={file}:value:MIN',
2158 'DEF:temp_max={file}:value:MAX',
2159 'CDEF:average=temp_avg,0.2,*,PREV,UN,temp_avg,PREV,IF,0.8,*,+',
2160 "AREA:temp_max#$HalfRed",
2161 "AREA:temp_min#$Canvas",
2162 "LINE1:temp_avg#$FullRed:Temperature",
2163 'GPRINT:temp_min:MIN:%4.1lf Min,',
2164 'GPRINT:temp_avg:AVERAGE:%4.1lf Avg,',
2165 'GPRINT:temp_max:MAX:%4.1lf Max,',
2166 'GPRINT:temp_avg:LAST:%4.1lf Last\l'
2168 timeleft => ['-v', 'Minutes',
2169 'DEF:avg={file}:timeleft:AVERAGE',
2170 'DEF:min={file}:timeleft:MIN',
2171 'DEF:max={file}:timeleft:MAX',
2172 "AREA:max#$HalfBlue",
2174 "LINE1:avg#$FullBlue:Time left [min]",
2175 'GPRINT:min:MIN:%5.1lf%s Min,',
2176 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
2177 'GPRINT:max:MAX:%5.1lf%s Max,',
2178 'GPRINT:avg:LAST:%5.1lf%s Last\l'
2180 time_offset => [ # NTPd
2181 'DEF:s_avg={file}:seconds:AVERAGE',
2182 'DEF:s_min={file}:seconds:MIN',
2183 'DEF:s_max={file}:seconds:MAX',
2184 "AREA:s_max#$HalfBlue",
2185 "AREA:s_min#$Canvas",
2186 "LINE1:s_avg#$FullBlue:{inst}",
2187 'GPRINT:s_min:MIN:%7.3lf%s Min,',
2188 'GPRINT:s_avg:AVERAGE:%7.3lf%s Avg,',
2189 'GPRINT:s_max:MAX:%7.3lf%s Max,',
2190 'GPRINT:s_avg:LAST:%7.3lf%s Last'
2192 if_octets => ['-v', 'Bits/s', '-l', '0',
2193 'DEF:out_min_raw={file}:tx:MIN',
2194 'DEF:out_avg_raw={file}:tx:AVERAGE',
2195 'DEF:out_max_raw={file}:tx:MAX',
2196 'DEF:inc_min_raw={file}:rx:MIN',
2197 'DEF:inc_avg_raw={file}:rx:AVERAGE',
2198 'DEF:inc_max_raw={file}:rx:MAX',
2199 'CDEF:out_min=out_min_raw,8,*',
2200 'CDEF:out_avg=out_avg_raw,8,*',
2201 'CDEF:out_max=out_max_raw,8,*',
2202 'CDEF:inc_min=inc_min_raw,8,*',
2203 'CDEF:inc_avg=inc_avg_raw,8,*',
2204 'CDEF:inc_max=inc_max_raw,8,*',
2205 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
2206 'CDEF:mytime=out_avg_raw,TIME,TIME,IF',
2207 'CDEF:sample_len_raw=mytime,PREV(mytime),-',
2208 'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
2209 'CDEF:out_avg_sample=out_avg_raw,UN,0,out_avg_raw,IF,sample_len,*',
2210 'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
2211 'CDEF:inc_avg_sample=inc_avg_raw,UN,0,inc_avg_raw,IF,sample_len,*',
2212 'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
2213 "AREA:out_avg#$HalfGreen",
2214 "AREA:inc_avg#$HalfBlue",
2215 "AREA:overlap#$HalfBlueGreen",
2216 "LINE1:out_avg#$FullGreen:Outgoing",
2217 'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
2218 'GPRINT:out_max:MAX:%5.1lf%s Max,',
2219 'GPRINT:out_avg:LAST:%5.1lf%s Last',
2220 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
2221 "LINE1:inc_avg#$FullBlue:Incoming",
2222 #'GPRINT:inc_min:MIN:%5.1lf %s Min,',
2223 'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
2224 'GPRINT:inc_max:MAX:%5.1lf%s Max,',
2225 'GPRINT:inc_avg:LAST:%5.1lf%s Last',
2226 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
2229 'DEF:cpufreq_avg={file}:value:AVERAGE',
2230 'DEF:cpufreq_min={file}:value:MIN',
2231 'DEF:cpufreq_max={file}:value:MAX',
2232 "AREA:cpufreq_max#$HalfBlue",
2233 "AREA:cpufreq_min#$Canvas",
2234 "LINE1:cpufreq_avg#$FullBlue:Frequency",
2235 'GPRINT:cpufreq_min:MIN:%5.1lf%s Min,',
2236 'GPRINT:cpufreq_avg:AVERAGE:%5.1lf%s Avg,',
2237 'GPRINT:cpufreq_max:MAX:%5.1lf%s Max,',
2238 'GPRINT:cpufreq_avg:LAST:%5.1lf%s Last\l'
2241 'DEF:multimeter_avg={file}:value:AVERAGE',
2242 'DEF:multimeter_min={file}:value:MIN',
2243 'DEF:multimeter_max={file}:value:MAX',
2244 "AREA:multimeter_max#$HalfBlue",
2245 "AREA:multimeter_min#$Canvas",
2246 "LINE1:multimeter_avg#$FullBlue:Multimeter",
2247 'GPRINT:multimeter_min:MIN:%4.1lf Min,',
2248 'GPRINT:multimeter_avg:AVERAGE:%4.1lf Average,',
2249 'GPRINT:multimeter_max:MAX:%4.1lf Max,',
2250 'GPRINT:multimeter_avg:LAST:%4.1lf Last\l'
2252 users => ['-v', 'Users',
2253 'DEF:users_avg={file}:users:AVERAGE',
2254 'DEF:users_min={file}:users:MIN',
2255 'DEF:users_max={file}:users:MAX',
2256 "AREA:users_max#$HalfBlue",
2257 "AREA:users_min#$Canvas",
2258 "LINE1:users_avg#$FullBlue:Users",
2259 'GPRINT:users_min:MIN:%4.1lf Min,',
2260 'GPRINT:users_avg:AVERAGE:%4.1lf Average,',
2261 'GPRINT:users_max:MAX:%4.1lf Max,',
2262 'GPRINT:users_avg:LAST:%4.1lf Last\l'
2264 voltage => ['-v', 'Voltage',
2265 'DEF:avg={file}:value:AVERAGE',
2266 'DEF:min={file}:value:MIN',
2267 'DEF:max={file}:value:MAX',
2268 "AREA:max#$HalfBlue",
2270 "LINE1:avg#$FullBlue:Voltage",
2271 'GPRINT:min:MIN:%5.1lf%sV Min,',
2272 'GPRINT:avg:AVERAGE:%5.1lf%sV Avg,',
2273 'GPRINT:max:MAX:%5.1lf%sV Max,',
2274 'GPRINT:avg:LAST:%5.1lf%sV Last\l'
2277 "DEF:total_avg={file}:total:AVERAGE",
2278 "DEF:total_min={file}:total:MIN",
2279 "DEF:total_max={file}:total:MAX",
2280 "DEF:running_avg={file}:running:AVERAGE",
2281 "DEF:running_min={file}:running:MIN",
2282 "DEF:running_max={file}:running:MAX",
2283 "DEF:uninterruptible_avg={file}:uninterruptible:AVERAGE",
2284 "DEF:uninterruptible_min={file}:uninterruptible:MIN",
2285 "DEF:uninterruptible_max={file}:uninterruptible:MAX",
2286 "DEF:onhold_avg={file}:onhold:AVERAGE",
2287 "DEF:onhold_min={file}:onhold:MIN",
2288 "DEF:onhold_max={file}:onhold:MAX",
2289 "LINE1:total_avg#$FullYellow:Total ",
2290 'GPRINT:total_min:MIN:%5.1lf Min,',
2291 'GPRINT:total_avg:AVERAGE:%5.1lf Avg.,',
2292 'GPRINT:total_max:MAX:%5.1lf Max,',
2293 'GPRINT:total_avg:LAST:%5.1lf Last\l',
2294 "LINE1:running_avg#$FullRed:Running ",
2295 'GPRINT:running_min:MIN:%5.1lf Min,',
2296 'GPRINT:running_avg:AVERAGE:%5.1lf Avg.,',
2297 'GPRINT:running_max:MAX:%5.1lf Max,',
2298 'GPRINT:running_avg:LAST:%5.1lf Last\l',
2299 "LINE1:uninterruptible_avg#$FullGreen:Unintr ",
2300 'GPRINT:uninterruptible_min:MIN:%5.1lf Min,',
2301 'GPRINT:uninterruptible_avg:AVERAGE:%5.1lf Avg.,',
2302 'GPRINT:uninterruptible_max:MAX:%5.1lf Max,',
2303 'GPRINT:uninterruptible_avg:LAST:%5.1lf Last\l',
2304 "LINE1:onhold_avg#$FullBlue:Onhold ",
2305 'GPRINT:onhold_min:MIN:%5.1lf Min,',
2306 'GPRINT:onhold_avg:AVERAGE:%5.1lf Avg.,',
2307 'GPRINT:onhold_max:MAX:%5.1lf Max,',
2308 'GPRINT:onhold_avg:LAST:%5.1lf Last\l'
2311 'DEF:vm_avg={file}:vm:AVERAGE',
2312 'DEF:vm_min={file}:vm:MIN',
2313 'DEF:vm_max={file}:vm:MAX',
2314 'DEF:vml_avg={file}:vml:AVERAGE',
2315 'DEF:vml_min={file}:vml:MIN',
2316 'DEF:vml_max={file}:vml:MAX',
2317 'DEF:rss_avg={file}:rss:AVERAGE',
2318 'DEF:rss_min={file}:rss:MIN',
2319 'DEF:rss_max={file}:rss:MAX',
2320 'DEF:anon_avg={file}:anon:AVERAGE',
2321 'DEF:anon_min={file}:anon:MIN',
2322 'DEF:anon_max={file}:anon:MAX',
2323 "LINE1:vm_avg#$FullYellow:VM ",
2324 'GPRINT:vm_min:MIN:%5.1lf%s Min,',
2325 'GPRINT:vm_avg:AVERAGE:%5.1lf%s Avg.,',
2326 'GPRINT:vm_max:MAX:%5.1lf%s Avg.,',
2327 'GPRINT:vm_avg:LAST:%5.1lf%s Last\l',
2328 "LINE1:vml_avg#$FullRed:Locked ",
2329 'GPRINT:vml_min:MIN:%5.1lf%s Min,',
2330 'GPRINT:vml_avg:AVERAGE:%5.1lf%s Avg.,',
2331 'GPRINT:vml_max:MAX:%5.1lf%s Avg.,',
2332 'GPRINT:vml_avg:LAST:%5.1lf%s Last\l',
2333 "LINE1:rss_avg#$FullGreen:RSS ",
2334 'GPRINT:rss_min:MIN:%5.1lf%s Min,',
2335 'GPRINT:rss_avg:AVERAGE:%5.1lf%s Avg.,',
2336 'GPRINT:rss_max:MAX:%5.1lf%s Avg.,',
2337 'GPRINT:rss_avg:LAST:%5.1lf%s Last\l',
2338 "LINE1:anon_avg#$FullBlue:Anon. ",
2339 'GPRINT:anon_min:MIN:%5.1lf%s Min,',
2340 'GPRINT:anon_avg:AVERAGE:%5.1lf%s Avg.,',
2341 'GPRINT:anon_max:MAX:%5.1lf%s Avg.,',
2342 'GPRINT:anon_avg:LAST:%5.1lf%s Last\l',
2345 'DEF:proc_avg={file}:total:AVERAGE',
2346 'DEF:proc_min={file}:total:MIN',
2347 'DEF:proc_max={file}:total:MAX',
2348 "AREA:proc_max#$HalfBlue",
2349 "AREA:proc_min#$Canvas",
2350 "LINE1:proc_avg#$FullBlue:Processes",
2351 'GPRINT:proc_min:MIN:%4.1lf Min,',
2352 'GPRINT:proc_avg:AVERAGE:%4.1lf Avg.,',
2353 'GPRINT:proc_max:MAX:%4.1lf Max,',
2354 'GPRINT:proc_avg:LAST:%4.1lf Last\l'
2357 $GraphDefs->{'if_multicast'} = $GraphDefs->{'ipt_packets'};
2358 $GraphDefs->{'if_tx_errors'} = $GraphDefs->{'if_rx_errors'};
2360 $MetaGraphDefs->{'cpu'} = \&meta_graph_cpu;
2361 $MetaGraphDefs->{'if_rx_errors'} = \&meta_graph_if_rx_errors;
2362 $MetaGraphDefs->{'if_tx_errors'} = \&meta_graph_if_rx_errors;
2363 $MetaGraphDefs->{'memory'} = \&meta_graph_memory;
2364 $MetaGraphDefs->{'nfs_procedure'} = \&meta_graph_nfs_procedure;
2365 $MetaGraphDefs->{'ps_state'} = \&meta_graph_ps_state;
2366 $MetaGraphDefs->{'swap'} = \&meta_graph_swap;
2367 $MetaGraphDefs->{'mysql_commands'} = \&meta_graph_mysql_commands;
2368 $MetaGraphDefs->{'mysql_handler'} = \&meta_graph_mysql_commands;
2369 $MetaGraphDefs->{'tcp_connections'} = \&meta_graph_tcp_connections;
2370 } # load_graph_definitions
2372 sub meta_graph_generic_stack
2374 confess ("Wrong number of arguments") if (@_ != 2);
2377 my $sources = shift;
2380 my $timespan_str = _get_param_timespan ();
2381 my $timespan_int = (-1) * $ValidTimespan->{$timespan_str};
2383 $opts->{'title'} ||= 'Unknown title';
2384 $opts->{'rrd_opts'} ||= [];
2385 $opts->{'colors'} ||= {};
2387 my @cmd = ('-', '-a', 'PNG', '-s', $timespan_int,
2388 '-t', $opts->{'title'} || 'Unknown title',
2389 @RRDDefaultArgs, @{$opts->{'rrd_opts'}});
2391 my $max_inst_name = 0;
2393 for ($i = 0; $i < @$sources; $i++)
2395 my $inst_data = $sources->[$i];
2396 my $inst_name = $inst_data->{'name'} || confess;
2397 my $file = $inst_data->{'file'} || confess;
2399 if (length ($inst_name) > $max_inst_name)
2401 $max_inst_name = length ($inst_name);
2404 confess ("No such file: $file") if (!-e $file);
2407 qq#DEF:${inst_name}_min=$file:value:MIN#,
2408 qq#DEF:${inst_name}_avg=$file:value:AVERAGE#,
2409 qq#DEF:${inst_name}_max=$file:value:MAX#,
2410 qq#CDEF:${inst_name}_nnl=${inst_name}_avg,UN,0,${inst_name}_avg,IF#);
2414 my $inst_data = $sources->[@$sources - 1];
2415 my $inst_name = $inst_data->{'name'};
2417 push (@cmd, qq#CDEF:${inst_name}_stk=${inst_name}_nnl#);
2419 for (my $i = 1; $i < @$sources; $i++)
2421 my $inst_data0 = $sources->[@$sources - ($i + 1)];
2422 my $inst_data1 = $sources->[@$sources - $i];
2424 my $inst_name0 = $inst_data0->{'name'};
2425 my $inst_name1 = $inst_data1->{'name'};
2427 push (@cmd, qq#CDEF:${inst_name0}_stk=${inst_name0}_nnl,${inst_name1}_stk,+#);
2430 for (my $i = 0; $i < @$sources; $i++)
2432 my $inst_data = $sources->[$i];
2433 my $inst_name = $inst_data->{'name'};
2435 my $legend = sprintf ('%-*s', $max_inst_name, $inst_name);
2440 my $number_format = $opts->{'number_format'} || '%6.1lf';
2442 if (exists ($opts->{'colors'}{$inst_name}))
2444 $line_color = $opts->{'colors'}{$inst_name};
2445 $area_color = _string_to_color ($line_color);
2449 $area_color = _get_random_color ();
2450 $line_color = _color_to_string ($area_color);
2452 $area_color = _color_to_string (_get_faded_color ($area_color));
2454 push (@cmd, qq(AREA:${inst_name}_stk#$area_color),
2455 qq(LINE1:${inst_name}_stk#$line_color:$legend),
2456 qq(GPRINT:${inst_name}_min:MIN:$number_format Min,),
2457 qq(GPRINT:${inst_name}_avg:AVERAGE:$number_format Avg,),
2458 qq(GPRINT:${inst_name}_max:MAX:$number_format Max,),
2459 qq(GPRINT:${inst_name}_avg:LAST:$number_format Last\\l),
2464 if (my $errmsg = RRDs::error ())
2466 confess ("RRDs::graph: $errmsg");
2468 } # meta_graph_generic_stack
2472 confess ("Wrong number of arguments") if (@_ != 5);
2476 my $plugin_instance = shift;
2478 my $type_instances = shift;
2483 $opts->{'title'} = "$host/$plugin"
2484 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2486 $opts->{'rrd_opts'} = ['-v', 'Percent'];
2496 'system' => 'ff0000',
2497 'softirq' => 'ff00ff',
2498 'interrupt' => 'a000a0',
2502 _custom_sort_arrayref ($type_instances,
2503 [qw(idle nice user wait system softirq interrupt steal)]);
2505 for (@$type_instances)
2509 my $title = $opts->{'title'};
2513 if (-e "$_/$title-$inst.rrd")
2515 $file = "$_/$title-$inst.rrd";
2519 confess ("No file found for $title") if ($file eq '');
2527 } # for (@$type_instances)
2529 return (meta_graph_generic_stack ($opts, $sources));
2532 sub meta_graph_memory
2534 confess ("Wrong number of arguments") if (@_ != 5);
2538 my $plugin_instance = shift;
2540 my $type_instances = shift;
2545 $opts->{'title'} = "$host/$plugin"
2546 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2547 $opts->{'number_format'} = '%5.1lf%s';
2549 $opts->{'rrd_opts'} = ['-b', '1024', '-v', 'Bytes'];
2556 'cached' => '0000ff',
2557 'buffered' => 'ffb000',
2561 _custom_sort_arrayref ($type_instances,
2562 [qw(free cached buffered used)]);
2564 for (@$type_instances)
2568 my $title = $opts->{'title'};
2572 if (-e "$_/$title-$inst.rrd")
2574 $file = "$_/$title-$inst.rrd";
2578 confess ("No file found for $title") if ($file eq '');
2586 } # for (@$type_instances)
2588 return (meta_graph_generic_stack ($opts, $sources));
2591 sub meta_graph_if_rx_errors
2593 confess ("Wrong number of arguments") if (@_ != 5);
2597 my $plugin_instance = shift;
2599 my $type_instances = shift;
2604 $opts->{'title'} = "$host/$plugin"
2605 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2606 $opts->{'number_format'} = '%5.2lf';
2607 $opts->{'rrd_opts'} = ['-v', 'Errors/s'];
2611 for (sort @$type_instances)
2615 my $title = $opts->{'title'};
2619 if (-e "$_/$title-$inst.rrd")
2621 $file = "$_/$title-$inst.rrd";
2625 confess ("No file found for $title") if ($file eq '');
2633 } # for (@$type_instances)
2635 return (meta_graph_generic_stack ($opts, $sources));
2636 } # meta_graph_if_rx_errors
2638 sub meta_graph_mysql_commands
2640 confess ("Wrong number of arguments") if (@_ != 5);
2644 my $plugin_instance = shift;
2646 my $type_instances = shift;
2651 $opts->{'title'} = "$host/$plugin"
2652 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2653 $opts->{'number_format'} = '%5.2lf';
2657 for (sort @$type_instances)
2661 my $title = $opts->{'title'};
2665 if (-e "$_/$title-$inst.rrd")
2667 $file = "$_/$title-$inst.rrd";
2671 confess ("No file found for $title") if ($file eq '');
2679 } # for (@$type_instances)
2681 return (meta_graph_generic_stack ($opts, $sources));
2682 } # meta_graph_mysql_commands
2684 sub meta_graph_nfs_procedure
2686 confess ("Wrong number of arguments") if (@_ != 5);
2690 my $plugin_instance = shift;
2692 my $type_instances = shift;
2697 $opts->{'title'} = "$host/$plugin"
2698 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2699 $opts->{'number_format'} = '%5.1lf%s';
2703 for (sort @$type_instances)
2707 my $title = $opts->{'title'};
2711 if (-e "$_/$title-$inst.rrd")
2713 $file = "$_/$title-$inst.rrd";
2717 confess ("No file found for $title") if ($file eq '');
2725 } # for (@$type_instances)
2727 return (meta_graph_generic_stack ($opts, $sources));
2728 } # meta_graph_nfs_procedure
2730 sub meta_graph_ps_state
2732 confess ("Wrong number of arguments") if (@_ != 5);
2736 my $plugin_instance = shift;
2738 my $type_instances = shift;
2743 $opts->{'title'} = "$host/$plugin"
2744 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2745 $opts->{'rrd_opts'} = ['-v', 'Processes'];
2751 'Running' => '00e000',
2752 'Sleeping' => '0000ff',
2753 'Paging' => 'ffb000',
2754 'Zombies' => 'ff0000',
2755 'Blocked' => 'ff00ff',
2756 'Stopped' => 'a000a0'
2759 _custom_sort_arrayref ($type_instances,
2760 [qw(paging blocked zombies stopped running sleeping)]);
2762 for (@$type_instances)
2766 my $title = $opts->{'title'};
2770 if (-e "$_/$title-$inst.rrd")
2772 $file = "$_/$title-$inst.rrd";
2776 confess ("No file found for $title") if ($file eq '');
2780 name => ucfirst ($inst),
2784 } # for (@$type_instances)
2786 return (meta_graph_generic_stack ($opts, $sources));
2787 } # meta_graph_ps_state
2791 confess ("Wrong number of arguments") if (@_ != 5);
2795 my $plugin_instance = shift;
2797 my $type_instances = shift;
2802 $opts->{'title'} = "$host/$plugin"
2803 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2804 $opts->{'number_format'} = '%5.1lf%s';
2805 $opts->{'rrd_opts'} = ['-v', 'Bytes'];
2812 'Cached' => '0000ff',
2813 'Reserved' => 'ffb000',
2817 _custom_sort_arrayref ($type_instances,
2818 [qw(free cached reserved used)]);
2820 for (@$type_instances)
2824 my $title = $opts->{'title'};
2828 if (-e "$_/$title-$inst.rrd")
2830 $file = "$_/$title-$inst.rrd";
2834 confess ("No file found for $title") if ($file eq '');
2838 name => ucfirst ($inst),
2842 } # for (@$type_instances)
2844 return (meta_graph_generic_stack ($opts, $sources));
2847 sub meta_graph_tcp_connections
2849 confess ("Wrong number of arguments") if (@_ != 5);
2853 my $plugin_instance = shift;
2855 my $type_instances = shift;
2860 $opts->{'title'} = "$host/$plugin"
2861 . (defined ($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
2862 $opts->{'number_format'} = '%6.2lf';
2864 $opts->{'rrd_opts'} = ['-v', 'Connections'];
2870 ESTABLISHED => '00e000',
2871 SYN_SENT => '00e0ff',
2872 SYN_RECV => '00e0a0',
2873 FIN_WAIT1 => 'f000f0',
2874 FIN_WAIT2 => 'f000a0',
2875 TIME_WAIT => 'ffb000',
2877 CLOSE_WAIT => '0000a0',
2878 LAST_ACK => '000080',
2883 _custom_sort_arrayref ($type_instances,
2884 [reverse qw(ESTABLISHED SYN_SENT SYN_RECV FIN_WAIT1 FIN_WAIT2 TIME_WAIT CLOSE
2885 CLOSE_WAIT LAST_ACK CLOSING LISTEN)]);
2887 for (@$type_instances)
2891 my $title = $opts->{'title'};
2895 if (-e "$_/$title-$inst.rrd")
2897 $file = "$_/$title-$inst.rrd";
2901 confess ("No file found for $title") if ($file eq '');
2909 } # for (@$type_instances)
2911 return (meta_graph_generic_stack ($opts, $sources));
2912 } # meta_graph_tcp_connections
2913 # vim: shiftwidth=2:softtabstop=2:tabstop=8