haproxy state

This commit is contained in:
do
2021-02-02 11:50:55 +01:00
parent af9b2c1457
commit d90320f681
2 changed files with 64 additions and 1 deletions

61
base/packages/haproxy.sls Normal file
View File

@@ -0,0 +1,61 @@
include:
- haproxy
pkg_prometheus-haproxy-exporter:
pkg.installed:
- pkgs:
- prometheus-haproxy-exporter
service_prometheus-haproxy-exporter:
service.running:
- name: prometheus-haproxy-exporter
- enable: True
- watch:
- file: /etc/default/prometheus-haproxy-exporter
etc_default_prometheus_haproxy-exporter:
file.managed:
- name: /etc/default/prometheus-haproxy-exporter
- require:
- pkg: pkg_prometheus-haproxy-exporter
- contents: |
#
## SALT managed
#
# Set the command-line arguments to pass to the server.
# Due to shell scaping, to pass backslashes for regexes, you need to double
# them (\\d for \d). If running under systemd, you need to double them again
# (\\\\d to mean \d), and escape newlines too.
ARGS="--haproxy.scrape-uri=http://localhost:9110/haproxy-status;csv --log.level=warn"
# Prometheus-haproxy-exporter supports the following options:
#
# --web.listen-address=":9101"
# Address to listen on for web interface and telemetry.
# --web.telemetry-path="/metrics"
# Path under which to expose metrics.
# --haproxy.scrape-uri="http://localhost/;csv"
# URI on which to scrape HAProxy.
# --haproxy.ssl-verify
# Flag that enables SSL certificate verification for the scrape URI
# --haproxy.server-metric-fields="2,3,4,5,6,7,8,9,13,14,15,16,17,18,21,24,33,35,38,39,40,41,42,43,44"
# Comma-separated list of exported server metrics. See
# http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.1
# --haproxy.timeout=5s
# Timeout for trying to get stats from HAProxy.
# --haproxy.pid-file=""
# Path to HAProxy pid file.
#
# If provided, the standard process metrics get exported for the HAProxy
# process, prefixed with 'haproxy_process_...'. The haproxy_process exporter
# needs to have read access to files owned by the HAProxy process. Depends
# on the availability of /proc.
# https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics.
# --log.level="info"
# Only log messages with the given severity or above.
# Valid levels: [debug, info, warn, error, fatal]
# --log.format="logger:stderr"
# Set the log target and format. Example:
# "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"

View File

@@ -17,8 +17,10 @@ base:
#- base.packages.openhab.ser2net_client #- base.packages.openhab.ser2net_client
'auto02*': 'auto02*':
- k8s.podman - k8s.podman
- haproxy - base.packages.haproxy
- systemd.units - systemd.units
#'drucki.wks':
#- base.packages.haproxy
'pine*': 'pine*':
- k8s - k8s
'lenny*': 'lenny*':