eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
my $DCPUMONVIEW="/usr/local/cpanel/bin/dcpumonview";
#if ( ! -f $DCPUMONVIEW ) {
# print "Can't find $DCPUMONVIEW!";
my @DCPUMONDATA=`$DCPUMONVIEW`;
#while (<@DCPUMONDATA>) {
chomp; # strip record separator
s/<[\/]t.>|<t.>|<t. bgcolor=#......>|<t. colspan=.>/ /g;
#if (s/(root|mailnull|mailman|mysql|nobody)/$1 [system]/;
if (! /Top( |\t)+Process/ && ! /^$/ && ! /^( |\t)+$/ )
s/(root|mailnull|mailman|mysql|nobody|jabber|daemon)/$1 [system]/;
#if (! /[a-z]+[0-9]+/) { s/([a-z]+ )/$1 [system]/; }
s/(32[0-9][0-9][0-9])/$1 [unknown]/;
#my ($count)=$_=~y/\s/ /;
my ($user, $site, $cpu,$mem,$mysql) = split(' ',$_,-1);
#if ($site =~ / +/){ $site="[unknown]"; }
printf("%25s %35s %10s %10s %10s \n", $user, $site, $cpu,$mem,$mysql );