Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Oracle DB Listener

 

The Oracle Database Listener application stores logs on the database server.

To integrate JSA with Oracle DB Listener, select one of the following methods for event collection:

Collecting Events by Using the Oracle Database Listener Protocol

The Oracle Database Listener protocol source allows JSA to monitor log files that are generated from an Oracle Listener database. Before you configure the Oracle Database Listener protocol to monitor log files for processing, you must obtain the directory path to the Oracle Listener database log files.

Samba services must be running on the destination server to properly retrieve events when using the Oracle Database Listener protocol.

To configure JSA to monitor log files from Oracle Database Listener:

  1. Log in to JSA.
  2. Click the Admin tab.
  3. On the navigation menu, click Data Sources.

    The Data Sources pane is displayed.

  4. Click the Log Sources icon.

    The Log Sources window is displayed.

  5. From the Log Source Type list, select Oracle Database Listener.
  6. Using the Protocol Configuration list, select Oracle Database Listener.
  7. Configure the following parameters:

    Table 1: Oracle Database Listener Parameters

    Parameter

    Description

    Log Source Identifier

    Type the IP address or host name for the log source.

    Server Address

    Type the IP address of the Oracle Database Listener.

    Domain

    Type the domain that is required to access the Oracle Database Listener. This parameter is optional.

    Username

    Type the user name that is required to access the host that runs the Oracle Database Listener.

    Password

    Type the password that is required to access the host that runs the Oracle Database Listener.

    Confirm Password

    Confirm the password that is required to access the Oracle Database Listener.

    Log Folder Path

    Type the directory path to access the Oracle Database Listener log files.

    File Pattern

    Type the regular expression (regex) that is needed to filter the file names. All matching files are included in the processing. The default is listener\.log

    This parameter does not accept wildcard or globbing patterns in the regular expression. For example, if you want to list all files that start with the word log, followed by one or more digits and ending with tar.gz, use the following entry: log[0-9]+\.tar\.gz. Use of this parameter requires knowledge of regular expressions (regex). For more information, see the following website: http://docs.oracle.com/javase/tutorial/essential/regex/

    Force File Read

    Select this check box to force the protocol to read the log file when the timing of the polling interval specifies.

    When the check box is selected, the log file source is always examined when the polling interval specifies, regardless of the last modified time or file size attribute.

    When the check box is not selected, the log file source is examined at the polling interval if the last modified time or file size attributes changed.

    Recursive

    Select this check box if you want the file pattern to also search sub folders. By default, the check box is selected.

    Polling Interval (in seconds)

    Type the polling interval, which is the number of seconds between queries to the log files to check for new data. The minimum polling interval is 10 seconds, with a maximum polling interval of 3,600 seconds. The default is 10 seconds.

    Throttle Events/Sec

    Type the maximum number of events the Oracle Database Listener protocol forwards per second. The minimum value is 100 EPS and the maximum is 20,000 EPS. The default is 100 EPS.

  8. Click Save.
  9. On the Admin tab, click Deploy Changes.

Collecting Oracle Database Events by Using Perl

The Oracle Database Listener application stores logs on the database server. To forward these logs from the Oracle server to JSA, you must configure a Perl script on the Oracle server. The Perl script monitors the listener log file, combines any multi-line log entries in to a single log entry, and sends the logs, by using syslog (UDP), to JSA.

Before the logs are sent to JSA, they are processed and reformatted so that they are not forwarded line-by-line, as this is the format in the log file. All of the relevant information is retained.

Note

Perl scripts that are written for Oracle DB listener work on Linux/UNIX servers only. Windows Perl script is not supported. You must make sure Perl 5.8 is installed on the device that hosts the Oracle server.

