Check-Manual von oracle_instance

Oracle Instance: Status of Database

Distribution Official part of Checkmk
Lizenz GPLv2
Unterstützte Agenten Linux AIX Hpux Solaris Windows
This check monitors the state of an Oracle Instance. The check depends on the state of the database.

The database must be a Primary Database and OPEN (startup in sqlplus) or a Physical Standby Database and OPEN or MOUNTED. The state is CRITICAL when this is not true.

The archive logmode, logging option, logins and uptime are also checked: the state is WARNING when the Database is in NOARCHIVELOG or in ARCHIVELOG and FORCE LOGGING is disabled. The state is CRITICAL when logins are not possible. This behaviour can be changed with rules. The rule for logins is only working when the connection is established with 'sysdba'. Otherwise the rule for logins is always CRITICAL.

This check requires the new agent plug-in mk_oracle from our plug-in directory.

You can find a description for a basic configuration below. More details for special setups will be available on the homepage of the Checkmk project. https://mathias-kettner.de/checkmk_oracle.html

There are two configuration files important and stored in $MK_CONFDIR. sqlnet.ora is a static file and is essential for the connection to the database. It is also used to disable trace. Otherwise the oracle client might create a lot of trace data in $HOME of the root user and may fill the '/' filesystem.

Notes about CDB support in mk_oracle: All PDBs from CDB change to pending state when CDB is not OPEN, to minimize state changes for all instance checks. A '$' is removed in the service name. pdb$seed is translated to pdbseed to prevent problems due to '$' in service names. The check ignores the fact that the pdb$seed is in read only mode.

mk_oracle.cfg is the main configuration file for the plugin. Most importantly, it contains the credentials for the connection to the database. The ':' is used as a field separator in each line defining the credentials. , and are optional: per default is empty, Host=localhost and Port=1521. Host and Port depends on the Listener configuration of the database. DBUSER is used as a default for all Instances on the Host. This default could be replaced for each Instance with a DBUSER_ entry. ASMUSER is a special entry for an Oracle ASM Instance. ASM needs a 'sysdba' or 'asmsnmp' entry because this instance is not OPEN. There is no ASMUSER_ entry!

ASMUSER=::::

DBUSER=::::

DBUSER_=::::

The configuration of a normal Instance is very easy. An example for ASM follows afterwards below.

Example for nen CDB (old) databases:

sqlplus / as sysdba

create user check_mk identifiebd by checkmk;

grant connect, select_catalog_role to check_mk;

Example for CDB databases: The prefix C## is only allowed in CDB environments. Don't use it for old databases!

create user c##check_mk identified by "secret"; alter user c##check_mk set container_data=all container = current; grant create session, select_catalog_role to c##check_mk container=all;

An additional grant for a configuration to a Physical Standby Database is mandatory when the Standby is not running in OPEN mode. In most setups, the Standby is running in MOUNT state requiring a 'SYSDBA' connection due to the closed Data Dictionary. This grant is needed on the Primary as well. Otherwise mk_oracle is not able to monitor the Instance after a role change on the old Primary.

non CDB:

grant sysdba to check_mk;

CDB:

grant sysdba to c##check_mk;

Example for ASM:

An ASM Instance does not have a data dictionary. This is why a sysdba or asmsnmp connection is required. Oracle changed the security in Release 11.1. The connection with sqlplus must be carried out with 'as sysasm'. Older versions are working like a normal Instance requiring a 'as sysdba' connection. There is no requirement to create a new user for mk_oracle. You cold use the existent default user asmsnmp.

sqlplus / as sysasm

create user check_mk identifiebd by checkmk;

grant sysdba to check_mk;

There is no ASM Instance Check at the moment. The configuration is needed for the other checks.

More details can be found in the documentation in https://mathias-kettner.de/checkmk_oracle.html

Item

The ORACLE_SID

Discovery

One service is created for each running database.