help with a script to have monthly sar reports


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help with a script to have monthly sar reports
# 1  
Old 03-23-2012
help with a script to have monthly sar reports

Hi

I am still learning shell scripting, so for complex stuff, I need help.
I would like to have a script that produces sar monthly reports, so that I can produce a graph from it!
The idea is to use
Code:
/var/adm/sa/<dir of sa files>

Looking to hear from you.

regards
# 2  
Old 03-23-2012
Please post the code that you have written so far. Check out ksar : a sar grapher
# 3  
Old 03-23-2012
Please post what Operating System and version you have and what Shell you are using.

Please post the "sa1" and "sa2" entries from you crontab and any special changes you might have made such that these scripts keep more than a rolling month's worth of data. On most systems "sa1" and "sa2" are scripts which you can read. Beware that the "sa" files can get very large if you snapshot too frequently. Have a look at you "sa" directory and see what range of data you have available.
Check check and double check that your "sa" scripts are set up correctly and that one "sa" file only contains one day's data.

Always have in mind why you are producing the report(s), what the output report(s) should look like, and what you are going to analyse.

We once found that a simple analysis of the day-by-day CPU usage average for one key system was meaningless because it was dominated by an overnight backup. Restricting the analysis to core hours was more interesting but a lot more work.
# 4  
Old 03-23-2012
help with a script to have monthly sar reports

Hi

The operating system is solaris 10, the cron entries are:
Code:
#sar data collection
0 * * * 0-6 /usr/lib/sa/sa1
0,15,30,45 8-23 * * 1-5 /usr/lib/sa/sa1
5 23 * * 1-5 /usr/lib/sa/sa2 -s 7:00 -e 19:01 -i 1200 -A
#

and

Code:
root@nikira # sar -f /var/adm/sa/sa22 -s 15:00 -e 16:00 | more

SunOS nikira 5.10 Generic_127127-11 sun4u    03/22/2012

15:00:00    %usr    %sys    %wio   %idle
15:15:00      38      23       0      39
15:30:00      26      20       0      54
15:45:00      28      17       0      55
16:00:00      29       9       0      62

Average       30      17       0      52
You have new mail in /var/mail//root
root@nikira #

Regards
# 5  
Old 03-23-2012
Worth reading the "sa2" script in case it deletes files before you have saved them. If you need to analyse a month's worth, you'll need a script to save the sa<nn> files daily smewhere where they don't get deleted and with a name (or directory name) containing the month and year.

You seem to be 9/10 there already. The trick is to get "sar" to do the maths and then just plot the average line.

There's a lot of interesting statistics in those files which can give you early warning of overload.

Good luck.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using kSar for short sar reports , failed to parse

Hello i try to run sar short periods of time like 5 minutes , using sar -ALL 2 > test.all.txt then i try to load this file off line in kSar , and kSar failing to parse the file . what i mean is it do read the file but doesn't present the data . i can see clearly that the file is full of... (2 Replies)
Discussion started by: umen
2 Replies

2. UNIX for Dummies Questions & Answers

Tracking the script(.sh) files triggered on daily or monthly basis from source

Hi Gurus, Is there any solution for tracking the script(.sh) files triggered on daily or monthly basis from source - Datastage (Routines) Needs to find out if this scripts are running on daily just want to know that is there anything to track Thanks in Advance (2 Replies)
Discussion started by: SeenuGuddu
2 Replies

3. Shell Programming and Scripting

script to get user id reports korn shell

Dear Friends, Can Any one provide me script to generate list of username with the gecos field. (cat /etc/passwd | cut -d: -f1,5) Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command) and i want a file to be generated on nim... (1 Reply)
Discussion started by: vinodchauhan123
1 Replies

4. AIX

script to get user id reports

Dear Friends, Can Any one provide me script to generate list of username with the gecos field. (cat /etc/passwd | cut -d: -f1,5) Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command) and i want a file to be generated on nim... (0 Replies)
Discussion started by: vinodchauhan123
0 Replies

5. Shell Programming and Scripting

Writing a script to run weekly/monthly - check for weekday or day-of-the-month

Hi all, I currently have a UNIX file maintenance script that runs daily as a cron job. Now I want to change the script and create functions/sub inside it that runs on a weekly or monthly basis. To run all the scripts' daily maintenance, I want to schedule it in cron as simply maint.sh... (1 Reply)
Discussion started by: newbie_01
1 Replies

6. Shell Programming and Scripting

How to insert variable date (monthly) from SQL script

Hi Guys, Can someone please help me on adding/inserting a variable to an sql scipt? Basically I want to generate data on monthly (i.e. July 01, 2011 to July 31, 2011) basis. As shown below.. set head off; set linesize 300; set pagesize 200; spool /opt/oracle/temp/output.txt select... (1 Reply)
Discussion started by: pinpe
1 Replies

7. Shell Programming and Scripting

Integate two reports - bash script

I wrote script in bash which generates this report "first.csv": I wrote script in bash which generates this report "second.csv": I want to integate two reports: "first.csv" and "second.csv". I want like so that "result.csv": Thx (2 Replies)
Discussion started by: patrykxes
2 Replies

8. Shell Programming and Scripting

creating reports using shell schell script

please advise..very urgent. purpose of my script is that it should generate a report by running a sql script which is stored in a directory and pull the information from DB.script shld be in such a way that I just need to pass a parameter and it shld generate the report and store it in a... (1 Reply)
Discussion started by: complicated
1 Replies
Login or Register to Ask a Question