Paremeters and configuration
Parameters
--conf | Path to configuration file |
--target_databases | Path to the list of target databases to be monitored |
--target_agents | Path to the list of target agents in which to store the target database data. This parameter is optional, and will be used to give custom agent names to the agents generated by the plugin. |
--custom_queries | Path to the file with the definition of customized queries to the target databases. This parameter is optional and each query performed will correspond to a module. |
Configuration file (--conf)
The contents of the file will be as follows:
agents_group_id = < ID of the group in which the agents will be created >
interval = < Agents monitoring interval in seconds >
user = < Login user >
password = < Password >
threads = < Number of threads to be used for agent creation >
modules_prefix = < Module prefix >
execute_custom_queries = < Activate with 1 to enable the use of custom queries >
scan_databases = < Enable with 1 to monitor all databases on the server >
agent_per_database = < Enable with 1 to create an agent for each database found in the targets to be monitored >
db_agent_prefix = < Prefix to be included in the name of each agent created for each database found in the targets to be monitored >
analyze_connections = < Activate with 1 to enable connection monitoring >
engine_uptime = < Activate with 1 to enable the monitoring of the execution time >
query_stats = < Enable with 1 to enable query statistics monitoring >
innodb_stats = < Enable with 1 to enable innodb statistics monitoring >
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
engine_uptime = 1
query_stats = 1
innodb_stats = 1
cache_stats = 1
scan_databases = 1
agent_per_database = 1
db_agent_prefix = mysql.
List of target databases (--target_databases)
The content of the file will be a list of target databases, separating each database by commas or by lines. The format for a database can be any of the following:
ip:port
ip
En caso de no indicarse el puerto, se usará el puerto 3306 TCP por defecto para la conexión al objetivo.
Example:
172.17.0.2, 172.17.0.3
172.17.0.4:3306
List of target agents (--target_agents)
The content of the file will be a list of agent name bases, separating each agent by commas or by lines. These agent names will be used to dump the information from each target database into the corresponding indicated agent name, instead of letting the plugin generate the agent names automatically.
The position of each agent name in the listing must match the position of the target database in its own listing, i.e. the name for the first target database will be the first name in this listing, taking into account that blank lines are ignored.
Example:
agente1,,agente3
agente4
agente5,agente6,agente7,,agente9
Custom queries (--custom_queries)
A module must be entered for each custom query to be monitored. The modules must follow a structure, which is as follows:
check_begin --> Module opening label
name --> Module name
description --> Module description.
operation --> Operation type
datatype --> Module type
min_warning --> Minimum warning threshold setting
max_warning --> Maximum warning threshold configuration
str_warning --> Warning string configuration
warning_inverse --> Enable inverse interval with 1 for warning threshold
min_critical --> Minimum critical threshold setting
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 interval.
target --> Custom query
target_databases --> Database agents in which the module will be created.
check_end --> Module's closing tag.
In case monitoring of each database within the target MySQL servers is enabled, custom queries will be launched for each of those databases. In such cases, it is possible to reference the database in use with the variable "$__self_dbname".
Example:
check_begin
name Select 1 $__self_dbname
description Number of invalid objects
operation value
datatype generic_data
min_warning 5
target SELECT 1;
target_databases all
check_end
check_begin
name Agents count in $__self_dbname
description Number of invalid objects
operation value
datatype generic_data
min_warning 5
target SELECT COUNT(*) FROM $__self_dbname.tagente;
target_databases pandora
check_end
check_begin
name Agents in $__self_dbname
description Invalid objects (detail)
operation full
datatype generic_data
target SELECT id_agente, nombre FROM $__self_dbname.tagente limit 10;
target_databases pandora
check_end