This page was last edited on August 3, 2018, at 08:52.
Comments or questions about this documentation? Contact us for support!
This section describes the PerfMon counters, which enables you to check CPU and memory use. The PerfMon counters are detailed below:
Make sure the PerfMon data is written as a .csv file, not binary. The collection interval should be 15 seconds.
You can use the following commands to collect data:
gvpfd source $owner = "all"; $duration = shift; $repeat = shift; $logfile = shift; $pattern = "/usr/local/phoneweb/logs/logProcess.txt"; sub trim($) { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } sub tabify($) { my $string = shift; $string =~ s/\s+//g; return $string; } print "Starting vgfd\n”; print "Process Owner: $owner \n”; print "Interval: $duration seconds \n”; print "Repeat by: $repeat times \n”; print "Log file: $logfile \n”; open (LOGFILE, ">$logfile"); print LOGFILE "TIME\tNumFD\tPID\tUSER\tPR\tNI\tCPU\tTIME+\tMEM\tVIRT\tRES\tSHR\tS\tCOMMAND for ($i=0; $i<$repeat; $i++){ $ts = ‘date +"%D %T"‘; chop($ts); my @list; if ($owner eq "all"){ @list=’ps -A | grep -v PID | grep -f $pattern’; }else{ @list=’ps -u$owner | grep -v PID | grep -f $pattern’; } $index=0; while ($list[$index]){ $list[$index]=trim($list[$index]); @token = split(/\s+/,$list[$index]); $pid = $token[0]; $pname = $token[3]; $numFD = ‘find /proc/$pid/fd -not -type d | wc -l’; $numFD=trim($numFD); $top = ‘top n 1 b | grep $pid | grep $pname’; $top=tabify(trim($top)); print LOGFILE "$ts\t$numFD\t$top\n”; $index++; } sleep $duration; } close (LOGFILE); exit 0;
To initiate all three process, you can use the following script:
gvpmon source
echo "Starting gvpmon script" N=$1 (( D=1+$2/$N)) rm -f ~pw/logs/sar.dat nohup /usr/lib/sa/sadc $N $D /var/log/sar.dat >/dev/null & nohup /usr/bin/top -d $N -n $D -b > /var/log/top.log & nohup ./vgfd $N $D /var/log/fd.log >/dev/null &
It takes two arguments:
The preceding scripts/programs require a super user privilege to execute. After creating the two preceding scripts, make sure that you add executable permission on them prior to running, by issuing: chmod a+x {script’s filename}