Mini Shell

Direktori : /proc/thread-self/root/proc/thread-self/root/proc/thread-self/root/opt/sharedrads/
Upload File :
Current File : //proc/thread-self/root/proc/thread-self/root/proc/thread-self/root/opt/sharedrads/dcpumon.pl

#!/usr/bin/perl
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!";
#	exit 1;
#}
my @DCPUMONDATA=`$DCPUMONVIEW`;
#while (<@DCPUMONDATA>) {
foreach (@DCPUMONDATA) {
	chomp;	# strip record separator
	s/<[\/]t.>|<t.>|<t. bgcolor=#......>|<t. colspan=.>/ /g;
	#if (s/(root|mailnull|mailman|mysql|nobody)/$1 [system]/;
	#s/([a-z]) /$1  /;
	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]/;
		#print $_;
		#my ($count)=$_=~y/\s/ /;
		#print $count+1;
		my ($user, $site, $cpu,$mem,$mysql) = split(' ',$_,-1);
		#if ($site =~ / +/){ $site="[unknown]"; }
		#$site="foo";
		printf("%25s %35s %10s %10s %10s \n", $user, $site, $cpu,$mem,$mysql );
	}

}

Zerion Mini Shell 1.0