community-templates
community-templates copied to clipboard
template_bind_stat not working .
My agent is as follows ;
$# zabbix_agent2 -version
zabbix_agent2 (Zabbix) 5.4.12
I get this error message after adding the bind.conf file .
2022/04/11 16:14:24.868061 Starting Zabbix Agent 2 (5.4.12)
2022/04/11 16:14:24.868666 OpenSSL library (OpenSSL 1.1.1 11 Sep 2018) initialized
2022/04/11 16:14:24.871519 using configuration file: /etc/zabbix/zabbix_agent2.conf
2022/04/11 16:14:24.871654 cannot initialize user parameters: cannot add user parameter "bind.queries.in[],curl http://127.0.0.1:8053/ 2>/dev/null | xml2 | grep -A1 "/statistics/server/counters/counter/@name=$1$" | tail -1 | cut -d= -f2": syntax error
The problem is from your documentation, you guys failed to put the agent configuration inside block quotes .
The problem is from your documentation, you guys failed to put the agent configuration inside block quotes .
How did you resolve it?
Replace the whole userparam conf file with the below:
UserParameter=bind.queries.in[*],curl http://127.0.0.1:8053/ 2>/dev/null | xml2 | grep -A1 "/statistics/server/counters/counter/@name=$1" | tail -1 | cut -d= -f2
UserParameter=bind.queries.out[*],curl http://127.0.0.1:8053/ 2>/dev/null | xml2 | grep -A1 "/statistics/views/view/counters/counter/@name=$1" | tail -1 | cut -d= -f2
Also, for the RHEL folks >= 8: you have to install the xml2
package from rhel7:
yum install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/x/xml2-0.5-7.el7.x86_64.rpm