- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Using sar. How to stop it
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
Discussions
Forums
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
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
тАО08-16-2000 10:58 AM
тАО08-16-2000 10:58 AM
I am wanting to gather a little performance information on my HP-UX 11.0 system. Just want to get some general cpu performance info.
I want to use sar -u -f /tmp/sar.data
Here's the question...I have not seen any mention of how to use the sar command to stop the system activity reporter?
I only want to monitor for a few days and then stop it. I don't want it to run forever and waste disk space and machine resources etc.
How do I handle this?
Thanks for the help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:01 AM
тАО08-16-2000 11:01 AM
Re: Using sar. How to stop it
Check the man pages, in particular the -s and -e options.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:03 AM
тАО08-16-2000 11:03 AM
Re: Using sar. How to stop it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:04 AM
тАО08-16-2000 11:04 AM
Re: Using sar. How to stop it
Check the man pages, in particular the -s and -e options.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:05 AM
тАО08-16-2000 11:05 AM
Re: Using sar. How to stop it
why not put in a cron
0 * * * * sar 1 5 >/tmp/sar.log
That should do what you want no?
Best regards
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:16 AM
тАО08-16-2000 11:16 AM
SolutionAs an example from my cron:
0 7-18 * * 1-5 /usr/lbin/sa/sa1 1200 3
Then I have a script as follows that will convert the binary format to readable format and it is attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:17 AM
тАО08-16-2000 11:17 AM
Re: Using sar. How to stop it
Look at the man page for sa1 and you will see more about the ways to automate sar data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:19 AM
тАО08-16-2000 11:19 AM
Re: Using sar. How to stop it
If you set up sar as advised in the man pages, it will only maintain a maximum of 31 days worth (/var/adm/sa/sa01...31) so do not worry about collecting forever. If however within the day you want to limit the hours to collect it for, the modify the cron entry accordingly.
man sar
man sa1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:20 AM
тАО08-16-2000 11:20 AM
Re: Using sar. How to stop it
As an example from my cron:
0 7-18 * * 1-5 /usr/lbin/sa/sa1 1200 3
Then I have a script as follows that will convert the binary format to readable format and it is attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:40 AM
тАО08-16-2000 11:40 AM
Re: Using sar. How to stop it
/usr/lbin/sa/sadc 10 300 [filename]
This will create a binary file called [filename].
Extract the data with the following command(s):
sar -u -f [filename]
or
sar -b -f [filename]
or
sar -d -f [filename]
or
Use any other sar option.
You have all the sar data you need in one compact binary file. You can put the sadc command in crontab too!
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:43 AM
тАО08-16-2000 11:43 AM
Re: Using sar. How to stop it
/usr/lbin/sa/sadc 10 300 [filename]
This will create a binary file called [filename].
Extract the data with the following command(s):
sar -u -f [filename]
or
sar -b -f [filename]
or
sar -d -f [filename]
or
Use any other sar option.
You have all the sar data you need in one compact binary file. You can put the sadc command in crontab too!
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 11:46 AM
тАО08-16-2000 11:46 AM
Re: Using sar. How to stop it
/usr/lbin/sa/sadc 10 300 [filename]
This will create a binary file called [filename].
Extract the data with the following command(s):
sar -u -f [filename]
or
sar -b -f [filename]
or
sar -d -f [filename]
or
...use any other sar option.
You have all the sar data you need in one compact binary file. You can put the sadc command in crontab too!
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2000 08:46 PM
тАО08-16-2000 08:46 PM
Re: Using sar. How to stop it
#!/usr/local/bin/perl
$DATE=`date`;
chop($DATE);
@STATS=`/usr/bin/sar -uM 1 5`;
@STATS2=`/usr/bin/iostat 2 5`;
@STATS3=`/usr/sbin/swapinfo -mt`;
print ("START $DATE");
print "-----CPU STATS-----";
print "@STATSn";
print "-----DISK STATS-----";
print "@STATS2n";
print "-----MEMORY STATS-----";
print "@STATS3n";
print ("END $DATEnn*****");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:23 AM
тАО08-17-2000 09:23 AM
Re: Using sar. How to stop it
Rick
I've put 0 7-18 * * 1-5 /usr/lbin/sa/sa1 1200 3 in my cronfile
I get the following error message back when it executes:
can't create/open data file no such file or directory
I have sa1 sa2 and sadc in the /usr/lbin/sa directory...What's the problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:29 AM
тАО08-17-2000 09:29 AM
Re: Using sar. How to stop it
This is where the sa files will go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:34 AM
тАО08-17-2000 09:34 AM
Re: Using sar. How to stop it
The 1200 tag on the end of the cron says to get the data every 20 min. Again, if you want to stop the collection, you can comment or remove from the crontab file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:36 AM
тАО08-17-2000 09:36 AM
Re: Using sar. How to stop it
The 1200 tag on the end of the cron says to get the data every 20 min. Again, if you want to stop the collection, you can comment or remove from the crontab file.
Under there I have also created the perf directory. It is just a central location to keep the text data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:37 AM
тАО08-17-2000 09:37 AM
Re: Using sar. How to stop it
There is no /var/adm/sa directory....I only have /var/adm
Do I need to create the sa subdirectory?
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 09:43 AM
тАО08-17-2000 09:43 AM
Re: Using sar. How to stop it
Perms that I have for the sa directory are:
755 root sys
This will allow you to collect the data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 10:35 AM
тАО08-17-2000 10:35 AM
Re: Using sar. How to stop it
Looks like I'm getting some data now...I have a sa17
how does one make use of your script? just copy the sa17 file to /var/adm/sa/perf
and run your script? haven't quite figured out the script you provided yet. What's with the directory creation at the beginning of the script? just a way of organizing the data by month day year?
Also does the script produce a report in a text file or does it display on the screen?
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 11:32 AM
тАО08-17-2000 11:32 AM
Re: Using sar. How to stop it
cpu.17Aug2000
This is one example. Inside this file will be the text output that you can read for the cpu stats for that day (today actually).
As a previous post stated, the binary output (example, sa17) will be overwritten on the 17th of the following month. The data collected from the script will organize the data into the appropriate month and therefore will not be overwritten. But you need to keep tabs on it to ensure that the /var filesystem does not fill up. Every so often you will want to compress and/or remove the files to keep the /var from filling up. The nightly backups ensure I am able to restore files if I need to and the file names allow me to discern which file I want to restore. If I need bufcache data for the month of Jul for example, I know where they were located and what the names of those files look like.
The output from the script will be stored into the files. It will not display on the screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 12:32 PM
тАО08-17-2000 12:32 PM
Re: Using sar. How to stop it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 01:17 PM
тАО08-17-2000 01:17 PM
Re: Using sar. How to stop it
I must be missing something....there are no get sars in the script you attached. I'm afraid you last reply really confused me......
right now I'm just collecting data and trying to figure out your script
Lane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2000 01:36 PM
тАО08-17-2000 01:36 PM
Re: Using sar. How to stop it
(That is what I named the script.)
It is in cron that I call this script (the get_sars script) once per day.
If I can help allieviate some of the confusion, e-mail me at rick.garland@convergentgroup.com