Parameters and configuration
Parameters
--conf | Path to the configuration file. |
--target_databases | Path to the configuration file containing database targets. |
--target_agents | Path to the configuration file containing agent targets. |
--custom_queries | Path to the configuration file containing custom queries. |
The configuration file (--conf)
agents_group_id: The ID of the group where agents will be created.
interval: The monitoring interval for agents in seconds.
user: The connection user.
password: The password for the user.
threads: The number of threads 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.
engine_uptime: Activate with 1 to enable runtime monitoring.
query_stats: Activate with 1 to enable query statistics monitoring.
Example
agents_group_id = 10
interval = 300
user = sa
password = HHgD85V@
threads = 1
modules_prefix =
execute_custom_queries = 1
analyze_connections = 1
engine_uptime = 1
query_stats = 1
The file content for "--target_databases" should consist of a list of target databases, with each database separated by commas or lines. The format for each database can be any of the following:
ip
ip:puerto
ip\instancia
Example
172.17.0.4:1433\DEVENV
172.17.0.2:1433\PRODENV
The file content for "--target_agents"
should consist of 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. This ensures that the information is correctly associated with the desired agents.
Example
agente1,,agente3
agente4
agente5,agente6,agente7,,agente9
Custom queries (--custom_queries)
should be specified as modules that you want to monitor. These modules should follow a specific structure, which is as follows:
check_begin: Module opening tag.
name: Module name.
description: Module description.
operation: Type of operation.
datatype: Module data type.
min_warning: Minimum warning threshold configuration.
max_warning: Maximum warning threshold configuration.
str_warning: Warning string configuration.
warning_inverse: Activate inverse interval with 1 for warning threshold.
min_critical: Minimum critical threshold configuration.
max_critical: Maximum critical threshold configuration.
str_critical: Critical string configuration.
critical_inverse: Activate inverse interval with 1 for critical threshold.
module_interval: This interval is calculated as a multiplier of the agent's interval.
target: Custom query.
target_databases: Database agents for which the module will be created.
check_end: Module closing tag.
Example
check_begin
name Select 1
description Number of invalid objects
operation value
datatype generic_data
min_warning 5
target SELECT 1;
target_databases all
check_end
check_begin
name NumeroConexiones
description Number of connections
operation value
datatype generic_data
min_warning 10
target SELECT COUNT(*) AS NumeroConexiones FROM sys.dm_exec_sessions WHERE is_user_process = 1;
target_databases pandora
check_end
check_begin
name lista_table_size.MB
description table size in MB
operation full
datatype generic_data
target SELECT SUM(reserved_page_count) * 8 / 1024.0 AS TamañoMB FROM sys.dm_db_partition_stats WHERE object_id = OBJECT_ID('lista');
target_databases pandora
check_end