Skip to main content
Sumo Logic

Collect Oracle Logs and Metrics for Non-Kubernetes environments

Sumo Logic uses the Telegraf operator for Oracle metric collection and the Installed Collector for collecting Oracle logs.

Sumo Logic uses the Telegraf operator for Oracle metric collection and the Installed Collector for collecting Oracle logs. The diagram below illustrates the components of the Oracle collection in a non-Kubernetes environment. Telegraf uses the exec input plugin to obtain Oracle metrics and the Sumo Logic output plugin to send the metrics to Sumo Logic. Logs from Oracle are collected by a Local File Source.

The process to set up collection for Oracle data is done through the following steps:

  1. Configure Logs Collection
    1. Enable Oracle Logging
    2. Verify Log Files Path.
    3. Configure three Local log file Sources.
    4. Set Up Oracle Performance Metrics Script
  2. Configure Metrics Collection
    1. Configure a Hosted Collector
    2. Configure an HTTP Logs and Metrics Source
    3. Install Telegraf
    4. Configure, and start Telegraf

Configure Logs Collection

This section provides instructions for configuring log collection for Oracle running on a non-Kubernetes environment.

Preview steps for Oracle log collection: 

  1. Enable Oracle Logging
  2. Verify Log Files Path.
  3. Configure three Local log file Sources.
  4. Set Up Oracle Performance Metrics Script

Step 1. Enable Oracle Logging                                                                      

If logging is not currently enabled for the following logs, enable it

  • Alert log
  • Listener log

Enable Listener Log: The basic syntax of Listener Control utility commands is as follows

lsnrctl command [listener_name]
lsnrctl set log_status on

  • Audit Log  Follow this guide to enable Audit Logs

Step 2. Verify Local logs file directories and Path. 

  • Oracle Alert Logs

For 11g and later releases (12c, 18c, 19c)

By default, Oracle logs are stored in 

$ORACLE_BASE/diag/rdbms/$DB_UNIQUE_NAME/$ORACLE_SID/trace/.

The default directory for log files is value of BACKGROUND_DUMP_DEST. you can query the value of BACKGROUND_DUMP_DEST, an initialization parameter, where you can find Oracle alert log

SQL> show parameter background_dump_dest;

  • Oracle Listener Logs

You can check listener log file with command

[oracle@sumolab alert]$ lsnrctl status

  • Oracle Audit Logs

By default, Oracle logs are stored in 

$ORACLE_BASE/app/oracle/admin/orcl/adump

The default directory for log files is value of audit_file_dest. you can query the value of audit_file_dest, an initialization parameter, where you can find directory  Oracle Audit log

SQL> show parameter audit

Audit Logs should be in either XML, EXTENDED or {{OS }} for app to Work.

Step 3. Configure three Local File Sources.

In this step, you will configure three Local File sources on an installed collector, one for each of the following Oracle logs: Alert, Listener, and Audit.

Follow the instructions in Local File Source.

When you configure the sources, plan your source categories to ease the querying process.  A hierarchical approach allows you to make use of wildcards. For example:

Source

Example Source Category

Alert Logs

DB/Oracle/Alert

Listener Logs

DB/Oracle/Listener

Audit 

DB/Oracle/Audit

Add Following Fields on each Local File Source:

  • Fields. Set the following fields:
    • component = database.
    • db_system = oracle.
    • db_cluster = <Your_Oracle_Cluster_Name>. Enter Default if you do not have one.
    • environment = <Your_Environment_Name> (for example, Dev, QA, or Prod).

clipboard_e9173e7b60bb2cf40ee701b149541aa31.png

Step 4. Set Up Oracle Performance Metrics Script.

The instructions for setting up the Oracle performance metrics script vary by operating system:

Configure Metrics Collection

Setup a Sumo Logic HTTP Source

Step 1. Configure a Hosted Collector for Metrics.

To create a new Sumo Logic hosted collector, perform the steps in the Configure a Hosted Collector documentation.

Step 2. Configure an HTTP Logs & Metrics source:

  1. On the created Hosted Collector on the Collection Management screen, select Add Source.
  2. Select HTTP Logs & Metrics.
    1. Name (Required). Enter a name for the source.
    2. Description (Optional).
    3. Source Category (Recommended). Be sure to follow the Best Practices for Source Categories. A recommended Source Category may be Prod/DB/Oracle/Metrics.
  3. Select Save.
  4. Take note of the URL provided once you click Save. You can retrieve it again by selecting the Show URL next to the source on the Collection Management screen.

Setup Telegraf

Step 3. Install Telegraf

  1. Install Telegraf if you haven’t already.
  2. Install custom Python script to send Oracle metrics into Sumo
    • Use the following steps to install a custom Python script to send Oracle metrics into Sumo.

Step 4. Configure and start Telegraf.

As part of collecting metrics data from Telegraf, we will use the exec input plugin to get data from Telegraf and the Sumo Logic output plugin to send data to Sumo Logic. 

There are two options

  • Create telegraf.conf file.
  • or modify existing telegraf.conf file.

And copy and paste the text below

[[inputs.exec]]
  commands = ["/path_TO_BE_CHANGEME/exec_oracle_metrics.sh"]
  timeout = "5s"
  data_format = "influx"
  [inputs.exec.tags]
    environment="DEV_TO_BE_CHANGEME"
    component="database"
    db_system="oracle"
    db_cluster="PROD_TO_BE_CHANGEME"

[[outputs.sumologic]]
  url = "<URL_from_HTTP_Logs_and_Metrics_Source>"
  data_format = "prometheus"

Enter values for fields annotated with <VALUE_TO_BE_CHANGED> to the appropriate values. Do not include the brackets (<>) in your final configuration

  • Input plugins section, which is [[inputs.exec]]:
    • commands - The exec plugin executes all the commands in parallel on every interval and parses metrics from their output in any one of the accepted Input Data Formats.
  • In the tags section, which is [inputs.exec.tags]:
    • environment - This is the deployment environment where the Oracle cluster identified by the value of servers resides. For example; dev, prod, or QA. While this value is optional we highly recommend setting it. 
    • db_cluster - Enter a name to identify this Oracle cluster. This cluster name will be shown in our dashboards. 
  • In the output plugins section, which is [[outputs.sumologic]]
    • URL - This is the HTTP source URL created previously. See this doc for more information on additional parameters for configuring the Sumo Logic Telegraf output plugin.

Here’s an explanation for additional values set by this Telegraf configuration.

  • data_format: “prometheus” - In the output [[outputs.sumologic]] plugins section. Metrics are sent in the Prometheus format to Sumo Logic.
  • component - “database” - In the input [[inputs.exec]] plugins section. This value is used by Sumo Logic apps to identify application components.
  • db_system - “oracle” - In the input plugins sections. This value identifies the database system.

See this doc for all other parameters that can be configured in the Telegraf agent globally.

At this point, Telegraf should start collecting the Oracle metrics and forward them to the Sumo Logic HTTP Source.