Make prometheus-node-exporter a bit more capable

By running it in a more privileged container with access to the host network stack and such
development
Peetz0r 4 years ago
parent a10e3244d9
commit 76d7e84be5

@ -21,14 +21,17 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-prometheus-nod
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_docker_network }} \
{% if matrix_prometheus_node_exporter_container_http_host_bind_port %}
-p {{ matrix_prometheus_node_exporter_container_http_host_bind_port }}:9100 \
{% endif %}
{% for arg in matrix_prometheus_node_exporter_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_prometheus_node_exporter_docker_image }}
--net="host" \
--pid="host" \
-v "/:/host:ro,rslave" \
{{ matrix_prometheus_node_exporter_docker_image }} \
--path.rootfs=/host
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-prometheus-node-exporter 2>/dev/null'
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null'

@ -36,5 +36,5 @@ scrape_configs:
{% if matrix_prometheus_node_exporter_enabled %}
- job_name: node
static_configs:
- targets: ['matrix-prometheus-node-exporter:9100']
- targets: ['172.18.0.1:9100']
{% endif %}

Loading…
Cancel
Save