Skip to main content

Prerrequisites

This plugin establishes remote connections to the databases it monitors, so it's essential to ensure connectivity between the Pandora FMS server and these databases. Proper network and firewall configurations must be in place to allow communication between the server and the remote databases to ensure the plugin's effective operation.

EN — Connection

The plugin connects via oracledb (Python driver) using the format:

HOST:PORT/SID

Or using a full DSN string:

dsn=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales1-srv)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))

The connection user must have at least CREATE SESSION privilege:

GRANT CREATE SESSION TO pandora;

EN — Grants per Module

All modules are opt-in via checkboxes in the Discovery configuration. Only enable the grants needed for the modules you actually use.

1. Connections (checkConnections)

-- v$session (active session count)
GRANT SELECT ON V_$SESSION TO pandora;

-- v$parameter (max sessions)
GRANT SELECT ON V_$PARAMETER TO pandora;

2. Uptime (checkUptime)

-- v$session (PMON process start time)
GRANT SELECT ON V_$SESSION TO pandora;

3. Query Stats (queryStats)

-- v$sqlstats (SQL execution counters)
GRANT SELECT ON V_$SQLSTATS TO pandora;

4. Tablespaces (checkTablespaces)

-- dba_tablespace_usage_metrics (Oracle 10g+)
GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO pandora;

-- dba_tablespaces (status)
GRANT SELECT ON DBA_TABLESPACES TO pandora;

-- dba_data_files (size calculation, Oracle < 10g fallback)
GRANT SELECT ON DBA_DATA_FILES TO pandora;

-- dba_free_space (size calculation, Oracle < 10g fallback)
GRANT SELECT ON DBA_FREE_SPACE TO pandora;

5. Fragmentation Ratio (checkFragmentation)

-- dba_tables (table stats for fragmentation)
GRANT SELECT ON DBA_TABLES TO pandora;

6. Cache Stats (checkCache)

-- v$librarycache
GRANT SELECT ON V_$LIBRARYCACHE TO pandora;

-- v$rowcache
GRANT SELECT ON V_$ROWCACHE TO pandora;

-- v$sysstat
GRANT SELECT ON V_$SYSSTAT TO pandora;

7. Multitenant / PDB Monitoring (multitenant)

-- v$pdbs (PDB discovery)
GRANT SELECT ON V_$PDBS TO pandora;

Additionally, the monitoring user must have CREATE SESSION on each PDB to be monitored. Connect to each PDB and run:

ALTER SESSION SET CONTAINER = <PDB_NAME>;
GRANT CREATE SESSION TO pandora;
-- Granular PDB-level grants (e.g. v$session, dba_tablespaces, etc.)
-- must also be granted inside each PDB.

Note: When multitenant is enabled, the plugin connects directly to each PDB using HOST:PORT/PDB_NAME, so the user must exist and have the necessary grants in every PDB.

8. Custom Queries (executeCustomQueries)

Permissions depend entirely on the user-defined queries. Grant SELECT on any additional tables/views the custom queries reference.


EN — Quick Setup (All Modules)

For convenience, grant SELECT_CATALOG_ROLE which covers most V$ and DBA_ views:

-- In CDB (container database)
CREATE USER pandora IDENTIFIED BY <password>;
GRANT CREATE SESSION TO pandora;
GRANT SELECT_CATALOG_ROLE TO pandora;

-- In each PDB (if using multitenant)
ALTER SESSION SET CONTAINER = <PDB_NAME>;
-- If user already exists via CDB common user:
GRANT CREATE SESSION TO pandora;
GRANT SELECT_CATALOG_ROLE TO pandora;

Minimal Granular Alternative

If SELECT_CATALOG_ROLE is too broad, use this block:

CREATE USER pandora IDENTIFIED BY <password>;
GRANT CREATE SESSION TO pandora;

-- Dynamic performance views
GRANT SELECT ON V_$SESSION TO pandora;
GRANT SELECT ON V_$SQLSTATS TO pandora;
GRANT SELECT ON V_$PARAMETER TO pandora;
GRANT SELECT ON V_$LIBRARYCACHE TO pandora;
GRANT SELECT ON V_$ROWCACHE TO pandora;
GRANT SELECT ON V_$SYSSTAT TO pandora;
GRANT SELECT ON V_$PDBS TO pandora;

-- DBA views
GRANT SELECT ON DBA_TABLESPACES TO pandora;
GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO pandora;
GRANT SELECT ON DBA_DATA_FILES TO pandora;
GRANT SELECT ON DBA_FREE_SPACE TO pandora;
GRANT SELECT ON DBA_TABLES TO pandora;

-- Version info
GRANT SELECT ON PRODUCT_COMPONENT_VERSION TO pandora;

EN — Summary Table

Module Token Oracle View/Table
checkConnections V$SESSION, V$PARAMETER
checkUptime V$SESSION
queryStats V$SQLSTATS
checkTablespaces DBA_TABLESPACE_USAGE_METRICS, DBA_TABLESPACES, DBA_DATA_FILES, DBA_FREE_SPACE
checkFragmentation DBA_TABLES
checkCache V$LIBRARYCACHE, V$ROWCACHE, V$SYSSTAT
multitenant V$PDBS + CREATE SESSION on each PDB
executeCustomQueries Depends on user queries

* Only needed for Oracle <= 10g fallback query. Oracle 11g+ uses DBA_TABLESPACE_USAGE_METRICS.