Comments (8)
@ivanpedersen thanks for your help, it is working now!
from haproxy_exporter.
I've got this figured out and it turns out my first assumptions was way off... What I got in the first row was actually [<!DOCTYPE html>]
from the pFsense login page rather than the csv export.
In case anyone is interested, I eventually solved this by adding an additional frontend and backend to my pFsense/HAProxy config so that the specific stats path gets redirected to the internal port 2200 on localhost where the stats are available.
Stats config that can be exported from pFsense.
listen HAProxyLocalStats
bind 127.0.0.1:2200 name localstats
mode http
stats enable
stats refresh 10
stats admin if TRUE
stats uri /haproxy/haproxy_stats.php?haproxystats=1
timeout client 5000
timeout connect 5000
timeout server 5000
from haproxy_exporter.
from haproxy_exporter.
I tried with user and password but it didn't work for some reason, I've not really looked into why...
I've not tried to intall it directly on the pFsense box, It would mean to install go and compile locally since docker is still experimental on FreeBSD.
Running the exporter on another host makes most sense for me.
from haproxy_exporter.
@ivanpedersen i have the same problem as you and i first tried to get haproxy stats via curl / wget but that didn't work out. regarding the pfsense documentation, you can't just send basic auth, but you need to configure cookies and csfr:
https://doc.pfsense.org/index.php/Remote_Config_Backup
But as i said, that didn't work for me. I then tried as you said, and configured additional frontend / backend, but that didn't work either:
listen HAProxyLocalStats
bind 127.0.0.1:2200 name localstats
mode http
stats enable
stats refresh 10
stats admin if TRUE
stats uri /haproxy/haproxy_stats.php?haproxystats=1
timeout client 5000
timeout connect 5000
timeout server 5000
frontend haproxy_stats
bind EXTERNAL_IP:2200 name EXTERNAL_IP:2200
mode http
log global
option http-keep-alive
timeout client 30000
default_backend haproxy_stats_http_ipvANY
backend haproxy_stats_http_ipvANY
mode http
log global
timeout connect 30000
timeout server 30000
retries 3
server haproxy_stats_0 127.0.0.1:2200 check inter 1000
server haproxy_stats_1 ::1:2200 check inter 1000
Can you please share your exact config?
from haproxy_exporter.
@discostur I have a shared frontend with some ssl redirect and acme stuff (removed from the config below),the relevant stuff should be the below:
bind 127.0.0.1:2200 name localstats
mode http
stats enable
stats refresh 10
stats admin if TRUE
stats uri /haproxy/haproxy_stats.php?haproxystats=1
timeout client 5000
timeout connect 5000
timeout server 5000
frontend WAN_HTTP-merged
bind WAN_IP:80 name WAN_IP:80
bind LAN_IP:80 name LAN_IP:80
mode http
log global
option http-keep-alive
timeout client 30000
acl haproxy_csv_acl path_beg -i /haproxy/haproxy_stats.php
use_backend haproxy_csv_http_ipvANY if haproxy_csv_acl
backend haproxy_csv_http_ipvANY
mode http
log global
timeout connect 30000
timeout server 7200000
retries 3
server haproxy_csv 127.0.0.1:2200 check inter 1000 ```
from haproxy_exporter.
Doesn't this allow external users who stumble on this haproxy site to remove hosts from your pool?
from haproxy_exporter.
@jaretclifton does it? That sounds bad :)
Care to elaborate?
from haproxy_exporter.
Related Issues (20)
- Error when using docker-compose HOT 1
- Cutting a new release HOT 4
- Haproxy stats page report inaccurate data. HOT 3
- not read stats in haproxy for monitoring HOT 1
- haproxy.scrape-uri parameter format HOT 1
- Can't scrape HAProxy: Requested canceled while waiting for connection. HOT 1
- Metric for frontend status HOT 2
- haproxy_backend_http_responses_total per API? HOT 1
- Multiple remote haproxy HOT 2
- http_responses_total missing exported_service label HOT 1
- crashes on http.ListenAndServe (during accepting new connections) HOT 2
- only one pid's metrics return by exporter HOT 6
- Discard golang / process metrics HOT 4
- dockerhub images have wrong os/architecture tags HOT 2
- The README file in Docker Hub uses the wrong command "-haproxy.scrape-uri" HOT 1
- --help
- haproxy_exporter.exe commited to repo HOT 1
- ts=2022-01-17T08:59:49.183Z caller=haproxy_exporter.go:421 level=error msg="Unexpected error while reading CSV" err="unexpected EOF" HOT 1
- dial tcp 127.0.0.1:8181: connect: connection refused HOT 3
- metric description HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haproxy_exporter.