title: Zabbix-agent on HAProxy discover load-balanced host doesn't show up on Zabbix Server
body: <p>I have been following this tutorial for a moment but I don't know why it isn't working:
  <a href="https://github.com/anapsix/zabbix-haproxy/blob/master/README.md" rel="nofollow noreferrer">https://github.com/anapsix/zabbix-haproxy/blob/master/README.md</a></p>
  
  <p>To make a long story short:
  I have a Zabbix server on Amazon EC2 and I want to monitor a HAproxy server which is inside my network. The HAProxy Server has a Zabbix Agent working on it.
  The tutorial explain how to setup a script for the zabbix-agent to explore what's behind it (what's the haproxy is load-balancing) and send it back to the Zabbix Server.</p>
  
  <p>However everything is working fine but nothing shows up on the Zabbix server, no host are discovered despite the zabbix agent and server are communicating.</p>
  
  <p>1 - I did place the userparameter_haproxy.conf into <code>/etc/zabbix/zabbix_agentd.d/</code> and 
  set it in the zabbix_agend.conf file.</p>
  
  <p>2 - I did place the haproxy_discovery.sh into <code>/usr/local/bin/</code> and gave it the +x rights</p>
  
  <p>3 - I did import haproxy_zbx_template.xml</p>
  
  <p>4 - Configure HAProxy control socket: I assume there is my mistake.</p>
  
  <p>5- The scripts are working because I get result when I execute this commands:</p>
  
  <pre><code>zabbix_agentd -t haproxy.list.discovery[FRONTEND]
  zabbix_agentd -t haproxy.list.discovery[BACKEND]
  zabbix_agentd -t haproxy.list.discovery[SERVERS]
  </code></pre>
  
  <p>6 - I added the host with HAproxy on it to the right template</p>
  
  <p>7 - I can wait forever nothing is showing up, no new hosts.</p>
  
  <p>I think the step 4 is where I am doing wrong. In the tutorial they say:</p>
  
  <p>Configure HAProxy to listen on <code>/var/run/haproxy/info.sock</code> or  set
     custom socket path in checks (set <code>{$HAPROXY_SOCK}</code> template macro to
     your custom socket path) or  update userparameter_haproxy.conf and
     haproxy_discovery.sh with your socket path</p>
  
  <p>I did make the haproxy.cfg file listen to the file  <code>/var/lib/haproxy/stats</code>
  and set a custom socket path in the template macro.</p>
  
  <p>Additionnal info: 
  Version of Zabbix: 3.4
  Zabbix Server: RHEL 7.4
  Zabbix Agent: Centos 7.2
  No errors when I restart zabbix-agent
  No errors in haproxy.log</p>
  
  <hr>
  
  <p>UPDATE: I did add Zabbix to the root group.</p>
  
  <p>Now, in Zabbix server logs I can see this message:</p>
  
  <pre><code>changed: Value "which: no nc in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
  2" of type "string" is not suitable for value type "Numeric (unsigned)"
  </code></pre>
  
  <p>And I'm lost again.</p>
  
  <hr>
  
  <p>UPDATE: I was missing netcat, I installed it on the zabbix server and client.</p>
  
  <hr>
  
  <p>UPDATE: It's working</p>