Monitor HaProxy installed on Centos 7

Hello community,

I’ve a HaProxy installed in Centos 7 and i’am looking for monitor this VM , like check the status of frontend , server status , TCP Connections …

I find this in catalog Check Plug-Ins Catalog , but this article is valid only with freebsd agent

Any idea please ?

The Linux agent already has a section for HA-Proxy included:

section_haproxy() {
    for HAPROXY_SOCK in /run/haproxy/admin.sock /var/lib/haproxy/stats; do
        if [ -r "${HAPROXY_SOCK}" ] && inpath socat; then
            echo "<<<haproxy:sep(44)>>>"
            echo "show stat" | socat - "UNIX-CONNECT:${HAPROXY_SOCK}"
        fi
    done
}

As long as your HA-Proxy socket is either /run/haproxy/admin.sock or /var/lib/haproxy/stats it should be detected automatically. And you need socat installed on the host.

sorry but i use haproxy 1.8
so the stats is stored in

/var/lib/haproxy18/stats

no way to edit the plugin directly ?

You could create a symlink ln -s /var/lib/haproxy18 /var/lib/haproxy or change the HA-Proxy configuration to use a standard path. Why would the version number be included in the directory name?

I already find this configuration , i don’t know why is installed like that

the symbolic link is already created and this work like a charm
Thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.