-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
###################### Metricbeat Configuration Example ####################### | ||
|
||
# This file is an example configuration file highlighting only the most common | ||
# options. The metricbeat.reference.yml file from the same directory contains all the | ||
# supported options with more comments. You can use it as a reference. | ||
# | ||
# You can find the full configuration reference here: | ||
# https://www.elastic.co/guide/en/beats/metricbeat/index.html | ||
|
||
#========================== Modules configuration ============================ | ||
|
||
metricbeat.config.modules: | ||
# Glob pattern for configuration loading | ||
path: ${path.config}/modules.d/*.yml | ||
|
||
# Set to true to enable config reloading | ||
reload.enabled: false | ||
|
||
# Period on which files under path should be checked for changes | ||
#reload.period: 10s | ||
|
||
#================================ Outputs ===================================== | ||
|
||
# Configure what output to use when sending the data collected by the beat. | ||
|
||
#-------------------------- Elasticsearch output ------------------------------ | ||
output.elasticsearch: | ||
# Array of hosts to connect to. | ||
hosts: ["https://cloud.denbi.de:443"] | ||
allow_older_versions: true | ||
|
||
|
||
# Optional protocol and basic auth credentials. | ||
protocol: https | ||
path: /elasticsearch/ | ||
headers: | ||
HOST: 'cloud.denbi.de' | ||
username: ${METRICBEAT_USER} | ||
password: ${METRICBEAT_PASSWORD} | ||
|
||
|
||
#================================= Migration ================================== | ||
|
||
# This allows to enable 6.7 migration aliases | ||
#migration.6_to_7.enabled: true | ||
|
||
metricbeat.modules: | ||
- module: docker | ||
metricsets: | ||
- "container" | ||
- "cpu" | ||
- "diskio" | ||
- "event" | ||
- "healthcheck" | ||
- "info" | ||
- "memory" | ||
- "network" | ||
hosts: ["unix:///var/run/docker.sock"] | ||
period: 45s | ||
enabled: true | ||
- module: system | ||
metricsets: | ||
- cpu # CPU usage | ||
- load # CPU load averages | ||
- memory # Memory usage | ||
- network # Network IO | ||
- process # Per process metrics | ||
- process_summary # Process summary | ||
- uptime # System Uptime | ||
- socket_summary # Socket summary | ||
- core # Per CPU core usage | ||
- diskio # Disk IO | ||
- filesystem # File system usage for each mountpoint | ||
- fsstat # File system summary metrics | ||
enabled: true | ||
period: 60s | ||
processes: ['.*'] | ||
|
||
# Configure the metric types that are included by these metricsets. | ||
cpu.metrics: ["percentages"] # The other available options are normalized_percentages and ticks. | ||
core.metrics: ["percentages"] # The other available option is ticks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[Service] | ||
Restart=on-failure | ||
RestartSec=20 | ||
StartLimitIntervalSec=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
- name: Setup metricbeat | ||
hosts: all | ||
become: yes | ||
vars_files: | ||
- setup_metricbeat_variables.yml | ||
- ../general_variables.yml | ||
|
||
tasks: | ||
|
||
- name: Download and install metricbeat.deb | ||
apt: | ||
deb: "{{ metricbeat.DOWNLOAD_URL }}" | ||
tags: [ 'metricbeat' ] | ||
|
||
- name: Copy metricbeat config file | ||
copy: | ||
src: "{{ general.REPO_PATH }}plays/metricbeat/metricbeat.yml" | ||
dest: "{{ metricbeat.CONFIG_FILE_PATH }}/metricbeat.yml" | ||
remote_src: True | ||
tags: [ 'production', 'dev', 'post-release', 'never' ] | ||
|
||
- name: Create metricbeat dropin dir | ||
file: | ||
state: directory | ||
path: "{{ metricbeat.OVERRIDE_CONFIG_PATH }}" | ||
recurse: yes | ||
tags: [ 'metricbeat' ] | ||
|
||
- name: Copy metricbeat override config file | ||
copy: | ||
src: "{{ general.REPO_PATH }}plays/metricbeat/restart-on-failure.conf" | ||
dest: "{{ metricbeat.OVERRIDE_CONFIG_PATH }}/restart-on-failure.conf" | ||
remote_src: True | ||
tags: [ 'metricbeat' ] | ||
|
||
- name: Just force systemd to reread configs (2.4 and above) | ||
ansible.builtin.systemd: | ||
daemon_reload: yes | ||
tags: [ 'metricbeat' ] | ||
|
||
|
||
- name: Start Metricbeat service | ||
service: | ||
name: metricbeat | ||
state: restarted | ||
tags: [ 'metricbeat' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
metricbeat: | ||
DOWNLOAD_URL: "https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.12.0-amd64.deb" | ||
CONFIG_FILE_PATH: /etc/metricbeat | ||
OVERRIDE_CONFIG_PATH: /etc/systemd/system/metricbeat.service.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters