zabbix-tooling / zabbix-agent-extensions

zabbix-agent-extensions
GNU General Public License v2.0
111 stars 45 forks source link

UserParameter don't work, and don't know why?! #31

Closed myhellone closed 3 years ago

myhellone commented 4 years ago

Hi I have some problem: UserParameter=varnish.stat[*],(test -f /usr/bin/varnishstat && varnishstat -1 -f $1 | awk '{print $$2}') is not working, on zabbix serwer show "cannot convert value to numeric type" when I want to execute (test -f /usr/bin/varnishstat && varnishstat -1 -f $1 | awk '{print $$2}')

`varnishstat: option requires an argument -- 'f' Usage: varnishstat

Options: [-1] Print the statistics to stdout [-f ] Field inclusion glob [-h] Usage help [-j] Print statistics to stdout as JSON [-l] Lists the available fields to use with the -f option [-n

] varnishd working directory [-N ] VSM filename [-t <seconds|off>] VSM connection timeout [-V] Version [-x] Print statistics to stdout as XML `

echo "(test -f /usr/bin/varnishstat && varnishstat -1 -f$1 | awk '{print $$2}')" (test -f /usr/bin/varnishstat && varnishstat -1 -f | awk '{print 33062}') how it should work?

scoopex commented 4 years ago

This template was written for older releases of varnish (as i can remember ~3 ) It seems that there are some changes in recent varnish releases which are incompatible. Probably it is not a difficult step to fix this good template.

You see calls like varnish.stat[backend_fail] to this script in the zabbix template In that case you should execute varnishstat -1 -f backend_fail to find out if the value is still provided by varnish and if it usable by zabbix.

I currently do not have a running varnish setup, therefore merge requests which repair this template will be very welcome :-)