def metricCollector(self):
c=None
conn=None
try:
import cx_Oracle
except Exception as e:
self.data['status'] = 0
self.data['msg'] = 'cx_Oracle module is not installed'
return self.data
try:
try:
dsnStr = cx_Oracle.makedsn(self.host, self.port, self.sid)
conn = cx_Oracle.connect(user=self.username, password=self.password, dsn=dsnStr, mode=cx_Oracle.SYSDBA)
c = conn.cursor()
except Exception as e:
self.data['status']=0
self.data['msg']='Exception while connecting to '+self.host
c.execute("select * from (SELECT t.tablespace_name,t.logging,t.contents,t.status,NVL(df.allocated_bytes,0)-NVL((NVL(f.free_bytes,0)+df.max_free_bytes),0) usedBytes,NVL((NVL(f.free_bytes,0)+df.max_free_bytes),0) free