We use cookies to ensure that we give you the best experience on our website.  Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

Werk #7095: oracle_sql: New check for monitoring custom SQLs

ComponentChecks & Agents
Titleoracle_sql: New check for monitoring custom SQLs
Date2019-01-22 16:18:26
Checkmk EditionCheckmk Raw Edition (CRE)
Checkmk Version1.6.0b1
LevelTrivial Change
ClassNew Feature
CompatibilityCompatible - no manual interaction needed

The mk_oracle allows the execution of parametrizable custom SQLs. Note that the following configuration is not bakeable.

First of all you have to register sections and configure their options. This can be done in the mk_oracle.cfg via SQLS_SECTIONS=sec_a,... sec_a () { #OPTIONS }

In general there are two types of check plugins which handle the output of the custom SQLs:

  1. oracle_sql for generic custom SQLs
  2. own check plugins if SQLS_SECTION_NAME is used (see below)

The following configuration variables can be stated globally or locally (within a section definition; this overwrites the global variable). SQLS_SIDS=sid1,sid2,... (comma separated) SQLS_DIR=/path/to/dir (no trailing '/') SQLS_SQL=name.sql (the SQL name which must exist in SQLS_DIR) SQLS_PARAMETERS=params (parameters as string, double quotes are removed) SQLS_MAX_CACHE_AGE=X (x in seconds) SQLS_SECTION_NAME=sec_name (optional, for own check plugins; if not stated, 'oracle_sql' is used; generic check plugin) SQLS_SECTION_SEP=separator (optional; only useful if SQLS_SECTION_NAME is stated; ASCII code, eg. '58' means ':')

  • {{SQLS_SIDS}: For which SIDs the SQL is executed.
  • SQLS_DIR: The folder of the SQLs.
  • SQLS_SQL: The SQL name within SQLS_DIR.
  • SQLS_PARAMETERS: Declare parameters if needed. Mostly they are declare within double quotes. In this case you have to escape them if yu need them as characters within the parameters.
  • SQLS_MAX_CACHE_AGE: How long the cached data is recent enough.
  • SQLS_SECTION_NAME: The output of the SQL is stored below this section. That means you have to build your own check plugin.
  • SQLS_SECTION_SEP: At which character the output is separated.

If the generic oracle_sql section header is used then the item within the custom SQL service can be influenced by SQLS_ITEM_NAME: SQLS_ITEM_NAME=item_name (optional, if not stated, sql name is used) Otherwise the SQL name SQLS_SQL is used.