To install and configure the Perl script:

  1. Go to the following website to download the files that you need:

    https://support.juniper.net/support/downloads/

  2. From the Downloads list, click Select product tab.
  3. Select JSA from the Product Group list.
  4. Select JSA from the Select from JSA list.
  5. Select the Installed Version of JSA.
  6. Select Linux from the Platform list and click Continue.
  7. 8. Select Browse for fixes and click Continue.
  8. Select Script.
  9. Click <JSA_version>-oracle_dblistener_fwdr-<version_number>.pl.tar.gz to download the Oracle DB Listener Script.
  10. Copy the Oracle DB Listener Script to the server that hosts the Oracle server.
  11. Log in to the Oracle server by using an account that has read/write permissions for the listener.log file and the /var/run directory.
  12. Extract the Oracle DB Listener Script file by typing the following command:

    tar -xvzf oracle_dblistener_fwdr-<version_number>.pl.tar.gz

  13. Type the following command and include any additional command parameters to start the Oracle DB Listener script:

    oracle_dblistener_fwdr.pl -h <IP address> -t "tail -F listener.log"

    Where <IP address> is the IP address of your JSA console orEvent Collector.

    Table 2: Command Parameters

    Parameters

    Description

    -D

    The -D parameter defines that the script is to run in the foreground.

    Default is to run as a daemon and log all internal messages to the local syslog service.

    -t

    The -t parameter defines that the command-line is used to tail the log file (monitors any new output from the listener). The log file might be different across versions of the Oracle database; some examples are provided below:

    Oracle 9i: <install_directory>/product/9.2/network/log /listener.log

    Oracle 10g: <install_directory>/product/10.2.0/db_1/network/log /listener.log

    Oracle 11g: <install_directory>/diag/tnslsnr/qaoracle11/listener /trace/listener.log

    -f

    The -f parameter defines the syslog facility.priority to be included at the beginning of the log.

    If nothing is specified, user.info is used.

    -g

    The -g parameter defines the language pack file. For example,

    ./oracle_dblistener_fwdr.pl -h <IP_address>

    -g /root/OracleDBListener/languagepacks/localization.french

    -t "tail -f /root/smbtest/listener_vali.log"

    This parameter is optional.

    -H

    The -H parameter defines the host name or IP address for the syslog header. It is suggested that is the IP address of the Oracle server on which the script is running.

    -h

    The -h parameter defines the receiving syslog host (the Event Collector host name or IP address used to receive the logs).

    -p

    The -p parameter defines the receiving UDP syslog port.

    If a port is not specified, 514 is used.

    -r

    The -r parameter defines the directory name where you wish to create the .pid file. The default is /var/run. This parameter is ignored if -D is specified.

    -l

    The -I parameter defines the directory name where you wish to create the lock file. The default is /var/lock. This parameter is ignored if -D is specified.

    For example, to monitor the listener log on an Oracle 9i server with an IP address of 192.168.12.44 and forward events to JSA with the IP address of 192.168.1.100, type the following code:

    oracle_dblistener_fwdr.pl -t tail -f <install_directory>/product/9.2/network/log/listener.log -f user.info -H 192.168.12.44 -h 192.168.1.100 -p 514

    A sample log from this setup would appear as follows:

    <14>Apr 14 13:23:37 192.168.12.44 AgentDevice=OracleDBListener Command=SERVICE_UPDATE DeviceTime=18-AUG-2006 16:51:43 Status=0 SID=qora9

    Note

    The kill command can be used to stop the script if you need to reconfigure a script parameter or stop the script from sending events to JSA. For example,

    kill -QUIT `cat /var/run/oracle_dblistener_fwdr.pl.pid`

    The example command uses the backquote character (`), which is located to the left of the number one on most keyboard layouts.

You can now configure the Oracle Database Listener within JSA.

Configuring the Oracle Database Listener Within JSA

You can configure the Oracle Database Listener within JSA.

  1. From the Log Source Type list, select Oracle Database Listener.
  2. From the Protocol Configuration list, select syslog.
  3. In the Log Source Identifier field, type the IP address of the Oracle Database you specified using the -H option in Collecting Oracle database events by using PerlThe Oracle Database Listener application stores logs on the database server. To forward these logs from the Oracle server to JSA, you must configure a Perl script on the Oracle server. The Perl script monitors the listener log file, combines any multi-line log entries in to a single log entry, and sends the logs, by using syslog (UDP), to JSA..

    The configuration of the Oracle Database Listener protocol is complete. For more information on Oracle Database Listener, see your vendor documentation.