Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: listener.log parsing utility

RE: listener.log parsing utility

From: <John.Hallas_at_vodafone.co.uk>
Date: Thu, 14 Nov 2002 06:48:47 -0800
Message-ID: <F001.005033A7.20021114064847@fatcity.com>


Patrice,
I wrote the enclosed awk script to check the listener log and count the number of connections from each target.
I am sure it could be adapted to suit your needs The first few line of output looks like
Service :Host :User :tcp:ip address :No of Connections


service1 :C               :\Oracle\Ora901\b:xxx:dedicated        24
service2 :xxx       :SMITHL1         :tcp:xx.xx.xxx.xxx    47


/u00/oracle/john 227$ cat a.sh

Script starts here>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo "Service :Host           :User           :tcp:ip address"
echo "======================================================="
grep CONNECT listener.log |\
 awk -F= '{print $3 ":1:" $6 ":2:" $7 ":3:" $9 ":4:" $10 ":5:" $11}' |\
 sed 's/).*:1:/:/' | \
 sed 's/).*:2:/:/' | \
 sed 's/).*:3:/:/' | \
 sed 's/).*:4:/:/' | \
 sed 's/).*:5:/:/' | \
 sed 's/).*$//' | \
 awk -F: '{printf("%-8.8s:%-16.16s:%-16.16s:%-3.3s:%-10.15s\n", \
          $1,$2,$3,$4,$5)}'  | sort  > /tmp/j.lis

grep -v PROGRAM /tmp/j.lis > /tmp/j1.lis cat /tmp/j1.lis | awk '{if (data[$0]++ == 0)lines[++count] = $0}\ END{for (i = 1; i <= count; i++)print lines[i],"\t"data[lines[i]]}'\

        |sort -n +4

rm /tmp/j.lis
rm /tmp/j1.lis
script ends here
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

HTH John
-----Original Message-----
Sent: 14 November 2002 13:09
To: Multiple recipients of list ORACLE-L

Is there such a utility on the 'net somewhere?

I would like to parse the log automatically, and get summaries of connection attempts, rejected connections, errors (if any), who connects, for how long.

I have auditing set up in our db and can get some of that info, but I would like to monitor the contents of listener.log as well.

Just curious.

Regards,
Patrice Boivin
Systems Analyst (Oracle Certified DBA)

Systems Admin & Operations | Admin. et Exploit. des systèmes
Technology Services        | Services technologiques
Informatics Branch         | Direction de l'informatique 
Maritimes Region, DFO      | Région des Maritimes, MPO

E-Mail: boivinp_at_mar.dfo-mpo.gc.ca

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Boivin, Patrice J
  INET: BoivinP_at_mar.dfo-mpo.gc.ca

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: John.Hallas_at_vodafone.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Nov 14 2002 - 08:48:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US