由於我的情境,只有三台 Host,所以看到的畫面如下圖,三台機器全部列在 Inventory 的列表上,並且即時的顯示 CPU 的使用量,而若是要檢示歷史的數據變化,在最底下有檢示歷史數據的走勢圖。
09-kibana-obs-metrics-inventory
Inventory 的分群與搜尋檢示
Inventory 預設的檢示畫面其實很陽春,我們可以多透過 Group by 的功能,來使用像是 Service type 或甚至自己定義的欄位也可以用來 Group by,只要是 index 裡面有收集到的資訊,都可以使用,所以先前所建議我們可以使用 Tags、Fields 等自訂義的欄位,就能派上用場。
09-kibana-obs-inventory-group-by
使用 Service type Group By 之後的結果如下,可以更快速的專注在某一塊要觀察的主題上。
- module: system
period: 10s
metricsets:
- cpu
- load
- memory
- network
- process
- process_summary
- socket_summary
# - entropy
# - core
# - diskio
# - socket
# - service
# - users
process.include_top_n:
by_cpu: 5 # include top 5 processes by CPU
by_memory: 5 # include top 5 processes by memory
# Configure the mount point of the host’s filesystem for use in monitoring a host from within a container
#system.hostfs: "/hostfs"
- 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
./metricbeat enable postgresql
- module: postgresql
metricsets:
# Stats about every PostgreSQL database
- database
# Stats about the background writer process's activity
- bgwriter
# Stats about every PostgreSQL process
- activity
period: 10s
hosts: ["postgres://localhost:5432?sslmode=disable"]
username: postgres
password: _PASSWORD_
./metricbeat enable redis
- module: redis
metricsets:
- info
- key
- keyspace
period: 10s
# Redis hosts
hosts: ["127.0.0.1:6379"]
# Network type to be used for redis connection. Default: tcp
#network: tcp
# Max number of concurrent connections. Default: 10
#maxconn: 10
# Redis AUTH password. Empty by default.
#password: foobared
key.patterns:
- pattern: 'pipeline-*'
limit: 20