Moved to another company with no Zabbix and/or Nginx in its environment, hence archiving the repo.
Zabbix Template for Nginx statistics. The script is written in Python.
- HTTP/HTTPS support
- Connection Statistics:
- Active
- Reading
- Waiting
- Writing
- Request Statistics:
- Accepted
- Handled
- Total
- 'Requests Statistics' graph
- 'Connection Status' graph
- Screen combining both graphs
- Version information
{$NGINX_HOST}
and{$NGINX_PORT}
macros for customization
Add the following to your default vhost configuration file:
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
allow <external host IP>;
deny all;
}
-
Copy
userparameter_nginx.conf
to/etc/zabbix/zabbix_agentd.d
folder (or whatever is default and/or configured on your system). -
Copy
nginx-stat.py
to/etc/zabbix/zabbix_agentd.scripts
folder. IMPORTANT: if you use another folder for agent scripts, then update userparameter file in the previous step! -
Import XML template file (
zbx_template_nginx.xml
) into Zabbix via Web GUI (Configuration -> Templates -> Import). -
Assign the imported template to a host and enjoy!
A simple run of the script from a console should give just one number in return, for example:
> /etc/zabbix/zabbix_agentd.scripts/nginx-stat.py -h localhost -p 443 -a active
14