0% found this document useful (0 votes)
17 views4 pages

Haproxy Exporter

The document provides a series of commands for running various containers using Podman, specifically for HAProxy exporter, Prometheus, and Grafana. It includes instructions for setting up the HAProxy exporter with specific scrape URIs and checking the configuration using curl commands. Additionally, it contains logs and troubleshooting information related to the HAProxy exporter container.

Uploaded by

akshayb.hase
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Haproxy Exporter

The document provides a series of commands for running various containers using Podman, specifically for HAProxy exporter, Prometheus, and Grafana. It includes instructions for setting up the HAProxy exporter with specific scrape URIs and checking the configuration using curl commands. Additionally, it contains logs and troubleshooting information related to the HAProxy exporter container.

Uploaded by

akshayb.hase
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

podman run -d --name haproxy-exporter -p 9101:9101 docker.

io/prom/haproxy-exporter:latest

podman run -d --name prometheus -p 9090:9090 docker.io/prom/prometheus:latest

podman run -d --name grafana -p 3000:3000 grafana/grafana

podman run -d --name haproxy-exporter -p 9101:9101 -e


HAPROXY_URI="http://10.17.1.121:80/stats" docker.io/prom/haproxy-exporter:latest
podman run -d --name haproxy-exporter --net host -p 9101:9101 -e
--haproxy.scrape-uri="http://admin:\"Fino@2016\"@10.17.1.121:1936/haproxy?stats;csv"
docker.io/prom/haproxy-exporter:latest

./haproxy_exporter
--haproxy.scrape-uri="http://admin:Fino%402016@10.17.1.121:1936/haproxy?stats;csv"
%22: http://admin:abEDokA(%22@192.168.1.10:10000/haproxy/stats;csv
--haproxy.scrape-uri=%22: http://admin:Fino@2016(%22@10.17.1.121:1936/haproxy?stats;csv

podman run -d --name haproxy-exporter -p 9101:9101 docker.io/prom/haproxy-exporter:latest


podman run --rm -it --net host docker.io/curlimages/curl -u admin:Fino@2016
http://10.17.1.121:1936/haproxy?stats;csv
podman run -d --name haproxy-exporter -p 9101:9101 -e
HAPROXY_SCRAPE_URI="http://admin:\"Fino@2016\"@10.17.1.121:1936/haproxy?stats;csv"
docker.io/raymondmm/haproxy-exporter:latest

podman run -p 9101:9101 -itd --name haproxy-exporter


quay.io/prometheus/haproxy-exporter:latest
--haproxy.scrape-uri="http://admin:Fino@2016@10.17.1.86:1936/haproxy?stats;csv"

create haproxy container.


Command:
podman run -d -it --name haproxy-exporter -p 9101:9101 -e
--haproxy.scrape-uri="http://admin:Fino@2016@10.17.1.121:1936/haproxy?stats;csv"
docker.io/raymondmm/haproxy-exporter:latest

Check uri using curl command:

