Solved

How to use prstat within crontab?

Posted on 2011-02-17
5
1,176 Views
Last Modified: 2013-12-27
Hello, I would like to track the memory usage of a given application over a period of time and I would like to put a crontab which would check the memory utilization every day.

* * */1 * * /usr/bin/prstat -p 8392 >> /tmp/8392

Open in new window


But it does not work as it is interactive.. Kindly help me to put prstat in crontab in Solaris. Thanks!
0
Comment
Question by:beer9
5 Comments
 
LVL 1

Accepted Solution

by:
JackSperow earned 167 total points
ID: 34919260
Try this..
(date;prstat -s cpu -n 20 -c 1 1) >> a.txt
0
 
LVL 77

Expert Comment

by:arnold
ID: 34919774
/tmp is a bad location to store files you would want to review if the system crashes/reboots.
You should consider using a script that assembles the PIDs of interest to you.

Other items such as vmstat, iostat ps -ef among other parameters might be something you want to collect at the same time.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 167 total points
ID: 34924109
prstat should never be "interactive". Maybe the PID does no longer exist?

How about searching "ps" output first to get the correct PID?

wmp
0
 
LVL 9

Assisted Solution

by:amolg
amolg earned 166 total points
ID: 34925483
0
 

Author Closing Comment

by:beer9
ID: 34960842
Thank you! :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now