mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-28 11:54:52 +00:00
Plugin-Gallery: Get better 2nd level headings
amule -> filetransfer (amule) torrent -> filetransfer (rtorrent)
This commit is contained in:
parent
95de964ec9
commit
4b400a7320
30 changed files with 19 additions and 19 deletions
70
plugins/processes/memory_by_process
Executable file
70
plugins/processes/memory_by_process
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2006 Holger Levsen
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo "graph_title VM by Process"
|
||||
echo 'graph_args --base 1024k'
|
||||
echo 'graph_vlabel VM size'
|
||||
echo 'graph_category memory'
|
||||
echo "graph_info Shows contribution of each process to VM size"
|
||||
|
||||
ps auxww | perl -e '
|
||||
$junk = <>;
|
||||
while (<>)
|
||||
{
|
||||
@a = split;
|
||||
$proc = $a[10];
|
||||
$label = $proc;
|
||||
$proc =~ s/ .*//;
|
||||
if($proc =~ /^\[/) { $proc =~ s|/.*||; } else { $proc =~ s|.*/||; }
|
||||
$proc =~ s/:.*//;
|
||||
$proc =~ tr/[]//d;
|
||||
$proc =~ tr/A-Za-z0-9/_/c;
|
||||
$vsz = $a[4];
|
||||
$total{$proc} += $vsz;
|
||||
$labels{$proc} = $label;
|
||||
}
|
||||
my $stack = 0;
|
||||
sub draw() { return $stack++ ? "STACK" : "AREA" }
|
||||
print map
|
||||
{
|
||||
"$_.label " . $labels{$_} . "\n" .
|
||||
"$_.min 0\n" .
|
||||
"$_.draw " . draw() . "\n" .
|
||||
"$_.cdef $_,1024,*\n"
|
||||
}
|
||||
sort keys %total;
|
||||
'
|
||||
exit 0
|
||||
else
|
||||
ps auxww | perl -e '
|
||||
$junk = <>;
|
||||
while (<>)
|
||||
{
|
||||
@a = split;
|
||||
$proc = $a[10];
|
||||
if($proc =~ /^\[/) { $proc =~ s|/.*||; } else { $proc =~ s|.*/||; }
|
||||
$proc =~ s/:.*//;
|
||||
$proc =~ tr/[]//d;
|
||||
$proc =~ tr/A-Za-z0-9/_/c;
|
||||
$vsz = $a[4];
|
||||
$total{$proc} += $vsz;
|
||||
}
|
||||
print map {"$_.value $total{$_}\n"} sort keys %total'
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue