From: Florian Forster Date: Wed, 7 Nov 2007 16:52:01 +0000 (+0000) Subject: contrib/collection.cgi: Fix the types related to the processes plugin. X-Git-Tag: collectd-4.2.1~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=49bb3bcd390c7b4611ca8f5e6a6f8921802e176b;p=collectd.git contrib/collection.cgi: Fix the types related to the processes plugin. --- diff --git a/contrib/collection.cgi b/contrib/collection.cgi index 9ea03ebe..7da7e1c6 100755 --- a/contrib/collection.cgi +++ b/contrib/collection.cgi @@ -209,8 +209,8 @@ sub _find_plugins for (@tmp) { my ($plugin, $instance) = split (m/-/, $_, 2); - $plugins{$plugin} = [] if (!$plugins{$plugin}); - push (@{$plugins{$plugin}}, $instance) if (defined ($instance)); + $plugins{$plugin} = [] if (!exists $plugins{$plugin}); + push (@{$plugins{$plugin}}, $instance); } } # for (@DataDirs) @@ -267,9 +267,11 @@ sub _find_files_for_host for (@$plugin_instances) { - my $plugin_instance = $_; + my $plugin_instance = defined ($_) ? $_ : '-'; my %types = _find_types ($host, $plugin, - ($plugin_instance ne '-') ? $plugin_instance : undef); + ($plugin_instance ne '-') + ? $plugin_instance + : undef); $ret->{$plugin}{$plugin_instance} = {}; @@ -1967,18 +1969,27 @@ sub load_graph_definitions 'GPRINT:sleeping_max:MAX:%5.1lf Max,', 'GPRINT:sleeping_avg:LAST:%5.1lf Last\l' ], - ps_rss => [ - 'DEF:avg={file}:value:AVERAGE', - 'DEF:min={file}:value:MIN', - 'DEF:max={file}:value:MAX', - "AREA:avg#$HalfBlue", - "LINE1:avg#$FullBlue:RSS", - 'GPRINT:min:MIN:%5.1lf%s Min,', - 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,', - 'GPRINT:max:MAX:%5.1lf%s Max,', - 'GPRINT:avg:LAST:%5.1lf%s Last\l' + ps_count => ['-v', 'Processes', + 'DEF:procs_avg={file}:processes:AVERAGE', + 'DEF:procs_min={file}:processes:MIN', + 'DEF:procs_max={file}:processes:MAX', + 'DEF:thrds_avg={file}:threads:AVERAGE', + 'DEF:thrds_min={file}:threads:MIN', + 'DEF:thrds_max={file}:threads:MAX', + "AREA:thrds_avg#$HalfBlue", + "AREA:procs_avg#$HalfRed", + "LINE1:thrds_avg#$FullBlue:Threads ", + 'GPRINT:thrds_min:MIN:%5.1lf Min,', + 'GPRINT:thrds_avg:AVERAGE:%5.1lf Avg,', + 'GPRINT:thrds_max:MAX:%5.1lf Max,', + 'GPRINT:thrds_avg:LAST:%5.1lf Last\l', + "LINE1:procs_avg#$FullRed:Processes", + 'GPRINT:procs_min:MIN:%5.1lf Min,', + 'GPRINT:procs_avg:AVERAGE:%5.1lf Avg,', + 'GPRINT:procs_max:MAX:%5.1lf Max,', + 'GPRINT:procs_avg:LAST:%5.1lf Last\l' ], - ps_cputime => [ + ps_cputime => ['-v', 'Jiffies', 'DEF:user_avg_raw={file}:user:AVERAGE', 'DEF:user_min_raw={file}:user:MIN', 'DEF:user_max_raw={file}:user:MAX', @@ -2005,27 +2016,7 @@ sub load_graph_definitions 'GPRINT:syst_max:MAX:%5.1lf%s Max,', 'GPRINT:syst_avg:LAST:%5.1lf%s Last\l' ], - ps_count => [ - 'DEF:procs_avg={file}:processes:AVERAGE', - 'DEF:procs_min={file}:processes:MIN', - 'DEF:procs_max={file}:processes:MAX', - 'DEF:thrds_avg={file}:threads:AVERAGE', - 'DEF:thrds_min={file}:threads:MIN', - 'DEF:thrds_max={file}:threads:MAX', - "AREA:thrds_avg#$HalfBlue", - "AREA:procs_avg#$HalfRed", - "LINE1:thrds_avg#$FullBlue:Threads ", - 'GPRINT:thrds_min:MIN:%5.1lf Min,', - 'GPRINT:thrds_avg:AVERAGE:%5.1lf Avg,', - 'GPRINT:thrds_max:MAX:%5.1lf Max,', - 'GPRINT:thrds_avg:LAST:%5.1lf Last\l', - "LINE1:procs_avg#$FullRed:Processes", - 'GPRINT:procs_min:MIN:%5.1lf Min,', - 'GPRINT:procs_avg:AVERAGE:%5.1lf Avg,', - 'GPRINT:procs_max:MAX:%5.1lf Max,', - 'GPRINT:procs_avg:LAST:%5.1lf Last\l' - ], - ps_pagefaults => [ + ps_pagefaults => ['-v', 'Pagefaults/s', 'DEF:minor_avg={file}:minflt:AVERAGE', 'DEF:minor_min={file}:minflt:MIN', 'DEF:minor_max={file}:minflt:MAX', @@ -2046,6 +2037,17 @@ sub load_graph_definitions 'GPRINT:major_max:MAX:%5.1lf%s Max,', 'GPRINT:major_avg:LAST:%5.1lf%s Last\l' ], + ps_rss => ['-v', 'Bytes', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:min={file}:value:MIN', + 'DEF:max={file}:value:MAX', + "AREA:avg#$HalfBlue", + "LINE1:avg#$FullBlue:RSS", + 'GPRINT:min:MIN:%5.1lf%s Min,', + 'GPRINT:avg:AVERAGE:%5.1lf%s Avg,', + 'GPRINT:max:MAX:%5.1lf%s Max,', + 'GPRINT:avg:LAST:%5.1lf%s Last\l' + ], ps_state => ['-v', 'Processes', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN',