mirror of
https://github.com/nealey/docker-storcli-prometheus
synced 2025-01-17 04:14:38 -07:00
Initial commit
This commit is contained in:
commit
a687b2d9d6
2 changed files with 23 additions and 0 deletions
10
Dockerfile
Normal file
10
Dockerfile
Normal 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
13
entrypoint.sh
Executable 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
|
Loading…
Reference in a new issue