五,Metricbeat监控服务器状态

五,Metricbeat监控服务器

在客户端服务器安装metricbeat软件
rpm -ivh metricbeat-7.2.0-x86_64.rpm

修改/etc/metricbeat/metricbeat.yml配置文件,设置输出到logstash

output.logstash:
  # The Logstash hosts
  hosts: ["192.168.1.223:5044"]

/etc/metricbeat/modules.d/目录下有很多监控模块,这里只用到system这个模块,更多模块可参考ELK官网
修改/etc/metricbeat/modules.d/system.yml配置文件

- module: system #模块名称
  period: 10s
  metricsets: #监控项
    - cpu
    - load
    - memory
    - network
    - process
    - process_summary
    - socket_summary
    - core
    - diskio
    - socket
  process.include_top_n:
    by_cpu: 5      # include top 5 processes by CPU
    by_memory: 5   # include top 5 processes by memory
- module: system
  period: 1m
  metricsets:
    - filesystem
    - fsstat
  processors:
  - drop_event.when.regexp:
      system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'
- module: system
  period: 15m
  metricsets:
    - uptime

kibana中查看通过metricbeat收集的服务器监控图表
打开kibana,点击仪表盘-->System-Dashboard

dash2

打开kibana,点击仪表盘-->Host-Dashboard
dash2

你可能感兴趣的:(五,Metricbeat监控服务器状态)