Caleb0 2020-05-08
下载并解压缩metricbeat
metricbeat.yml配置文件设置:
setup.kibana: host: "192.168.75.21:5601" output.elasticsearch: hosts: ["192.168.75.21:9200"]
查看metircbeat开启的模块:./metricbeat modules list
,发现默认开启监控的是system模块
可以通过文件./modules.d/system.yml
查看监控的详细信息等
拓展:
开启模块:./metricbeat modules enable 模块名
关闭模块:./metricbeat modules disenable 模块名
加载dashboards:./metricbeat setup
运行:./metricbeat -e
查看kibana面板:
开启模块:./metricbeat modules enable nginx
修改./modules.d/nginx.yml
文件
- module: nginx metricsets: - stubstatus period: 10s # Nginx hosts hosts: ["http://192.168.75.21"] # 根据实际情况修改 # Path to server status. Default server-status server_status_path: "server-status" # 根据实际情况修改,跟nginx.conf中相匹配 #username: "user" #password: "secret"
nginx.conf中关于stubstatus的配置:
http { ...... location /server-status { stub_status on; access_log /var/log/nginx/nginxstatus.log; } ...... }
再次加载dashboards:./metricbeat setup
关闭并重新运行:./metricbeat -e
浏览器查看nginx状态
查看kibana面板: