From 89b364d9f9beecc00ee26ecedfef4cffee023268 Mon Sep 17 00:00:00 2001 From: Mario Castro Date: Tue, 5 May 2020 12:57:35 +0200 Subject: [PATCH] [Metricbeat] Remove requirement of connect as sysdba in Oracle (#18182) (cherry picked from commit 561eea462b027d49104a7f040c79ba4872e94aa2) --- CHANGELOG.next.asciidoc | 1 + metricbeat/docs/modules/oracle.asciidoc | 2 +- x-pack/metricbeat/metricbeat.reference.yml | 2 +- x-pack/metricbeat/module/oracle/_meta/config.yml | 2 +- x-pack/metricbeat/module/oracle/connection.go | 4 ---- x-pack/metricbeat/module/oracle/testing.go | 2 +- x-pack/metricbeat/modules.d/oracle.yml.disabled | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 2341a9535db..0fcb222f737 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -446,6 +446,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Stack Monitoring modules now auto-configure required metricsets when `xpack.enabled: true` is set. {issue}16471[[16471] {pull}17609[17609] - Add static mapping for metricsets under aws module. {pull}17614[17614] {pull}17650[17650] - Collect new `bulk` indexing metrics from Elasticsearch when `xpack.enabled:true` is set. {issue} {pull}17992[17992] +- Remove requirement to connect as sysdba in Oracle module {issue}15846[15846] {pull}18182[18182] *Packetbeat* diff --git a/metricbeat/docs/modules/oracle.asciidoc b/metricbeat/docs/modules/oracle.asciidoc index d56abf8648b..2492adcaaaf 100644 --- a/metricbeat/docs/modules/oracle.asciidoc +++ b/metricbeat/docs/modules/oracle.asciidoc @@ -57,7 +57,7 @@ metricbeat.modules: metricsets: ["tablespace", "performance"] enabled: true period: 10s - hosts: ["oracle://user:pass@localhost:1521/ORCLPDB1.localdomain?sysdba=1"] + hosts: ["user:pass@0.0.0.0:1521/ORCLPDB1.localdomain"] # username: "" # password: "" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index d9401526356..927f21a89d9 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -993,7 +993,7 @@ metricbeat.modules: metricsets: ["tablespace", "performance"] enabled: true period: 10s - hosts: ["oracle://user:pass@localhost:1521/ORCLPDB1.localdomain?sysdba=1"] + hosts: ["user:pass@0.0.0.0:1521/ORCLPDB1.localdomain"] # username: "" # password: "" diff --git a/x-pack/metricbeat/module/oracle/_meta/config.yml b/x-pack/metricbeat/module/oracle/_meta/config.yml index b36667b5733..8208685e033 100644 --- a/x-pack/metricbeat/module/oracle/_meta/config.yml +++ b/x-pack/metricbeat/module/oracle/_meta/config.yml @@ -2,7 +2,7 @@ metricsets: ["tablespace", "performance"] enabled: true period: 10s - hosts: ["oracle://user:pass@localhost:1521/ORCLPDB1.localdomain?sysdba=1"] + hosts: ["user:pass@0.0.0.0:1521/ORCLPDB1.localdomain"] # username: "" # password: "" diff --git a/x-pack/metricbeat/module/oracle/connection.go b/x-pack/metricbeat/module/oracle/connection.go index f2fc870fb8d..8beb7c936ad 100644 --- a/x-pack/metricbeat/module/oracle/connection.go +++ b/x-pack/metricbeat/module/oracle/connection.go @@ -50,10 +50,6 @@ func NewConnection(c *ConnectionDetails) (*sql.DB, error) { params.Password = c.Password } - if params.IsSysDBA == false { - return nil, errors.New("a user with DBA permissions are required, check your connection details on field `hosts`") - } - db, err := sql.Open("godror", params.StringWithPassword()) if err != nil { return nil, errors.Wrap(err, "could not open database") diff --git a/x-pack/metricbeat/module/oracle/testing.go b/x-pack/metricbeat/module/oracle/testing.go index 5ffe9cd83f4..5a177f9d823 100644 --- a/x-pack/metricbeat/module/oracle/testing.go +++ b/x-pack/metricbeat/module/oracle/testing.go @@ -28,7 +28,7 @@ func GetOracleEnvServiceName() string { serviceName := os.Getenv("ORACLE_SERVICE_NAME") if len(serviceName) == 0 { - serviceName = "ORCLPDB1.localdomain" + serviceName = "ORCLCDB.localdomain" } return serviceName } diff --git a/x-pack/metricbeat/modules.d/oracle.yml.disabled b/x-pack/metricbeat/modules.d/oracle.yml.disabled index dda3830d715..46207ba0ae4 100644 --- a/x-pack/metricbeat/modules.d/oracle.yml.disabled +++ b/x-pack/metricbeat/modules.d/oracle.yml.disabled @@ -5,7 +5,7 @@ metricsets: ["tablespace", "performance"] enabled: true period: 10s - hosts: ["oracle://user:pass@localhost:1521/ORCLPDB1.localdomain?sysdba=1"] + hosts: ["user:pass@0.0.0.0:1521/ORCLPDB1.localdomain"] # username: "" # password: ""