我试图找出为什么我不时得到BADREQs,通过使用socat中的“显示错误”。 问题是它只显示最后一个错误。 我希望能够看到所有这些(比如使用tail -f … | grep)。
请有人告诉我,我该如何连续显示这些BADREQ? 有没有socat?
真正的问题是,我得到了haproxy日志中的BADREQ,但是[echo“show errors”| socat unix-connect:/var/run/haproxy.sock stdio]不会捕获它们。 这是用haproxyconfiguration的东西吗?
由于显示错误被定义为:
show errors : report last request and response errors for each proxy
我想你可能不走运。 但是,通过一些shell脚本,您应该能够在文件中收集足够的文件以达到其底层。
#Run the command every 10 seconds, appending to the errors file in the current directory nohup bash -c 'while true; do echo "show errors" | socat stdio /var/run/haproxy-t1.stat; sleep 10; done >> errors'
也许越来越多的计数器意味着没有真正的“坏请求”,但像端口扫描,如https://serverfault.com/a/202654/227214中所述 ?
我也注意到增加badreq-counters没有匹配“显示错误”条目。