Initial commit

This commit is contained in:
David Hain 2018-05-18 13:39:17 -05:00
commit a687b2d9d6
2 changed files with 23 additions and 0 deletions

10
Dockerfile Normal file
View File

@ -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"]

13
entrypoint.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
usage() {
echo "usage: $0 <output_file> <interval>"
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