Hi
I am trying to run the prstat tool in Solaris to capture merics in production that would tell which PID is using high cpu .Apparently prstat do not have a inbuilt command argument i can pass on which would give me time stamp.So i am thinking of using prstat and then appending timestamp with a wrapper script.
I need help in appending each line of the output of prstat file with a timestamp at the beginning or End of the line
The TIME column indicates how long the process is running since it started
Any help is appreciated
prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
12354 root 29M 28M sleep 29 10 9:23:53 4.2% emx_flist64/1
19708 root 13M 9720K sleep 59 0 0:06:08 0.3% dsmc/5
12892 oracle 2784M 2751M sleep 59 0 0:00:00 0.1% oracle/2
6554 root 18M 18M sleep 24 10 2:25:52 0.1% PatrolAgent/1
12860 oracle 2784M 2752M sleep 59 0 0:00:01 0.1% oracle/2
7456 patrol 7568K 5392K sleep 29 10 1:47:11 0.0% bgscollect/1
2992 root 7416K 6400K sleep 29 10 1:31:19 0.0% stat_daemon/1
I am trying to run the prstat tool in Solaris to capture merics in production that would tell which PID is using high cpu .Apparently prstat do not have a inbuilt command argument i can pass on which would give me time stamp.So i am thinking of using prstat and then appending timestamp with a wrapper script.
I need help in appending each line of the output of prstat file with a timestamp at the beginning or End of the line
The TIME column indicates how long the process is running since it started
Any help is appreciated
prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
12354 root 29M 28M sleep 29 10 9:23:53 4.2% emx_flist64/1
19708 root 13M 9720K sleep 59 0 0:06:08 0.3% dsmc/5
12892 oracle 2784M 2751M sleep 59 0 0:00:00 0.1% oracle/2
6554 root 18M 18M sleep 24 10 2:25:52 0.1% PatrolAgent/1
12860 oracle 2784M 2752M sleep 59 0 0:00:01 0.1% oracle/2
7456 patrol 7568K 5392K sleep 29 10 1:47:11 0.0% bgscollect/1
2992 root 7416K 6400K sleep 29 10 1:31:19 0.0% stat_daemon/1