From e08b511b074b9e0a1346696b03447b1f300cb5e3 Mon Sep 17 00:00:00 2001 From: sayden Date: Mon, 4 May 2020 18:02:55 +0200 Subject: [PATCH 1/4] Remove requirement of connect as sysdba --- x-pack/metricbeat/module/oracle/connection.go | 4 ---- 1 file changed, 4 deletions(-) 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") From 9cb2955dbd0ea77ecd5adb005af5f45bd576ea1f Mon Sep 17 00:00:00 2001 From: sayden Date: Mon, 4 May 2020 18:21:47 +0200 Subject: [PATCH 2/4] Add changelog entry --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index b60768970d1..6dec9852f9d 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -368,6 +368,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add aggregation aligner as a config parameter for googlecloud stackdriver metricset. {issue}17141[[17141] {pull}17719[17719] - Move the perfmon metricset to GA. {issue}16608[16608] {pull}17879[17879] - Add static mapping for metricsets under aws module. {pull}17614[17614] {pull}17650[17650] +- Remove requirement to connect as sysdba in Oracle module {issue}15846[15846] {pull}18182[18182] *Packetbeat* From 77be697b19c94b1256d8e33bdeafa28492960dcf Mon Sep 17 00:00:00 2001 From: sayden Date: Mon, 4 May 2020 20:19:30 +0200 Subject: [PATCH 3/4] Updated examples and test --- 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/testing.go | 2 +- x-pack/metricbeat/modules.d/oracle.yml.disabled | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 be35d457ced..ae8b27c392d 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -992,7 +992,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/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 219a27f0fe7..04beb96f9b7 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: "" From 91df6d3ca4aa795c1eec9e446ce411de4bc246d7 Mon Sep 17 00:00:00 2001 From: sayden Date: Tue, 5 May 2020 12:56:04 +0200 Subject: [PATCH 4/4] Update changelog entry --- CHANGELOG.next.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 7745d7b7544..2ea420a3afd 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -378,8 +378,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add aggregation aligner as a config parameter for googlecloud stackdriver metricset. {issue}17141[[17141] {pull}17719[17719] - Move the perfmon metricset to GA. {issue}16608[16608] {pull}17879[17879] - Add static mapping for metricsets under aws module. {pull}17614[17614] {pull}17650[17650] -- Remove requirement to connect as sysdba in Oracle module {issue}15846[15846] {pull}18182[18182] - 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*