Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Varnish template improvements & v7 changes #348

Open
linceaerian opened this issue Mar 26, 2024 · 0 comments
Open

Varnish template improvements & v7 changes #348

linceaerian opened this issue Mar 26, 2024 · 0 comments

Comments

@linceaerian
Copy link

linceaerian commented Mar 26, 2024

Hello Maintainer(s),

I would suggest adding in the doc of the varnish template:

Varnish group / access

Please note that in order for the template to work, access must be given to your zabbix user to access varnishd.

Ex:

adduser zabbix varnish

Userparameter in place of system.run

In case people does not want to activate system.run, which can lead to vuln

If you prefer use UserParameter, you can:

  • Add a user parameter defined as: UserParameter=varnish.stat,varnishstat -j in you Zabbix configuration
  • Change the item "Varnish: Get status" to "varnish.stat"

Varnish JSON changes

Also I found that the JSON for some version of varnish is different, so maybe use a macro for the "get status" post processing to use in case the data use the new version.

Ex of data for varnish > 7.0

{"version":1,"timestamp":"2024-03-26T17:06:01","counters":{"MGT.uptime":{"description":"Management process uptime","flag":"c","format":"d","value":263150}}

I updated mine by adding "$.counters" in the post processing for get status.

Cache hit rate

The cache hit rate item should be updated to avoid division by 0 when no traffic, either in updating the JS (clean) or a catch in the post processing for failure (less clean).

Ex:

var values = JSON.parse(value);
var hit = values["MAIN.cache_hit"].value;
var miss = values["MAIN.cache_miss"].value;
var hitpass = values["MAIN.cache_hitpass"].value;
if (hit==0)
  return 100;
return hit / (hit + miss) * 100;

Same problem for "Cache hit rate 5m" => divide by zero.

Main sesssion drop

The stat MAIN.sess_drop has been renamed MAIN.sess_dropped.

Thanks for the template, have a good day :)

@linceaerian linceaerian changed the title Varnish template doc improvement Varnish template improvements Mar 26, 2024
@linceaerian linceaerian changed the title Varnish template improvements Varnish template improvements & v7 changes Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant