Need script....We get sar file sa15 with 7 days data which gets appended.. we want filter and parse the outptu such that we should filter only last 48 hours data and then email it to out team.
we read -- sar -f sa15
Please help me with the script either by use sar itself or even sar and awk
Its urgent?
sar -f sa15 ---- last 48 hours >> output
mailx ---------
The simplest solution would be to calculate how many lines of data would be generated over 48 hours, e.g. if sar data is collected ever 20 minutes then that would be 3 lines per hour making 144 lines so you could run:
Note use of single arrow to replace any file that was present so the mail only contains the last 48 hour's data.
---------- Post updated 22-01-10 at 16:43 ---------- Previous update was 21-01-10 at 21:03 ----------
and to get a report every hour then use a script like:
Put this in a file, e.g. /usr/local/bin/sar_mail.sh, make it executable and onwed by the user you want to run it:
, then add a line to a user's crontab to call it every hour, e.g.:
Run:
the add line to the user's crontab:
This will run the script on the hour every hour.
Need script....We get sar file sa15 with 7 days data which gets appended.. we want filter and parse the outptu such that we should filter only last 48 hours data and then email it to out team.
we read -- sar -f sa15
Please help me with the script either by use sar itself or even sar and awk
Its urgent?
sar -f sa15 ---- last 48 hours >> output
mailx ---------
cfajohnson - Good question the sar output noorm mailed to me had times only so you'd have to count back how many times the last time occurs to extract 48 hours.
I'm used to each day being in separate sann and sarnn files.
Last edited by TonyFullerMalv; 01-23-2010 at 02:34 PM..
I got this reply from my official when i ran ur 1st sar shell prog -
---- Reply is----
The assumption and calculation are not correct. You must look at the top line where you have the starting date.
next lines have starting time. Use both of these pieces for info. Sar file will not contain 48 hours of data-----
Sar output for you again --
It has become a challenge for to get this done ---I will never let you down.
Please help?
Let me know of you need any info?
Last edited by Scott; 01-28-2010 at 12:06 PM..
Reason: Code tags, PLEASE!
Dear users,
I have Linux server whose versions are Suse 10 SP 3 and Suse 11.
I am trying to send email from these servers to my GroupWise email account.
In /etc/postfix/main.cf file, The current value of MYHOSTNAME is LINUX.LOCAL. What should be the right value of MYHOSTNAME? Is... (0 Replies)
I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email.
spool table_update.html;
SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription';
spool off;
exit;
Please use code tags next time for your code and data.... (9 Replies)
hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version).
i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010).
a. i cant see a list of the contacts,... (0 Replies)
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Dear All-
My requirement is as below-
Header file
$ cat HEADER.txt
RequestId:
RequestDate:
Data file
$ cat DATAVAL.txt
1001|2009-03-01
I need to send the combined data below as email body via mailx command
------------------
RequestId:1001
RequestDate:2009-03-01
I would like... (4 Replies)
Hello everyone
I have a problem and I need your help:
I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server.
I need send an email from Solaris servers preferably using Centos4 email server.
I have no mail service configured in my Solaris computers (1 Reply)
Hi All,
How do I send an email using malix where email address contains a #.
I have a email address like this : #test@test.com
I want to send email like malix -s "TEST" #test@test.com < SOMEFILE
I tried \# but doesn't work. Please let me know how we can achieve this?
I am in... (1 Reply)
Hi
A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as
" usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)