We have 2 scripts below for reporting sar output which are pretty same.
In first script i want to add to the program whatever is given in the comments.
In second script I want to use while true to run this program every hour and everything that is in comment.
Finally I want to club both script and make it one single sar script.
Please can anyone help and write a program asap.
sar -f /path/sarfile| head -6 > file.$$
sar -f /path/sarfile|grep -vi restart |tail -50 >> file.$$
mailx -s "Last 48 hours sar data at `date`" abc@c.com < file.$$
sleep 3600
sar -f /home01/ml30464/sa21 | head -6 > file.$$
sar -f /home01/ml30464/sa21 |grep -vi restart |tail -50 >> file.$$
mailx -s "Last 48 hours sar data at `date`" abc@c.com < file.$$
rm sa21.$$
else
echo ' file not exist'
fi
done
exit
#need to add and display if file is 2 days old
Last edited by noorm; 02-01-2010 at 01:06 PM..
Reason: code tags, please...
When i execute the below shell script with 2 different Input files, for one of the data files (datafile1) my email message body in the outlook messes up and every thing comes up in one line. May i please know what i am doing wrong here or how to fix this? The only difference in data files is one is... (1 Reply)
Hi All,
#!/bin/ksh
call_sql ()
{
sql=$1
sqlplus -s $sqlparam_sieb <<EOF
SET ECHO OFF;
SET NEWPAGE NONE;
SET SQLBL OFF;
SET VERIFY OFF;
SET LINESIZE 2000;
SET... (2 Replies)
I'm looking for a way to neaten up the out put of an ldapquery. I might get one, none, or several returns for each query; and each query consists of multiple lines. And while each return will contain the same types of info, it might be in a different order, like:
uniq: 1
ip: 192.168.2.3... (3 Replies)
I am facing a problem formatting the output of my shell script in excel.
We are directing the output of the script to an excel sheet and need long integer type data printed in Excel as it is (i.e. not in the default scientific notation).
Also, leading zeroes(if any) in the output are getting... (4 Replies)
Hi Guys..
Need your help to format the output of my shell script.
I am using spool command to take out put in csv file.
below is my code. (for example)
col USERNAME for a15
col EMAIL for a30
col FULL_NAME for a20
col LAST_LOGIN for a40
col DATE_CREATED for a40
SPOOL 120.csv... (3 Replies)
Hi,
I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification
in short
select var,data from usage;
o/p=... (1 Reply)
Hi All,
I'm finding it difficult to format the query output that was returned in a shell script.
Actually i have one shell script which does some DB stuff and depending on the result it will do some more tasks. My question here is to format the query output returned by mysql.
Intitally my... (5 Replies)
Dear readers,
I have a script that counts the number of files in particular directories in my home location and displays the output. Now I have 13 directories in my home location. I am getting the output as :
Avishek_dir 13
Kunal_dir 17
Shantanu_dir 18
Arup_dir 12
Pranabesh_dir 19
.
.... (7 Replies)
Hi,
I have output from sadf as below
# hostname;interval;timestamp;DEV;tps;rd_sec/s;wr_sec/s;avgrq-sz;avgqu-sz;await;svctm;%util
bigredhat4.na.uis.unisys.com;2;2009-05-23 00:36:40;dev8-0;0.00;0.00;0.00;0.00;0.00;0.00;0.00;0.00;dev8-16;2.27;0.00;90.91;40.00;0.00;1.75;1.75;0.40... (2 Replies)
Hello all,
Can somebody please offer some advice. I'm working on a small script to list all packages on the local and remote systems and need it in the following format.
Machine Name, Package, Version
Here is what i have so far but i can't seem to get the output of the hostname to loop to... (3 Replies)