Skip to content
Snippets Groups Projects
Commit ea75f0d5 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

Merge branch 'fix-snmp-exporter' into 'master'

Refactor and fix snmp exporter

See merge request !1082
parents 37beb302 344b0a3d
No related branches found
No related tags found
1 merge request!1082Refactor and fix snmp exporter
Pipeline #115315 passed with warnings
Pipeline: tango

#115316

    ...@@ -24,7 +24,6 @@ jupyter-lab ec-sim grafana landing-page: ...@@ -24,7 +24,6 @@ jupyter-lab ec-sim grafana landing-page:
    docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@ docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@
    snmp-exporter: snmp-exporter:
    $(MAKE) -C snmp-exporter all
    docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@ docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@
    dsconfig: dsconfig:
    ......
    FROM prom/snmp-exporter:latest FROM alpine:3 AS mibs
    RUN apk add --no-cache curl make sed
    ADD https://github.com/prometheus/snmp_exporter.git /src
    WORKDIR /src/generator
    RUN make mibs
    # snmp.yml is generated from generator.yml through make FROM prom/snmp-generator:main AS generator
    COPY snmp.yml /etc/snmp_exporter/snmp.yml COPY --from=mibs /src/generator/mibs /opt/mibs
    COPY lofar_mibs /tmp/lofar_mibs
    COPY generator.yml /opt/generator.yml
    RUN cp /tmp/lofar_mibs/* /opt/mibs/
    WORKDIR /opt
    RUN /bin/generator -m /opt/mibs --fail-on-parse-errors generate
    FROM prom/snmp-exporter:main
    COPY --from=generator /opt/snmp.yml /etc/snmp_exporter/snmp.yml
    .PHONY: all clean
    LOFAR_MIBS := $(wildcard lofar_mibs/*)
    CACHED_MIBS := $(wildcard snmp_exporter_mibs_cache/*) $(wildcard snmp_exporter_mibs_cache/.???*)
    all: snmp.yml
    clean:
    rm -rf tmp
    tmp/Dockerfile: clean
    git clone https://github.com/prometheus/snmp_exporter tmp
    snmp.yml: generator.yml ${LOFAR_MIBS} tmp/Dockerfile
    cp generator.yml tmp/generator/
    cp ${CACHED_MIBS} tmp/generator/mibs/
    cp ${LOFAR_MIBS} tmp/generator/mibs/
    (cd tmp/generator && make docker-generate)
    cp tmp/generator/snmp.yml snmp.yml
    This diff is collapsed.
    File deleted
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment