Merge branch 'master' into antifascista
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
commit
5f14067191
3 changed files with 32 additions and 0 deletions
10
Dockerfile
10
Dockerfile
|
@ -2,3 +2,13 @@ ARG ALPINE_VERSION=3.13.6
|
|||
ARG BASE_IMAGE=sutty/monit
|
||||
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
||||
MAINTAINER "f <f@sutty.nl>"
|
||||
|
||||
RUN apk add --no-cache knot knot-prometheus-exporter daemonize
|
||||
COPY ./monit.conf /etc/monit.d/knot.conf
|
||||
COPY ./prometheusd.sh /usr/local/bin/prometheusd
|
||||
|
||||
EXPOSE 53
|
||||
EXPOSE 53/udp
|
||||
EXPOSE 5000
|
||||
|
||||
VOLUME /var/lib/knot
|
||||
|
|
10
monit.conf
Normal file
10
monit.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
check process knot with pidfile /tmp/knot.pid
|
||||
start program = "/usr/sbin/knotd -d"
|
||||
stop program = "/usr/sbin/knotc stop"
|
||||
if 5 restarts within 8 cycles then alert
|
||||
if failed port 53 type udp protocol dns for 3 times within 5 cycles then restart
|
||||
if failed port 53 type tcp protocol dns for 3 times within 5 cycles then restart
|
||||
|
||||
check process prometheus with pidfile /tmp/prometheus.pid
|
||||
start program = "/usr/local/bin/prometheusd start"
|
||||
stop program = "/usr/local/bin/prometheusd stop"
|
12
prometheusd.sh
Executable file
12
prometheusd.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
STATS=${STATS:-/tmp/stats.yaml}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
rm -f /tmp/prometheus.pid
|
||||
daemonize -c /tmp -p /tmp/prometheus.pid -l /tmp/prometheus.pid -u knot /usr/bin/knot-prometheus-exporter ${STATS}
|
||||
;;
|
||||
stop) cat /tmp/prometheus.pid | xargs -r kill ;;
|
||||
esac
|
Loading…
Reference in a new issue