How to change HAProxy login credentials?
Hello everyone,
I had to change the login credentials for my HAProxy (user stats insecure-password XXX).
Unfortunately ClusterControl is not able to collect performace datas anymore.
time="2020-01-15T15:43:36+01:00" level=error msg="Can't scrape HAProxy: HTTP status 401" source="haproxy_exporter.go:315"
How and where can I change the scrape-uri parameters for the HAProxy exporter process?
Thank you in advance
Leo
-
Official comment
Hi,
You can change the URL used by the haproxy_exporter:
I the example above I've changed the password for the user 'admin' to 'admin222'.
Comment actions -
Perfect,
thank you very much!
Got it working now but run into a couple of problems.
1. --haproxy.scrape-uri=http://proxy:admin222@10.10.0.151:9600/haproxy?
For me the exporter is not able to parse the output from the status page.
time="2020-01-16T14:16:32+01:00" level=error msg="Parser expected at least 33 CSV fields, but got: 1" source="haproxy_exporter.go:372"
time="2020-01-16T14:16:32+01:00" level=error msg="Can't read CSV: line 1349, column 10: bare \" in non-quoted-field" source="haproxy_exporter.go:334"2. --haproxy.scrape-uri=http://proxy:admin222@10.10.0.151:9600/haproxy?stats;csv
Seems that the deployment script has a problem with the semicolon. I created a job loop with this version.
-
13:48:34]:10.10.0.151: Error /tmp/s9s_tmp.local./tbFTGieLyzSGioAk/ewCQDREZ7UDFAMmt.749.2034.sh: line 8: csv: command not found
. -
[13:48:34]:10.10.0.151: Command was cd /var/lib/prometheus
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
export HOME=/var/lib/prometheus
nohup daemon --name=haproxy_exporter_9102 --inherit --output=/var/log/prometheus/haproxy_exporter_9102.log --env="PATH=/usr/local/bin:/usr/bin:$PATH" --chdir=/var/lib/prometheus --pidfile=/var/run/prometheus/haproxy_exporter_9102.pid --user=prometheus -- haproxy_exporter --haproxy.scrape-uri=http://proxy:admin222@10.10.0.151:9600/haproxy?stats;csv --web.listen-address=":9102" .
3. --haproxy.scrape-uri="http://proxy:admin222@10.10.0.151:9600/haproxy?stats;csv"
This one finaly worked for me.
The next problem I had was the length of the haproxy exporter arguments list. If it is too long, the cross for deleting the string is not showing up anymore. Tested it with Firefox and Chromium.I had to shorten the string in the browser devolement tools to see the cross again.
Just for the case, someone is running into the same problem.
Thank you for your help!
Greetings
Leo
-
Please sign in to leave a comment.
Comments
5 comments