--- ps2rrd.pl 2009/07/19 17:49:55 15 +++ ps2rrd.pl 2009/07/19 18:47:52 16 @@ -16,12 +16,15 @@ my $too_small = 64; # M my $filter = qr{(apache|mysql|postgres|cgi-bin|SIP)}; +my $use = 'VSZ'; + GetOptions( 'debug!' => \$debug, 'zoom=i' => \$zoom, 'only-veid=i' => \$only_veid, 'by-veid!' => \$by_veid, 'size=i' => \$too_small, + 'use=s' => \$use, ); @@ -65,7 +68,7 @@ next if defined $only_veid && $only_veid != $veid; $veid =~ s/^0$/_hw_0/; - my $s = c('VSZ'); + my $s = c($use); my $cmd = c('COMMAND'); if ( ! $by_veid && $cmd =~ $filter ) { @@ -104,7 +107,7 @@ my @veids = sort keys %$veids; warn "# veids = ",dump( @veids ); -my $rrd_file = 'ps.rrd'; +my $rrd_file = $use . '.rrd'; unlink $rrd_file if -e $rrd_file; my @t = sort keys %$vsz; @@ -131,7 +134,7 @@ source_drawtypes => [ map { $_ ? 'STACK' : 'AREA' } 0 .. $#veids ], periods => [ qw/hour 6hour 12hour day week month year 3years/ ], extended_legend => 1, - title => "memory > $too_small K", + title => "$use > $too_small K", width => 500 * $zoom, height => 200 * $zoom, );