Replace telegraf with node exporter
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
23
packages/docker/prometheus-fail2ban-exporter/entrypoint.sh
Normal file
23
packages/docker/prometheus-fail2ban-exporter/entrypoint.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
mkdir -p /tmp
|
||||
LOG_PIPE="$(mktemp -u)"
|
||||
mkfifo "$LOG_PIPE"
|
||||
|
||||
(
|
||||
while IFS= read -r line; do
|
||||
if echo "$line" | grep -qEi "WARN|ERROR|FATAL"; then
|
||||
echo "$line" >&2
|
||||
else
|
||||
echo "$line"
|
||||
fi
|
||||
done < "$LOG_PIPE"
|
||||
) &
|
||||
LOG_PID=$!
|
||||
|
||||
trap 'kill $LOG_PID' EXIT
|
||||
|
||||
exec /bin/prometheus-fail2ban-exporter "$@" > "$LOG_PIPE" 2>&1
|
Reference in New Issue
Block a user