`stub_status` and backend question

My issue:
TCP expect network error: cannot connect to [[localhost]:5555]: [111] Connection refused

How I encountered the problem:
I am trying to monitor nginx_status stub using zabbix. After much investigation, I created a seperate nginx_status.conf file and placed it into the /etc/nginx/conf.d/nginx_status.conf

If I run curl the following
curl http://localhost:5555/nginx_status

I get a status report. shown below.
Active connections: 1
server accepts handled requests
1452 1452 1439
Reading: 0 Writing: 1 Waiting: 0

but … zabbix is reporting an error that the nginx service is down.
Below is an extract from the zabbix_agentd.log file.

Requested [net.tcp.service[http,“localhost”,“5555”]]
TCP expect network error: cannot connect to [[localhost]:5555]: [111] Connection refused
Sending back [0]

Solutions I’ve tried:
I have tried to place the status stub within the site config file and then it does not work at all. I don’t understand why I am getting a connection refused with status stub when it works on the commandline with curl.

I have read that this might be caused by a backend config missing, but I do not understand this at all.

My config:
/etc/nginx/conf.d/nginx_status.conf

server {
listen 127.0.0.1:5555;
server_name 127.0.0.1;
location = /nginx_status {
stub_status on;
access_log on;
allow 127.0.0.1;
# only allow access from 192.168.1.5 #
allow 192.168.1.31; # Zabbix server access
deny all;
}
}

Hope someone can advise me.
Thanks
Lawrence

I have now managed to resolve this issue.
It had nothing to do with nginx config.
All I had to do was modify the zabbix config to resolve the issue.

Please let me know if you would like to what was done.

Thanks
Lawrence

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.