I want to print CPU and Memory utilization into a text file. I am using "prstat -Z" to see the output on screen. When I run below command
but it is not printing to file. Also I want to be below header on output
If anyone have solution for this, I will be appreciate
Hi,
How to redirect the output of prstat command to a file.
Ex:
I want to do like this
while :
do
prstat >> prs.log
sleep 5
done
is it possible ???? if No, then how can i proceed??
PLEASE HELP ME OUT FROM THIS :confused:
Thanks in advance
----------- (2 Replies)
Can someone please explain me the "TIME" field of the output of "prstat -p<pid>" command ? The man page says it is "The cumulative execution time for the process". Does it mean how many hrs:min:sec the process is running ? If so then I'm not getting the desired output.
Can someone pls help me in... (5 Replies)
I am trying to have a script ping all the clients then output it to a file so I know which clients are off then have the next script pull the ones that are online and reboot them.
This is what I am running with right now. If there is something KISS then by all means please let me know.
... (3 Replies)
hi all,
have a ksh script where i am doing a prstat -m -u osuser 1 1 >> $FILE_NAME but for some reason it only writes 15 lines wheres when i run the same command manually from command prompt it prints out 60 lines.
why is it not writing the full 60 lines to the file ??
ta. (1 Reply)
Hi,
I want to fire the prstat command which should run fro 60 secs and get the report into a text file using a script.
I just know the command:
prstat -c >> log.txt
which will run until we stop it.
But i want the script to run only for 60 sec,print the output to text file and stop... (3 Replies)
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
need help with formatting output of command top and prstat. My requirment is to remove few columns and display remaining . But when i used awk to do that the output seems to be have gone vague, mixing the column values.
After using awk to print particular column the output seems to have lost... (1 Reply)
Im trying to print /etc/passwd with a variable connecting to /etc group/
But when im trying to print the output, /etc/group is printing also. Can i ask for help on what command to use
so it will ignore /etc/group and only print /etc/passwd.
here's the sample script. pages number and the /10... (2 Replies)
Discussion started by: joonisio
2 Replies
LEARN ABOUT OSX
execsnoop
execsnoop(1m) USER COMMANDS execsnoop(1m)NAME
execsnoop - snoop new process execution. Uses DTrace.
SYNOPSIS
execsnoop [-a|-A|-ejhsvZ] [-c command]
DESCRIPTION
execsnoop prints details of new processes as they are executed. Details such as UID, PID and argument listing are printed out.
This program is very useful to examine short lived processes that would not normally appear in a prstat or "ps -ef" listing. Sometimes
applications will run hundreds of short lived processes in their normal startup cycle, a behaviour that is easily monitored with execsnoop.
Since this uses DTrace, only users with root privileges can run this command.
OPTIONS -a print all data
-A dump all data, space delimited
-e safe output, parseable. This prevents the ARGS field containing "
"s, to assist postprocessing.
-j print project ID
-s print start time, us
-v print start time, string
-Z print zonename
-c command
command name to snoop
EXAMPLES
Default output, print processes as they are executed,
# execsnoop
Print human readable timestamps,
# execsnoop -v
Print zonename,
# execsnoop -Z
Snoop this command only,
# execsnoop -c ls
FIELDS
UID User ID
PID Process ID
PPID Parent Process ID
COMM command name for the process
ARGS argument listing for the process
ZONE zonename
PROJ project ID
TIME timestamp for the exec event, us
STRTIME
timestamp for the exec event, string
DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver-
bose descriptions explaining the output.
EXIT
execsnoop will run forever until Ctrl-C is hit.
AUTHOR
Brendan Gregg [Sydney, Australia]
SEE ALSO dtrace(1M), truss(1)version 1.20 Jul 02, 2005 execsnoop(1m)