Hi,
I need help about Discovery of Oracle Tablespaces.
Fisrt, I'm using Zabbix 4 on Linux.
I'm using the below link to Discovery Oracle tablespaces with ODBC:
https://www.zabbix.com/documentation...ry/sql_queries
I've created a Discovery Rule:
Type: Database Monitor
Key: db.odbc.discovery[ora_tablespace_used_pct_v2, {$DSN}]
SQL Query:
select tbs.tablespace_name as tablespace_name, tbs.used_pct as used_pct
from (select /*+ RULE */a.tablespace_name, round((((a.size_gb - f.size_gb)/a.size_gb) * 100), 2) used_pct from
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) a,
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) f
where a.tablespace_name = f.tablespace_name
and a.tablespace_name in (select tablespace_name from dba_tablespaces where contents <> 'UNDO')) tbs
union
select tablespace_name, round(((tablespace_size - free_space)/tablespace_size) * 100, 2)
from dba_temp_free_space
The item prototype:
Name: Tablespace: {#TABLESPACE_NAME} - Used PCT
Type: Zabbix internal
key: zabbix[proxy,{#TABLESPACE_NAME},lastaccess]
For a host, Zabbix returns the list of tablespaces, but for each tablespace show me a error:
Proxy "SYSAUX" does not exist.
Where SYSAUX is the name of a tablespace.
Please, can you help me to solve this problem?
************************************************** *******************************************
**** What is the correct way to use Item prototype for this case? ****
Do I must use database monitor in item prototype?
I did another way, but I dont know if this is the best way:
SQL Query in Item prototype:
select used_pct from
(select tbs.tablespace_name as tablespace_name, tbs.used_pct as used_pct
from (select /*+ RULE */a.tablespace_name, round((((a.size_gb - f.size_gb)/a.size_gb) * 100), 2) used_pct from
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) a,
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) f
where a.tablespace_name = f.tablespace_name
and a.tablespace_name in (select tablespace_name from dba_tablespaces where contents <> 'UNDO')) tbs
union
select tablespace_name, round(((tablespace_size - free_space)/tablespace_size) * 100, 2)
from dba_temp_free_space)
where tablespace_name = '{#TABLESPACE_NAME}'
************************************************** *******************************************
Thank you very much!
I need help about Discovery of Oracle Tablespaces.
Fisrt, I'm using Zabbix 4 on Linux.
I'm using the below link to Discovery Oracle tablespaces with ODBC:
https://www.zabbix.com/documentation...ry/sql_queries
I've created a Discovery Rule:
Type: Database Monitor
Key: db.odbc.discovery[ora_tablespace_used_pct_v2, {$DSN}]
SQL Query:
select tbs.tablespace_name as tablespace_name, tbs.used_pct as used_pct
from (select /*+ RULE */a.tablespace_name, round((((a.size_gb - f.size_gb)/a.size_gb) * 100), 2) used_pct from
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) a,
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) f
where a.tablespace_name = f.tablespace_name
and a.tablespace_name in (select tablespace_name from dba_tablespaces where contents <> 'UNDO')) tbs
union
select tablespace_name, round(((tablespace_size - free_space)/tablespace_size) * 100, 2)
from dba_temp_free_space
The item prototype:
Name: Tablespace: {#TABLESPACE_NAME} - Used PCT
Type: Zabbix internal
key: zabbix[proxy,{#TABLESPACE_NAME},lastaccess]
For a host, Zabbix returns the list of tablespaces, but for each tablespace show me a error:
Proxy "SYSAUX" does not exist.
Where SYSAUX is the name of a tablespace.
Please, can you help me to solve this problem?
************************************************** *******************************************
**** What is the correct way to use Item prototype for this case? ****
Do I must use database monitor in item prototype?
I did another way, but I dont know if this is the best way:
SQL Query in Item prototype:
select used_pct from
(select tbs.tablespace_name as tablespace_name, tbs.used_pct as used_pct
from (select /*+ RULE */a.tablespace_name, round((((a.size_gb - f.size_gb)/a.size_gb) * 100), 2) used_pct from
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) a,
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 SIZE_GB FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) f
where a.tablespace_name = f.tablespace_name
and a.tablespace_name in (select tablespace_name from dba_tablespaces where contents <> 'UNDO')) tbs
union
select tablespace_name, round(((tablespace_size - free_space)/tablespace_size) * 100, 2)
from dba_temp_free_space)
where tablespace_name = '{#TABLESPACE_NAME}'
************************************************** *******************************************
Thank you very much!