- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Running a sar script at scheduled intervals
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
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
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
тАО11-16-2010 01:08 PM
тАО11-16-2010 01:08 PM
I am writing a script that will include the sar command sending its output to a text file which, in turn, will be e-mailed to the system administrator. The command syntax that I had in mind for sar is the following:
/usr/sbin/sar -v 1 30 >> /tmp/output.txt
The idea here is to run the script every half hour on the hour in order to keep watch of the process, inode, and system file tables.
The server in question is running HP-UX 11.11, and it is part of a ServiceGuard cluster. It also runs NIS server, Samba, and Postgres daemons.
My question are the following:
1. Is running the script at the mentioned interval a good method of keeping track of the tables?
2. Is running sar for thirty seconds an adequate time, or should I adjust the time to something else?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 01:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 01:31 PM
тАО11-16-2010 01:31 PM
Re: Running a sar script at scheduled intervals
It provides the cron jobs for collecting sar data via sa1 and creating a report with sa2 This is a well known feature of sar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 01:37 PM
тАО11-16-2010 01:37 PM
Re: Running a sar script at scheduled intervals
Thanks for your reply. I did a check of the man page for sa1, and I will give it a try. My understanding is it can be configured to run once every hour using the following command syntax:
/usr/lbin/sa/sa1 -n 1 -t 3600
The output file can then be e-mailed to the administrator. What do you think?
Also, is there any advantage to my using sa2 as opposed to sa1?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 01:42 PM
тАО11-16-2010 01:42 PM
Re: Running a sar script at scheduled intervals
sa2 converts to ascii to be viewed / emailed once daily.
there are perfect examples of usage in the manpage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2010 05:09 PM
тАО11-16-2010 05:09 PM
Re: Running a sar script at scheduled intervals
I set up the cron job for sa1, and monitored the results. The scheduled task failed with a return code of 2.
When I checked root's mail, I came across the following message:
sadc: Can't create/open data file: No such file or directory
I checked the /usr/lbin/sa directory, and the sa1, sa2, and sadc files were there. The following is a listing of the folder:
total 44
-r-xr-xr-x 1 bin bin 205 Nov 7 1997 sa1
-r-xr-xr-x 1 bin bin 250 Nov 7 1997 sa2
-r-xr-xr-x 1 bin bin 20480 Dec 1 2000 sadc
What would cause the error message to occur even though it appears the sadc file is present? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 01:48 PM
тАО11-17-2010 01:48 PM
Re: Running a sar script at scheduled intervals
I was able to solve the problem with some additional help. It turns out the absence of the /var/adm/sa directory was the root cause of the problem. Once the directory was created, the sa1 and sa2 scripts ran without issue.
Thanks for the help anyway.