curl -u admin:Fino@2016 10.17.1.121:1936/haproxy?stats


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Statistics Report for HAProxy on uidaiha</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css"><!--
body { font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: normal; color: black;
background: white;}
th,td { font-size: 10px;}
h1 { font-size: x-large; margin-bottom: 0.5em;}
h2 { font-family: helvetica, arial; font-size: x-large; font-weight: bold; font-style: italic; color:
#6020a0; margin-top: 0em; margin-bottom: 0em;}
h3 { font-family: helvetica, arial; font-size: 16px; font-weight: bold; color: #b00040; background:
#e8e8d0; margin-top: 0em; margin-bottom: 0em;}
li { margin-top: 0.25em; margin-right: 2em;}
.hr {margin-top: 0.25em; border-color: black; border-bottom-style: solid;}
.titre {background: #20D0D0;color: #000000; font-weight: bold; text-align: center;}
.total {background: #20D0D0;color: #ffff80;}
.frontend {background: #e8e8d0;}
.socket {background: #d0d0d0;}
.backend {background: #e8e8d0;}
.active_down ​ {background: #ff9090;}
.active_going_up ​ {background: #ffd020;}
.active_going_down {background: #ffffa0;}
.active_up ​ {background: #c0ffc0;}
.active_nolb ​ {background: #20a0ff;}

Podman logs of haproxy_exporter:

[root@uidaiha ~]# podman logs haproxy-exporter


ts=2024-02-05T12:00:34.414Z caller=haproxy_exporter.go:602 level=info msg="Starting
haproxy_exporter" version="(version=0.15.0, branch=HEAD,
revision=d4aba878f043fd3ad0bcacd0149e7d75e67c0faa)"
ts=2024-02-05T12:00:34.414Z caller=haproxy_exporter.go:603 level=info msg="Build context"
context="(go=go1.19.5, platform=linux/amd64, user=root@d10658e4ead1,
date=20230215-11:17:10)"
ts=2024-02-05T12:00:34.414Z caller=tls_config.go:232 level=info msg="Listening on"
address=[::]:9101
ts=2024-02-05T12:00:34.414Z caller=tls_config.go:235 level=info msg="TLS is disabled."
http2=false address=[::]:9101
ts=2024-02-05T12:01:00.327Z caller=haproxy_exporter.go:410 level=error msg="Can't scrape
HAProxy" err="Get \"http://localhost/;csv\": dial tcp [::1]:80: connect: connection refused"
ts=2024-02-05T12:01:35.430Z caller=haproxy_exporter.go:410 level=error msg="Can't scrape
HAProxy" err="Get \"http://localhost/;csv\": dial tcp [::1]:80: connect: connection refused"
ts=2024-02-05T12:02:33.706Z caller=haproxy_exporter.go:410 level=error msg="Can't scrape
HAProxy" err="Get \"http://localhost/;csv\": dial tcp [::1]:80: connect: connection refused"
ts=2024-02-05T12:02:34.979Z caller=haproxy_exporter.go:410 level=error msg="Can't scrape
HAProxy" err="Get \"http://localhost/;csv\": dial tcp [::1]:80: connect: connection refused"
[root@uidaiha ~]#
Ip of haproxy-exporter container.

[root@uidaiha ~]# podman inspect haproxy-exporter | grep -i ip


​ ​ "IPAddress": "10.88.0.34",
​ ​ "IPPrefixLen": 16,
​ ​ "IPv6Gateway": "",
​ ​ "GlobalIPv6Address": "",
​ ​ "GlobalIPv6PrefixLen": 0,
​ ​ "LinkLocalIPv6Address": "",
​ ​ "LinkLocalIPv6PrefixLen": 0,
​ ​ "HostIp": "",
​ ​ "IPAddress": "10.88.0.34",
​ ​ "IPPrefixLen": 16,
​ ​ "IPv6Gateway": "",
​ ​ "GlobalIPv6Address": "",
​ ​ "GlobalIPv6PrefixLen": 0,
​ ​ "IPAMConfig": null,
​ ​ "HostIp": "",
​ ​ "IpcMode": "private",

telnet container haproxy_exporter:

[root@uidaiha ~]# telnet 10.88.0.34 9101


Trying 10.88.0.34...
Connected to 10.88.0.34.
Escape character is '^]'.

[root@uidaiha ~]# podman ps


CONTAINER ID IMAGE ​ COMMAND ​ CREATED ​
STATUS ​PORTS ​ NAMES
2a9013fdf807 docker.io/raymondmm/haproxy-exporter:latest /bin/haproxy_expo... 45 minutes
ago Up 45 minutes ago 0.0.0.0:9101->9101/tcp haproxy-exporter

[root@uidaiha ~]# podman exec -it haproxy-exporter sh


/ # curl -I -u admin:Fino@2016 10.17.1.121:1936/haproxy?stats
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: text/html
Refresh: 30

You might also like