Skip to content

Commit

Permalink
[Metricbeat] Remove requirement of connect as sysdba in Oracle (elast…
Browse files Browse the repository at this point in the history
…ic#18182)

(cherry picked from commit 561eea4)
  • Loading branch information
sayden committed May 5, 2020
1 parent 2c4bf42 commit 89b364d
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/modules/oracle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/oracle/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
4 changes: 0 additions & 4 deletions x-pack/metricbeat/module/oracle/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/oracle/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/modules.d/oracle.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 89b364d

Please sign in to comment.