Hi folks,
We encountered an issue while we trying to collect the nginx metrics from a nginx server via metricbeat, the thing that we installed the newest nginx version
and also enabled nginx status module and setup nginx module correctly in metricbeat.xml. when I enabled debug mode with metricbeat, can't get the nginx module metrics.
It would be appreciated if someone can help on this.
Env:
OS: centOS 6.8
Metricbeat: 5.2.1-1
Nginx:1.10.2
Configure:
/usr/local/nginx/sbin/nginx -V 2>&1 | grep -o with-http_stub_status_module
with-http_stub_status_module
nginx.conf
server {
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
metricbeat.xml
- module: nginx
metricsets: ["stubstatus"]
enabled: true
period: 10s
# Nginx hosts
hosts: ["127.0.0.1"]
# Path to server status. Default server-status
#server_status_path: "nginx-status"
Test:
curl -k http://127.0.0.1/nginx_status
Active connections: 7
server accepts handled requests
125 125 2721
Reading: 0 Writing: 1 Waiting: 6
/usr/share/metricbeat/bin/metricbeat -c /etc/metricbeat/metricbeat.yml >/tmp/nginx
"metricset": {
"host": "127.0.0.1",
"module": "nginx",
"name": "stubstatus",
"rtt": 3630
},
"nginx": {
"stubstatus": {}
},
"type": "metricsets"