unifios-utilities/on-boot-script-2.x/examples/udm-files/on_boot.d/50-start-node-exporter.sh

11 lines
359 B
Bash
Raw Normal View History

2023-02-23 05:44:27 +00:00
#!/bin/bash
2023-02-19 03:31:32 +00:00
CONTAINER=node-exporter
# Starts a Prometheus node-exporter container that is deleted after it is stopped.
if podman container exists "${CONTAINER}"; then
podman start "${CONTAINER}"
else
podman run -d --rm --name "${CONTAINER}" --net="host" --pid="host" -v "/:/host:ro,rslave" quay.io/prometheus/node-exporter:latest --path.rootfs=/host
fi