Skip to content

Commit

Permalink
[FEATURE] Enable Metricbeat diskio module (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineserrano authored Oct 26, 2020
1 parent 653462f commit a4c44c6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions EXAMPLE/group_vars/test_aws_euw1/cluster_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ beats_config:
# - /var/log/myapp/*.log
metricbeat:
# output_logstash_hosts: ["localhost:5044"] # The destination hosts for metricbeat-gathered metrics
# diskio: # Diskio retrieves metrics for all disks partitions by default. When diskio.include_devices is defined, only look for defined partitions
# include_devices: ["sda", "sdb", "nvme0n1", "nvme1n1", "nvme2n1"]

## Vulnerability scanners - Tenable and/ or Qualys cloud agents:
cloud_agent:
Expand Down
2 changes: 2 additions & 0 deletions EXAMPLE/group_vars/test_gcp_euw1/cluster_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ beats_config:
# - /var/log/myapp/*.log
metricbeat:
# output_logstash_hosts: ["localhost:5044"] # The destination hosts for metricbeat-gathered metrics
# diskio: # Diskio retrieves metrics for all disks partitions by default. When diskio.include_devices is defined, only look for defined partitions
# include_devices: ["sda", "sdb", "nvme0n1", "nvme1n1", "nvme2n1"]

## Vulnerability scanners - Tenable and/ or Qualys cloud agents:
cloud_agent:
Expand Down
7 changes: 7 additions & 0 deletions config/tasks/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
dest: "/etc/metricbeat/metricbeat.yml"
notify: Metricbeat | Restart and enable metricbeat

- name: Metricbeat | Copy metricbeat system module configuration
become: yes
template:
src: etc/metricbeat/metricbeat_system.yml.j2
dest: "/etc/metricbeat/modules.d/system.yml"
notify: Metricbeat | Restart and enable metricbeat

- name: Metricbeat | Copy metricbeat service
become: yes
template:
Expand Down
37 changes: 37 additions & 0 deletions config/templates/etc/metricbeat/metricbeat_system.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Module: system
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.5/metricbeat-module-system.html

- module: system
period: 10s
metricsets:
- cpu
- load
- memory
- network
- process
- process_summary
- socket_summary
- diskio
#- entropy
#- core
#- socket
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory
{% if (metricbeat.diskio.include_devices is defined and (metricbeat.diskio.include_devices | length)) %}
# Custom diskio settings
diskio.include_devices: {{ metricbeat.diskio.include_devices }}
{% endif %}
- module: system
period: 1m
metricsets:
- filesystem
- fsstat
processors:
- drop_event.when.regexp:
system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/)'

- module: system
period: 15m
metricsets:
- uptime

0 comments on commit a4c44c6

Please sign in to comment.