- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Executing 'TOP' in the background
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 12:25 PM
09-14-2004 12:25 PM
I have one application running in my redhat LINUX box for 10-15 hours. I need to monitor the CPU usage of the system during the time the application is running. Can anyone tell me how I would execute "TOP" utility in the background for the amount of time my application is running and gather the information in specified files to be analyzed at the end of the day.
Thanks,
Andy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 12:38 PM
09-14-2004 12:38 PM
Re: Executing 'TOP' in the background
There is an option "-f" that can be given with top to capture the data in a file on HP systems. For ex.,
top -s5 -d6 -f top.out
Will capture the data for 30 seconds for every 5 seconds.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 02:55 PM
09-14-2004 02:55 PM
Re: Executing 'TOP' in the background
might I add my 2-cents here..
try also:
$ w
$ uptime
and of course, check out the man pages on uptime, sar, cron, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 05:02 PM
09-14-2004 05:02 PM
Re: Executing 'TOP' in the background
Top will definitely do the trick.
Also you can use SAR (System Activity reporter to get the Statistics)
Use: # sar -u
See man sar to get more details.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 06:15 PM
09-14-2004 06:15 PM
Solutionmake a script as,
# Start the application
..........
# get the process count
count=$(ps -ef | grep -v grep | wc -l)
# Run the top as,
top -d 1 -f filename -n $count
It will update the top information's of all process there in filename
Note: top will run only once.
If you want automate then,
try to put in loop as,
while true; do
# top execution
# Sleep time
# check process running / stopping
# If stopped,
stop execution
done
Use file on top as with time and date or counts to identify the information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 07:48 PM
09-14-2004 07:48 PM
Re: Executing 'TOP' in the background
you could run the "top" command with the "-f" option which writes into a file (in the background)
top -d
Regards
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 05:20 AM
09-15-2004 05:20 AM
Re: Executing 'TOP' in the background
Can anyone please help me out of this
Thanks,
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 03:56 PM
09-15-2004 03:56 PM
Re: Executing 'TOP' in the background
# Collect process id of started process
top -p
It will give the informations of that process at that time ( only one count )
If you want then redirect into one analysis file as,
top -p
Note: And it is HP-UX related one. If you want the specific then go on linux related on itrc. :-)
HTH.