• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Resolved How to monitor NGINX stats with Zabbix on Plesk?

dengolius

New Pleskian
Last edited:
It is 3:30am for me and still have to go to sleep...
The answer to you question is quite easy, it's this:

cat /etc/nginx/conf.d/ww010_zabbix.conf
Code:
server {
    listen localhost:61709;

    location / {
        stub_status on;
        access_log off;
        allow 127.0.0.1;
        deny all;
    }
}

I prefer to have it listening only on localhost as it's only needed there.

But putting it through some tests I noticed some flaws
The userparameters for most are incorrect (maybe they were correct 5 years ago). The first one is correct.
Not that difficult to sort out, but will do that tomorrow.

I see no need to pass the address and portnumber, just have it fixed in the zabbix_agentd.conf

The "double-dollar" is incorrect. It would mean the 2nd parameter and you want its literal value there. Also rewrote the cryptic awk (may well have been correct beside the double dollar)

Code:
# NginX Keys
UserParameter=nginx.active,wget -O- -q localhost:61709 | awk '/^Active/ {print $NF}'
UserParameter=nginx.reading,wget -O- -q localhost:61709 | awk '/^Reading/ {print $2}'
UserParameter=nginx.writing,wget -O- -q localhost:61709 | awk '/^Reading/ {print $4}'
UserParameter=nginx.waiting,wget -O- -q localhost:61709 | awk '/^Reading/ {print $6}'
UserParameter=nginx.accepted,wget -O- -q localhost:61709 | grep -A1 '^server' | tail -n1 | awk '{print $1}'
UserParameter=nginx.handled,wget -O- -q localhost:61709 | grep -A1 '^server' | tail -n1 | awk '{print $2}'
UserParameter=nginx.requests,wget -O- -q localhost:61709 | grep -A1 '^server' | tail -n1 | awk '{print $3}'

I have an XML as well and it's working...
Having more trouble uploading it than creating it...
Do that tomorrow
 
Last edited:
Back
Top