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

Refactor and fix snmp exporter

parent 37beb302
No related branches found
No related tags found
1 merge request!1082Refactor and fix snmp exporter
......@@ -24,7 +24,6 @@ jupyter-lab ec-sim grafana landing-page:
docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@
snmp-exporter:
$(MAKE) -C snmp-exporter all
docker build -f $@/Dockerfile -t $(LOCAL_DOCKER_REGISTRY)/$@:$(TAG) $@
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
COPY snmp.yml /etc/snmp_exporter/snmp.yml
FROM prom/snmp-generator:main AS generator
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