K
K
Konstantin Luntovsky2018-09-27 09:49:46
Python
Konstantin Luntovsky, 2018-09-27 09:49:46

How to transfer hpmsa_exporter-master to docer and connect to Prometheus?

Exporter found MSA 1050 for storage monitoring;
https://github.com/enix/hpmsa_exporter
comes with a docker file;

FROM ubuntu:artful
MAINTAINER Antoine Millet
RUN apt update && apt install -y python3-lxml python3-prometheus-client python3-requests
COPY /compose/hpmsa_exporter-master/msa_exporter.py /bin/msa_exporter
RUN chmod +x /bin/msa_exporter
EXPOSE 8000
CMD /bin/msa_exporter "10.10.10.10" "user" "password"

I nailed the static data of the storage system there
. I sawed it into docker-compose;
hpmsa_exporter-master:
container_name: hpmsa_exporter-master
build:
context: /compose/hpmsa_exporter-master
dockerfile: Dockerfile
environment:
- HOST=10.10.10.10
- LOGIN=user
- PASSWORD=password
ports:
- "9350:8000"

And added to prometheus:
- job_name: 'hpmsa_exporter-master'
scrape_interval: 10s
scrape_timeout: 10s
metrics_path: /metrics
file_sd_configs:
- files:
- '/prometheus-data/sd_configs/hpmsa_exporter-master/*.yaml'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.10.10.20:9350 # The conntrack exporter's real hostname:port.

Everything is working. But my heart feels if I want to add more hosts for monitoring, and not just nailed down, I will not succeed .... The
question is how Prometheus passes parameters to the exporter. How to force the exporter to accept these parameters? such as - targets, login, password.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexq2, 2018-09-29
@alexq2

The question is offtopic, prom for operational monitoring, it does not store long-term metrics. Why was prom chosen for iron monitoring and not another solution?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question