12-19-2008
two log file comparison and display if needed...
Hi All,
i've written script to collect the tablespaces and the datafiles related to each tablespaces with free space available and directed to two logfiles.. ( pasted below)
1. datafile_test.log
PSAPSR3
PSAPSR3700
PSAPSR3USR
2. freedata_test.log
/oracle/PJ1/sapdata3/sr3_14/sr3.data14 PSAPSR3 640
/oracle/PJ1/sapdata3/sr3_14/sr3.data14 PSAPSR3 114624
/oracle/PJ1/sapdata1/sr3700_1/sr3700.data1 PSAPSR3700 50112
/oracle/PJ1/sapdata1/sr3700_2/sr3700.data2 PSAPSR3700 33728
/oracle/PJ1/sapdata1/sr3700_3/sr3700.data3 PSAPSR3700 14272
/oracle/PJ1/sapdata1/sr3700_4/sr3700.data4 PSAPSR3700 17344
/oracle/PJ1/sapdata2/sr3700_5/sr3700.data5 PSAPSR3700 15296
/oracle/PJ1/sapdata2/sr3700_6/sr3700.data6 PSAPSR3700 256
/oracle/PJ1/sapdata2/sr3700_7/sr3700.data7 PSAPSR3700 1984
/oracle/PJ1/sapdata2/sr3700_8/sr3700.data8 PSAPSR3700 960
/oracle/PJ1/sapdata3/sr3700_10/sr3700.data10 PSAPSR3700 3008
/oracle/PJ1/sapdata3/sr3700_11/sr3700.data11 PSAPSR3700 960
/oracle/PJ1/sapdata3/sr3700_12/sr3700.data12 PSAPSR3700 960
/oracle/PJ1/sapdata3/sr3700_9/sr3700.data9 PSAPSR3700 960
/oracle/PJ1/sapdata4/sr3700_13/sr3700.data13 PSAPSR3700 6080
/oracle/PJ1/sapdata4/sr3700_14/sr3700.data14 PSAPSR3700 9152
/oracle/PJ1/sapdata4/sr3700_15/sr3700.data15 PSAPSR3700 30656
/oracle/PJ1/sapdata4/sr3700_16/sr3700.data16 PSAPSR3700 52160
/oracle/PJ1/sapdata1/sr3usr_1/sr3usr.data1 PSAPSR3USR 11968
Now i want to write a script which need to take the first tablespace name from log 1 and then grep that tablespace in log 2 and search if any of the datafile is having less than 6000 mb then "echo .." And then take second tablespace name from log 1 and repeat the same...
Any help is appreciated..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using the Korn shell script to display lines of the file. For example below:
outputfile=test.dat
-- display each line of the test.dat file
abcd 345
adek 45566
dve3 34565
so on...
I appreciate your time to find a command for displaying lines of the file on the log.
... (2 Replies)
Discussion started by: sbryant
2 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
Can anyone help me with this.
There are two files and I have to match the second file records with that of first and if matched, print the output in two fies, one containing the matched records and other containing the rest.
Here is the example.
File1
"111",erter,"00000", ... (4 Replies)
Discussion started by: er_ashu
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a requirement for taking an particular number in a log file. if i grep for the particular string it will retrieve the entire line for the particular string. but i want to display only the string from each line which i am searching for,
Note: The searching field varies its position... (3 Replies)
Discussion started by: senthilkumar_ak
3 Replies
4. Shell Programming and Scripting
Hi i have 2 csv files a.csv and b.csv with the same number of columns and a list of values in both of it. Each and every individual value in both the files need to compared and if it matches then print correct in a new csv file otherwise print Incorrect
eg
a.csv
1,12/27/2007,Reward,$10.00... (5 Replies)
Discussion started by: naveenn08
5 Replies
5. Shell Programming and Scripting
hi Gurus,
Need to pick your brains on this minor script project.
I would like to continuously monitor a log file with sample log messages as below, and if PSOldGen percentage is either 99% or 100% for consecutively 10 times, alert someone.
{Heap before gc invocations=46516:
PSYoungGen ... (6 Replies)
Discussion started by: kenchen722
6 Replies
6. OS X (Apple)
My UNIX skills amount to "Google,Copy,Paste..." but I managed to get a useful log file generated by an automation system that runs 24/7. The log file exists on an Omneon Media Grid server where I monitor it via "tail -F /..." Unfortunately we have many workstations running Tiger 10.4.8 still and... (2 Replies)
Discussion started by: SolarDarkroom
2 Replies
7. Shell Programming and Scripting
My intention is to log the output to a file as well as it should be displayed on the console > I have used tee ( tee -a ${filename} ) command for this purpose. This is working as expected for first few outputs, after some event loggin nothing is gettting logged in to the file but It is displaying... (3 Replies)
Discussion started by: sanoop
3 Replies
8. Shell Programming and Scripting
Hi,
I urgently need some help how to extract distinct entries from a Log file.
The Log File may have same error occuring many times so how do i count the occurance of an error in file and also extract out distinct errors in a file.
Eg:-
I have a file name A.log
it contains entries as below:-... (5 Replies)
Discussion started by: roro
5 Replies
9. Shell Programming and Scripting
Hi,
I have fileA.txt like this.
B01B02 D0011718
B01B03 D0012540
B01B04 D0006145
B01B05 D0004815
B01B06 D0012069
B01B07 D0004064
B01B08 D0011988
B01B09 D0012071
B01B10 D0005596
B01B11 D0011351
B01B12 D0004814
B01C01 D0011804
I want to compare this against another file (fileB.txt)... (3 Replies)
Discussion started by: genehunter
3 Replies
10. Shell Programming and Scripting
Please repost your query: Help needed: script for timely average from log file - Thank you. (0 Replies)
Discussion started by: mkfs
0 Replies
LEARN ABOUT REDHAT
logwatch
LOGWATCH(8) User Manuals LOGWATCH(8)
NAME
logwatch - system log analyzer and reporter
SYNOPSIS
logwatch [--detail level ] [--logfile log-file-group ] [--service service-name ] [--print] [--mailto address ] [--archives] [--range range
] [--debug level ] [--save file-name ] [--logdir directory ] [--hostname hostname ] [--help|--usage]
DESCRIPTION
LogWatch is a customizable, pluggable log-monitoring system. It will go through your logs for a given period of time and make a report in
the areas that you wish with the detail that you wish. Easy to use - works right out of the package on almost all systems.
OPTIONS
--detail level
This is the detail level of the report. level can be high, med, low.
--logfile log-file-group
This will force LogWatch to process only the set of logfiles defined by log-file-group (i.e. messages, xferlog, ...). LogWatch will
therefore process all services that use those logfiles. This option can be specified more than once to specify multiple logfile-
groups.
--service service-name
This will force LogWatch to process only the service specified in service-name (i.e. login, pam, identd, ...). LogWatch will there-
fore also process any log-file-groups necessary to process these services. This option can be specified more than once to specify
multiple services to process. A useful service-name is All which will process all services (and logfile-groups) for which you have
filters installed.
--print
Print the results to stdout (i.e. the screen).
--mailto address
Mail the results to the email address or user specified in address.
--archives
Each log-file-group has basic logfiles (i.e. /var/log/messages) as well as archives (i.e. /var/log/messages.? or /var/log/mes-
sages.?.gz). This option will make LogWatch search through the archives in addition to the regular logfiles. The entries must
still be in the proper date range (see below) to be processed, however.
--range range
You can specify a date-range to process. This option is currently limited to only Yesterday, Today and All.
--debug level
For debugging purposes. level can range from 0 to 100. This will really clutter up your output. You probably don't want to use
this.
--save file-name
Save the output to file-name instead of displaying or mailing it.
--logdir directory
Look in directory for log files instead of the default directory.
--hostname hostname
Use hostname for the reports instead of this system's hostname. In addition, if HostLimit is set in /etc/log.d/logwatch.conf, then
only logs from this hostname will be processed (where appropriate).
--usage
Displays usage information
--help same as --usage.
FILES
/etc/log.d/logwatch.conf
Really a symlink to /etc/log.d/conf/logwatch.conf. This file sets the default values of all the above options. These defaults are
used when LogWatch is called without any parameters (i.e. from cron.daily). The file is well-documented, but the explanations above
also apply to this config file.
/etc/log.d/conf/services/*
Configuration files for the various services whose log entries LogWatch can process.
/etc/log.d/conf/logfiles/*
Configuration files for the various logfiles that the above service's log entries are stored in.
/etc/log.d/scripts/shared/*
Filters common to many services and/or logfiles.
/etc/log.d/scripts/logfiles/*
Filters specific to just particular logfiles.
/etc/log.d/scripts/services/*
Actual filter programs for the various services.
EXAMPLES
logwatch --service ftpd-xferlog --range all --detail high --print --archives
This will print out all FTP transfers that are stored in all current and archived xferlogs.
logwatch --service pam_pwdb --range yesterday --detail high --print
This will print out login information for the previous day...
MORE INFORMATION
For information on adding your own filter, please see the file HOWTO-Make-Filter which should have been included with Logwatch. If you
installed from an RPM, it is probably under /usr/share/doc/logwatch-XXX.
BUGS
The --range option is very weak... this will be fixed in the future.
AUTHOR
Kirk Bauer <kirk@kaybee.org>
http://www.kaybee.org/~kirk
ftp://ftp.kaybee.org/pub/redhat/RPMS
Linux MARCH 1998 LOGWATCH(8)