From a687b2d9d644e1d59d6d3aac46b00516a4588cc7 Mon Sep 17 00:00:00 2001 From: David Hain Date: Fri, 18 May 2018 13:39:17 -0500 Subject: [PATCH] Initial commit --- Dockerfile | 10 ++++++++++ entrypoint.sh | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7918c62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM centos:7 + +RUN curl -sSL http://dl.marmotte.net/rpms/redhat/el6/x86_64/storcli-1.16.06-2/storcli-1.16.06-2.x86_64.rpm > /tmp/storcli.rpm \ +&& rpm -ivh /tmp/storcli.rpm \ +&& rm /tmp/storcli.rpm + +ADD https://raw.githubusercontent.com/prometheus/node_exporter/v0.16.0/text_collector_examples/storcli.py /storcli.py +COPY entrypoint.sh / + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..318d309 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash +usage() { + echo "usage: $0 " + exit 2 +} +[ $# -eq 2 ] || usage +trap 'kill -TERM $child 2>/dev/null' SIGTERM +while true; do + python /storcli.py > "$1" & + child=$!; wait $child + sleep "$2" & + child=$!; wait $child +done