From 9c06dcc20e08af12721e925eb0529c3232a3f8b0 Mon Sep 17 00:00:00 2001 From: Frankie H Date: Sun, 8 Oct 2017 21:52:18 +0800 Subject: [PATCH] Add dockerfile and update readme --- Dockerfile | 7 +++++++ README.md | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2d127e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:latest + +RUN apk update && apk add python2 py-pip fping +COPY ./ping-exporter.py / +RUN ln -s /usr/sbin/fping /usr/bin/fping +EXPOSE 8085 +CMD ["python2", "/ping-exporter.py"] diff --git a/README.md b/README.md index 44efd98..e0f321a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ A simple python script call fping(require version 4.0) and parse the output to a For Debian user, you can get the fping deb file from http://ftp.debian.org/debian/pool/main/f/fping/fping_4.0-1_armhf.deb +For docker user, you can build the container with the Dockerfile(based on alpine around 54M). For arm user, you can change FROM to "armhf/alpine" + PS: The script is working fine with > 40 ping target in a PI 3B. Append the following in prometheus's config