https://github.com/allenta/zabbix-template-for-varnish-cache
Zabbix template + script useful to monitor Varnish Enterprise instances
https://github.com/allenta/zabbix-template-for-varnish-cache
varnish-cache zabbix zabbix-templates
Last synced: 4 months ago
JSON representation
Zabbix template + script useful to monitor Varnish Enterprise instances
- Host: GitHub
- URL: https://github.com/allenta/zabbix-template-for-varnish-cache
- Owner: allenta
- License: other
- Created: 2015-10-19T13:18:29.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-08-21T10:54:15.000Z (10 months ago)
- Last Synced: 2025-09-07T21:47:30.641Z (9 months ago)
- Topics: varnish-cache, zabbix, zabbix-templates
- Language: Jinja
- Homepage:
- Size: 464 KB
- Stars: 34
- Watchers: 6
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
**This is a Zabbix template + script useful to monitor Varnish Enterprise instances**:
1. Copy ``zabbix-varnish-cache.py`` to ``/usr/local/bin/``.
2. Add the ``varnish.discovery`` and ``varnish.stats`` user parameters to Zabbix::
UserParameter=varnish.discovery[*],sudo /usr/local/bin/zabbix-varnish-cache.py -i '$1' discover $2
UserParameter=varnish.stats[*],sudo /usr/local/bin/zabbix-varnish-cache.py -i '$1' stats
You'll have to grant ``zabbix`` user sudo permissions to execute ``/usr/local/bin/zabbix-varnish-cache.py`` in order to let the script perform ``varnishadm`` commands to discover the current active VCL, discover healthiness of each backend, etc.
If you'd rather not use sudo, then add ``zabbix`` user to the ``varnish`` group in order for the script to be able to retrieve as much data as possible::
$ sudo usermod -a --groups varnish zabbix
3. Import the template. You may download the appropriate version from `the releases page `_ or generate it using the Jinja2 skeleton::
$ pip install jinja2-cli
$ PYTHONPATH=. jinja2 \
-D version={6.0,6.2,6.4,7.0,7.2,7.4} \
[-D name='Varnish Cache'] \
[-D description=''] \
[-D release='trunk'] \
--extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-varnish-cache.j2
4. Link hosts to the template. Beware you must set a value for the ``{$VARNISH_CACHE.LOCATIONS}`` macro (comma-delimited list of Varnish Enterprise instance names). Usually you should leave its value blank when running a single Varnish Enterprise instance per server. Additional macros and contexts are available for further customizations.
Please note that **this template + script are exclusively intended for Varnish Enterprise instances**. It does not require many changes to work with Varnish Cache, but it will not work out of the box, especially if not using version 6.0 LTS: different ``varnishstat`` and ``varnishadm`` outputs, different sets of metrics, etc.