• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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