From 1afeb3955e8acbaadf4918893ed815e23a3f0c17 Mon Sep 17 00:00:00 2001 From: lolieatapple <54833180+lolieatapple@users.noreply.github.com> Date: Fri, 22 Jan 2021 17:38:59 +0800 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index d917e73..0ccd8e8 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,39 @@ sudo metricbeat modules enable XXXXX sudo systemctl restart metricbeat ``` + +Config for nginx + +``` +$ sudo metricbeat modules enable nginx + +$ sudo vi /etc/metricbeat/modules.d/nginx.yml + +# Module: nginx +# Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.8/metricbeat-module-nginx.html + +- module: nginx + metricsets: + - stubstatus + period: 10s + + # Nginx hosts + hosts: ["http://127.0.0.1"] + + # Path to server status. Default server-status + server_status_path: "nginx_status" + + #username: "user" + #password: "secret" +``` +$ sudo vi /etc/nginx/sites-enabled/default + + server_name _; + location /nginx_status { + stub_status on; + access_log off; + allow 127.0.0.1; + deny all; + } + +