# How to get (count of) active backends of HAProxy?

**URL:** <https://discourse.haproxy.org/t/how-to-get-count-of-active-backends-of-haproxy/12009>\
**Category:** Help!\
**Created:** [September 15, 2025, 6:59am UTC](https://discourse.haproxy.org/t/how-to-get-count-of-active-backends-of-haproxy/12009 "2025-09-15T06:59:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yelkase](https://avatars.discourse-cdn.com/v4/letter/y/35a633/32.png) [@yelkase](https://discourse.haproxy.org/u/yelkase)\
**Post date:** [September 15, 2025, 6:59am UTC](https://discourse.haproxy.org/t/how-to-get-count-of-active-backends-of-haproxy/12009/1 "2025-09-15T06:59:31Z")

</div>

I can monitor HAProxy stats via

```bash
listen stats
   stats uri /<URI>

```

and

`curl ../<URI>`

I need to get backends info and I’ve searched such way:

`echo “show backend” | `  
` sudo socat stdio tcp4-connect:<IP>:<PORT>`

but it nothing returns.

Should I define similar section in the `HAProxy` configuration before using such .. **API**?

Otherwise there’re no configuration issues and `show backend` is built-in API endpoint and there’re other problems (user/password maybe)?

So what’s the next steps I need to follow to resolve the issue?

---

<div class="post-metadata">

**Author:** ![yelkase](https://avatars.discourse-cdn.com/v4/letter/y/35a633/32.png) [@yelkase](https://discourse.haproxy.org/u/yelkase)\
**Post date:** [September 15, 2025, 7:46am UTC](https://discourse.haproxy.org/t/how-to-get-count-of-active-backends-of-haproxy/12009/2 "2025-09-15T07:46:55Z")

</div>

Ok.

I’ve found I’ve been using incorrect .. _endpoint_ (?).

In my case I had to find out `stats` endpoint during configuration exploring and it’d say me that the socket is `/var/run/haproxy.sock`.

So:

`echo “show backend” | nc -w 10 -U /var/run/haproxy.sock`

returns what I want.
