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

Component Checks & agents
Title oracle_sql: New check for monitoring custom SQLs
Date Jan 22, 2019
Checkmk Version 1.6.0b1
Level Trivial Change
Class New Feature
Compatibility Compatible - no manual interaction needed
Affected Editions
1.6.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

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.

To the list of all Werks