in reply to Process Monitoring Script
This is a snippet of real code in which I did use strict (omitted in the example though). I also had a related thread a while back with useful info. HTH.@outrecs = `ps -efo pid,pcpu,fname`; @matches = grep /ns-httpd/, @outrecs; foreach (@matches) { $ct++; chomp; ($process, $pcpu, $pname) = split(" "); $sttotal = $sttotal + $pcpu; }
--Jim
Update: You can also use:
to eliminate the need for the Perl grep. Just realized that after I posted. Learn something all the time. :)@matches = `ps -efo pid,pcpu,fname|grep httpd`;
|
|---|