Enabling module configs in the modules.d directory

The modules.d directory contains default configurations for all the modules that are available in Metricbeat. The configuration that's specific to a module is stored in a .yml file, with the name of the file being the name of the module. For example, the configuration related to the MySQL module will be stored in the mysql.yml file. By default, except for the system module, all other modules are disabled. To list the modules that are available in Metricbeat, execute the following command:

Windows:
E:metricbeat-7.0.0-windows-x86_64>metricbeat.exe modules list

Linux:
[locationOfMetricBeat]$./metricbeat modules list

The modules list command displays all the available modules and also lists which modules are currently enabled/disabled. 

If a module is disabled, then in the modules.d directory, the configuration related to the module will be stored with the .disabled extension.

Since each module comes with default configurations, make the appropriate changes in the module configuration file.

The basic configuration for the mongodb module will look as follows:

- module: mongodb
metricsets: ["dbstats", "status"]
period: 10s
hosts: ["localhost:27017"]
username: user
password: pass

To enable it, execute the modules enable command, passing one or more module names. For example:

Windows:
E:metricbeat-7.0.0-windows-x86_64>metricbeat.exe modules enable redis mongodb

Linux:
[locationOfMetricBeat]$./metricbeat modules enable redis mongodb

Similar to disabling modules, execute the modules disable command, passing one or more module names to it. For example: 

Windows:
E:metricbeat-7.0.0-windows-x86_64>metricbeat.exe modules disable redis mongodb

Linux:
[locationOfMetricBeat]$./metricbeat modules disable redis mongodb
To enable dynamic config reloading, set reload.enabled to true and specify a frequency with which to look for config file changes. Set the reload.period parameter under the metricbeat.config.modules property.

For example:

#metricbeat.yml
metricbeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: true
reload.period: 20s
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.219.78