Hello,
I was adding an UserParameter in a new server runing varnish cache:
UserParameter=varnish_collect[*],varnishstat -1 | awk '{print "$1" " " $$1 " " $$2}' > /tmp/$1-zabbix.data && /usr/local/bin/zabbix_sender -vv -z 104.41.131.219 -i /tmp/$1-zabbix.data > /tmp/$1-zabbix.log 2>&1 ; echo $?
Font: https://github.com/lorieri/zabbix/tree/master/templates/varnish
I already have that parameter working fine in another server, but I was receiving an trigger error when check this parameter. Take a look:
# Server OK - RETURN "0" zabbix_sender -V Zabbix Sender v2.0.13 (revision 48919) (10 September 2014) Compilation time: Nov 13 2014 12:01:25 zabbix_sender -vv -z XXX.XXX.XXX.XXX -i /tmp/HOSTNAME-zabbix.data ; echo $? zabbix_sender [16683]: DEBUG: answer [{"response":"success","info":"processed: 39; failed: 163; total: 202; seconds spent: 0.002343"}] info from server: "processed: 39; failed: 163; total: 202; seconds spent: 0.002343" sent: 202; skipped: 0; total: 202 0
# Server Fail - RETURN "2" Zabbix Sender v2.4.2 (revision 50419) (5 November 2014) Compilation time: Nov 12 2014 17:43:02 zabbix_sender -vv -z 104.41.131.219 -i /tmp/ip-172-31-21-99-zabbix.data ; echo $? zabbix_sender [2369]: DEBUG: answer [{"response":"success","info":"processed: 39; failed: 163; total: 202; seconds spent: 0.001716"}] info from server: "processed: 39; failed: 163; total: 202; seconds spent: 0.001716" sent: 202; skipped: 0; total: 202 2
Please, find attached an example data that I sending to zabbix trapper and template.
Regards,
Thiago Gomes