Initial commit
This commit is contained in:
commit
a687b2d9d6
|
@ -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"]
|
|
@ -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
|
Loading…
Reference in New Issue