Skip to main content

Parameters and configuration

Parameters

--conf Path to 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 the modules with custom queries


Configuration file (--conf)

agents_group_id = < ID of the group in which the agents will be created >
interval = < Agent monitoringMonitoring interval for agents in seconds >
uri = < Connection string in URI format >
threads = < Number of threads to usebe used for agent creation >
module_prefixscan_databases = <Modules Set to 1 to enable this token to monitor the databases of the configured instances >
agent_per_database = < Set to 1 to enable this token to monitor the databases of the configured instances. >
db_agent_prefix = <  Prefix for the database agents created. >
modules_prefix = < Prefix for created modules >
execute_custom_queries = < ActivateSet withto 1 to enable the use of custom queries.queries >
analyze_connections = < EnableSet withto 1 to enable connection monitoring >
engine_uptime = <Enable withSet to 1 to enable runtime monitoring >
query_stats = < EnableSet withto 1 to enable query statistics monitoring >
network = < ActivateSet withto 1 to enable network statistics monitoring >
latency = < EnableSet withto 1 to enable latency statistics monitoring >

Example

agents_group_id = 10
interval = 300
uri = mongodb://172.17.0.3:27017
threads = 1
modules_prefix = Mongodb.
scan_databases = 1
agent_per_database = 1
db_agent_prefix = Mongodb.
execute_custom_queries = 1
analyze_connections = 1
network = 1
query_stats = 1
latency = 1
engine_uptime = 1

List of target databases (--target_databases)

The file content of the file will be a list of target databases,instances, separating each databaseinstance by commas or lines. The formatconnection URI for aeach databaseone willmust be its name:specified.

Example

adminmongodb://172.17.0.2:27017
db_analytics
db_geospatial
db_guidesmongodb://172.17.0.7:27017

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 lines. These agent names will be used to dump the information from each target database into the corresponding indicated agent name, rather than 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, that is, 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      --> ModuleOpening openingtag labelof the module  
name             --> ModuleName nameof the module  
description      --> ModuleDescription description.of the module.  
operation        --> OperationType type,of operation, value | full -> value returns a simplesingle value, full returns all rows inof a string  
datatype         --> Module data type  
min_warning      --> Minimum warning threshold settingconfiguration  
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 settingconfiguration  
max_critical     --> Maximum critical threshold configuration  
str_critical     --> Critical string configuration  
critical_inverse --> ActivateEnable inverse interval with 1 for critical threshold  
module_interval  --> This interval is calculated as a multiplier of the agent interval.  
target           --> Custom query  
target_instances --> Custom queries will be executed on the databases belonging to the instances configured here. If not specified, all will be monitored, same as specifying "all". To select one or several specific ones, separate them with ","  
target_databases --> DatabaseCustom agents in which the modulequeries will be created.executed Select according toon the namedatabases thatconfigured hashere. beenIf assignednot tospecified, theall databasewill agent.be Themonitored, same as specifying "all". To select one thator hasseveral beenspecific putones, inseparate targetthem agents.with ","  
check_end        --> ModuleClosing closingtag label.of the module  


Example

check_begin
name DatabaseStats
description Database statistics
operation value
datatype generic_data
target db.runCommand({ dbStats: 1 })
target_instances mongodb://172.17.0.2:27017
target_databases allpandora_db, pandora_db2
check_end

check_begin
name Getcollection
description get collection
datatype generic_data_string
min_warning 10
target db.system.version.find({})
target_instances all
target_databases agent2all
check_end

check_begin
name Getdocument
description get document
#operation value
datatype generic_data_string
min_warning 10
target db.mi_coleccion.find({ "_id": ObjectId("655b4a235d797f3769d6b03e") })
target_databases agent4
check_end

Queries for the target parameter of the modules

Commands can be executed according to the following format:

db.runCommand(< command >)

or

runCommand(< command >)

To know the expected response, to configure the type of module in string or data as required.


As a precaution only the following type of commands will be executed : dbStats,collStats,find,cound,aggregate,listCollections

Find queries can be run to obtain data from collections and documents:

db.< collection >.find({})

or

< collection >.find({})

With the possibility of specifying queries within the find method:

db.< collection >.find({ "<key document": "value" })

Example:

db.mi_collection.find({ "_id": ObjectId("655b4a235d797f3769d6b03e") })