Sign inSign up

insatomcat/ha-cluster-exporter

By insatomcat

•Updated 9 months ago

prometheus exporter for pacemaker

Image
0

734

insatomcat/ha-cluster-exporter repository overview

Dockerfile:

Dockerfile
FROM debian:trixie-slim

# Installer nsenter
RUN apt-get update && apt-get install -y \
    util-linux \
    && rm -rf /var/lib/apt/lists/*

# Copier votre binaire
COPY ha_cluster_exporter /app/ha_cluster_exporter
RUN chmod +x /app/ha_cluster_exporter

# Créer les scripts wrapper pour nsenter
RUN mkdir -p /usr/local/bin && \
    echo '#!/bin/sh' > /usr/local/bin/crm_mon && \
    echo 'exec nsenter -t 1 -m -u -i -n /usr/sbin/crm_mon "$@"' >> /usr/local/bin/crm_mon && \
    chmod +x /usr/local/bin/crm_mon && \
    \
    echo '#!/bin/sh' > /usr/local/bin/cibadmin && \
    echo 'exec nsenter -t 1 -m -u -i -n /usr/sbin/cibadmin "$@"' >> /usr/local/bin/cibadmin && \
    chmod +x /usr/local/bin/cibadmin && \
    \
    echo '#!/bin/sh' > /usr/local/bin/corosync-cfgtool && \
    echo 'exec nsenter -t 1 -m -u -i -n /usr/sbin/corosync-cfgtool "$@"' >> /usr/local/bin/corosync-cfgtool && \
    chmod +x /usr/local/bin/corosync-cfgtool && \
    \
    echo '#!/bin/sh' > /usr/local/bin/corosync-quorumtool && \
    echo 'exec nsenter -t 1 -m -u -i -n /usr/sbin/corosync-quorumtool "$@"' >> /usr/local/bin/corosync-quorumtool && \
    chmod +x /usr/local/bin/corosync-quorumtool

EXPOSE 9664
ENTRYPOINT ["/app/ha_cluster_exporter"]

/etc/containers/systemd/ha_cluster_exporter.container :

[Unit]
Description=HA Cluster Exporter
After=network.target

[Container]
Image=docker.io/insatomcat/ha-cluster-exporter:0.0.1
PublishPort=9664:9664
PodmanArgs=--pid=host --ipc=host --privileged
Volume=/var/run:/var/run
Exec=\
  --crm-mon-path=/usr/local/bin/crm_mon \
  --cibadmin-path=/usr/local/bin/cibadmin \
  --corosync-cfgtoolpath-path=/usr/local/bin/corosync-cfgtool \
  --corosync-quorumtool-path=/usr/local/bin/corosync-quorumtool

[Install]
WantedBy=multi-user.target

Tag summary

Content type

Image

Digest

sha256:68b1911b4…

Size

49.1 MB

Last updated

9 months ago

docker pull insatomcat/ha-cluster-exporter