2

I'm trying to figure out why i'm getting BADREQs from time to time, by using "show errors" in socat. The problem is that it only shows the last error. I want to be able to see all of them ( like using tail -f ... | grep something).

can somebody tell me please how can I continuously show these BADREQs? with or without socat?

The real problem is that I'm getting BADREQs in haproxy log, but [echo "show errors" | socat unix-connect:/var/run/haproxy.sock stdio] does not catch them. Is it something with haproxy configuration?

SecondThought
  • 409
  • 1
  • 4
  • 11

2 Answers2

1

Since show errors is defined as:

show errors : report last request and response errors for each proxy

I think you might be out of luck. However, with a little shell scripting, you should be able to collect enough of them in a file to get to the bottom of it:

#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'
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
0

maybe the increasing counter means no real "bad requests", but things like port scans, as mentioned in https://serverfault.com/a/202654/227214 ?

I also notice increasing badreq-counters without matching entries in "show errors".

matt_gnu
  • 516
  • 3
  • 4