summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2023-05-29 13:00:47 +0300
committerGitHub <noreply@github.com>2023-05-29 13:00:47 +0300
commit1aed6efd3c603cf247dc56688d3543b6b650b490 (patch)
treec5bd6ab3b2b4ebc84e5a1af1c56b5849304e89e6 /collectors
parent430c0ec56a7cf0d8672e5a5ee9a73455f030b1ad (diff)
oracledb: make conn protocol configurable (#15104)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/python.d.plugin/oracledb/oracledb.chart.py9
-rw-r--r--collectors/python.d.plugin/oracledb/oracledb.conf4
2 files changed, 10 insertions, 3 deletions
diff --git a/collectors/python.d.plugin/oracledb/oracledb.chart.py b/collectors/python.d.plugin/oracledb/oracledb.chart.py
index 6bb2b28549..455cf270ee 100644
--- a/collectors/python.d.plugin/oracledb/oracledb.chart.py
+++ b/collectors/python.d.plugin/oracledb/oracledb.chart.py
@@ -16,6 +16,7 @@ except ImportError:
HAS_ORACLE_NEW = False
try:
import cx_Oracle
+
HAS_ORACLE_OLD = True
except ImportError:
HAS_ORACLE_OLD = False
@@ -328,6 +329,7 @@ class Service(SimpleService):
self.password = configuration.get('password')
self.server = configuration.get('server')
self.service = configuration.get('service')
+ self.protocol = configuration.get('protocol', 'tcps')
self.alive = False
self.conn = None
self.active_tablespaces = set()
@@ -338,7 +340,8 @@ class Service(SimpleService):
self.conn = None
if HAS_ORACLE_NEW:
try:
- self.conn = cx_Oracle.connect(f'{self.user}/{self.password}@tcps://{self.server}/{self.service}')
+ self.conn = cx_Oracle.connect(
+ f'{self.user}/{self.password}@{self.protocol}://{self.server}/{self.service}')
except cx_Oracle.DatabaseError as error:
self.error(error)
return False
@@ -824,7 +827,7 @@ class Service(SimpleService):
'absolute',
1,
1000,
- ])
+ ])
self.charts['allocated_usage'].add_dimension(
[
'{0}_allocated_used'.format(name),
@@ -832,7 +835,7 @@ class Service(SimpleService):
'absolute',
1,
1000,
- ])
+ ])
self.charts['allocated_usage_in_percent'].add_dimension(
[
'{0}_allocated_used_in_percent'.format(name),
diff --git a/collectors/python.d.plugin/oracledb/oracledb.conf b/collectors/python.d.plugin/oracledb/oracledb.conf
index 6d7bb480f3..027215dad5 100644
--- a/collectors/python.d.plugin/oracledb/oracledb.conf
+++ b/collectors/python.d.plugin/oracledb/oracledb.conf
@@ -66,6 +66,8 @@
# server: localhost:1521 # the IP address or hostname (and port) of the Oracle Database Server. Required.
# service: XE # the Oracle Database service name. Required. To view the services available on your server,
# run this query: `select SERVICE_NAME from gv$session where sid in (select sid from V$MYSTAT)`.
+# protocol: tcp/tcps # one of the strings "tcp" or "tcps" indicating whether to use unencrypted network traffic
+# or encrypted network traffic
#
# ----------------------------------------------------------------------
# AUTO-DETECTION JOBS
@@ -76,9 +78,11 @@
# password: 'secret'
# server: 'localhost:1521'
# service: 'XE'
+# protocol: 'tcps'
#remote:
# user: 'netdata'
# password: 'secret'
# server: '10.0.0.1:1521'
# service: 'XE'
+# protocol: 'tcps'