1833663 Members
3172 Online
110062 Solutions
New Discussion

Monitor Process in unix

 
Raj_33
New Member

Monitor Process in unix

Hi,

I'm new to unix, someone please tell me how to track the process.
This should include the start time of the application , the file opened by the application and the end time(time when the application was closed).

regards
raj
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: Monitor Process in unix

You cant get all this info in the same place. The easiest way to get it is to use HP's glance monitor program - you can install from apps cd's or download from software.hp.com and get a free 30 day license.

Glance allows you to monitor a process in realtime and show you what resources its using, what files is has opened, etc, and when it stops.

To view historical data on all processes and when they ended you need full auditing which is not easy to do and uses vast amounts of disk space. Easier to use glance.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Caesar_3
Esteemed Contributor

Re: Monitor Process in unix

Hello!

Use galnce plus program that free for 60
days on applications CD.
All you want is there.

Caesar
Pete Randall
Outstanding Contributor

Re: Monitor Process in unix

raj,

Glance is best. The time command can give you elapsed time of a process - see "man time".


Pete


Pete
Mike Stroyan
Honored Contributor

Re: Monitor Process in unix

The tusc command will report system calls made by a process. It will optionally report the time of each event.
It is available for download from
h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/ 1,1703,1433,00.html
===========================================================================================================================
% tusc -T "" -s exec,open,exit /bin/ls /
1059408821.278950 execve("/bin/ls", 0x7b040a28, 0x7b040a34) ................................................. = 0 [32-bit]
1059408821.279434 open("/usr/lib/dld.sl", O_RDONLY, 05000) .................................................. = 3
1059408821.280304 open("/opt/graphics/OpenGL/lib/libogltls.sl", O_RDONLY, 0) ................................ = 3
1059408821.280558 open("/usr/lib/libc.2", O_RDONLY, 0) ...................................................... = 3
1059408821.281251 open("/usr/lib/libdld.2", O_RDONLY, 0) .................................................... = 3
1059408821.281483 open("/usr/lib/libc.2", O_RDONLY, 0) ...................................................... = 3
1059408821.281642 open("/usr/lib/libcurses.1", O_RDONLY, 0) ................................................. = 3
1059408821.283770 open("/usr/lib/nls/loc/locales.2/en_US.iso88591", O_RDONLY, 0) ............................ = 3
1059408821.284330 open("/usr/lib/nls/en/US/iso88591/locale.inf", O_RDONLY, 0) ............................... ERR#2 ENOENT
1059408821.284542 open("/usr/lib/nls/american/iso88591/locale.inf", O_RDONLY, 056) .......................... ERR#2 ENOENT
1059408821.284862 open("/usr/lib/nls/msg/en_US.iso88591/ls.cat", O_RDONLY, 0177777) ......................... ERR#2 ENOENT
1059408821.284995 open("/usr/lib/nls/en/US/iso88591/ls.cat", O_RDONLY, 0177777) ............................. ERR#2 ENOENT
1059408821.286030 open("/", O_RDONLY, 032650) ............................................................... = 3
applications cdvEnvironment.tar etc lost+found sbin tmp
bin cifs fast-break mbox SD_CDROM usr
cdrom dev home net software var
cdvEnvironment dml lib opt stand
1059408821.286688 exit(0) ................................................................................... WIFEXITED(0)
%
Mike Stroyan
Honored Contributor

Re: Monitor Process in unix

Renda Skandier
Frequent Advisor

Re: Monitor Process in unix

hi raj,
if you are executing your own application from a scripts & looking to log it tou can write to a log file:

sdate=`date +'%y-%m-%d'`
stime=`date +'%T'`
echo "started job $sdate $stime " > logfile
echo "running job myapp with $file " >>logfile
fdate=`date +'%y-%m-%d'`
ftime=`date +'%T'`
echo "finished job $fdate $ftime " >> logfile