Parameters and configuration
Parameters
| --conf | Path to the configuration file. |
| --target_databases | Path to the configuration file containing the database targets. |
| --target_agents | Path to the configuration file containing the agent targets. |
| --custom_queries | Path to the configuration file containing custom queries. |
Configuration file (--conf)
agents_group_id = < The ID of the group where agents will be created. >
interval = < The agent monitoring interval in seconds. >
user = < The connection username. >
password = < The password for the user. >
threads = < The number of threads to be used for agent creation. >
modules_prefix = < The prefix for module names. >
execute_custom_queries = < Activate with 1 to enable the use of custom queries. >
analyze_connections = < Activate with 1 to enable connection monitoring. >
database_summary = < Activate with 1 to enable database stats >
transactional_log = < Activate with 1 to enable log stats >
db_size = < Activate with 1 to enable database size stats >
cache_stats = < Activate with 1 to enable cache statistics monitoring. >
Example
agents_group_id = 10
interval = 300
user = sa
password = HHgD85V@
threads = 1
modules_prefix =
execute_custom_queries = 1
analyze_connections = 1
database_summary = 1
transactional_log = 1
db_size = 1
cache_stats = 1
List of target databases (--target_databases):
The content of the file should be a list of target databases, with each database separated by commas or lines. The format for a database can be any of the following:
ip/sid
ip:puerto/sid
If the port is not specified, the default TCP port 50000 will be used for connecting to the target.
Example:
172.17.0.2:50000/SAMPLE
Each line in the file should represent a separate target database using one of these formats. This file is used to specify the databases that the plugin should monitor.
List of target agents (--target_agents):
The content of the file should be a list of agent names, with each agent separated by commas or lines. These agent names will be used to associate the information from each target database with the corresponding specified agent name, instead of letting the plugin generate agent names automatically.
The position of each agent name in the list should match the position of the target database in its own list. In other words, the name for the first target database should be the first name in this list, considering that blank lines are ignored.
Example:
agente1,,agente3
agente4
agente5,agente6,agente7,,agente9
Custom Queries (--custom_queries)
One module must be defined for each custom query to be monitored. Modules must follow this structure:
check_begin --> Module opening tag
name --> Module name
description --> Module description.
operation --> Operation type: value (returns a single value) | full (returns all rows as string).
datatype --> Module type: generic_data | generic_data_string | generic_proc.
min_warning --> Minimum warning threshold
max_warning --> Maximum warning threshold
str_warning --> Warning string threshold
warning_inverse --> Set to 1 to invert the warning threshold interval
min_critical --> Minimum critical threshold
max_critical --> Maximum critical threshold
str_critical --> Critical string threshold
critical_inverse --> Set to 1 to invert the critical threshold interval
module_interval --> This interval is calculated as a multiplier of the agent interval.
crontab --> 5-field cron expression (minute, hour, day of month, month, day of week).
The query only runs when the current date/time matches the expression.
If not specified, the query runs on every interval.
Format: crontab <minute> <hour> <day_of_month> <month> <day_of_week>
Examples:
* * * * * → every minute (always)
0 9 * * 1-5 → Monday to Friday at 09:00
*/15 * * * * → every 15 minutes
* 12-15 * * 1 → Mondays between 12:00 and 15:59
target --> Custom query (only SELECT statements are allowed).
target_databases --> Database agents where the module will be created.
To apply to all elements, specify "all" or leave it unspecified.
check_end --> Module closing tag
Basic module (no crontab, runs on every interval)
check_begin
name Select 1
description
operation value
datatype generic_data
min_warning 5
target VALUES (1);
target_databases all
check_end
Module against a specific database
check_begin
name sace_controlators.total_registers
description Number of registros in sace_controlators table
operation value
datatype generic_data
min_warning 20
target SELECT COUNT(*) AS TotalRegistros FROM schema.sace_controlators;
target_databases pandora
check_end
Full operation module
check_begin
name operators.max_value.sace_controlators
description max value in column operators
operation full
datatype generic_data
target SELECT MAX(operators) AS MaxValue FROM schema.sace_controlators;
target_databases pandora
check_end
Module with crontab (runs only Monday to Friday at 09:00)
check_begin
name daily_report
description Daily report query
operation value
datatype generic_data
target SELECT COUNT(*) AS records FROM schema.process_log WHERE date = CURRENT DATE;
target_databases all
crontab 0 9 * * 1-5
check_end
Module with crontab (only during office hours 8:00–18:00)
check_begin
name active_office_connections
description Active connections during office hours
operation value
datatype generic_data
target SELECT COUNT(*) FROM SYSIBMADM.MON_CONNECTION_SUMMARY;
target_databases all
crontab * 8-17 * * 1-5
check_end
Module with crontab every 30 minutes
check_begin
name check_every_half_hour
description Check every 30 minutes
operation value
datatype generic_data
target SELECT COUNT(*) FROM SYSIBMADM.SNAPLOCKWAIT;
target_databases all
crontab */30 * * * *
check_end
Crontab filter behavior
- At the beginning of each plugin execution, all custom queries are evaluated.
- Queries without the
crontabfield always run (classic behavior, backward compatible). - Queries with
crontabare only included if the current date/time matches the cron expression. - Queries rejected by crontab do not generate database connections or SQL queries.
- The filter runs once before spawning monitoring threads.
Cron expression format
The expression follows the standard 5-field format separated by spaces:
| Field | Allowed values |
|---|---|
| Minute | 0-59 |
| Hour | 0-23 |
| Day of month | 1-31 |
| Month | 1-12 |
| Day of week | 0-7 (0 and 7 = Sunday, 1 = Monday) |
Each field supports the following formats:
*— any valueN— exact value (e.g.5)N-M— range (e.g.9-17)*/N— every N units (e.g.*/15= every 15 minutes)N-M/N— range with step (e.g.0-30/10= 0, 10, 20, 30)A,B,C— comma-separated list of values