commit 6632dd8611ca350e05d866fa21e229188ca25c0d Author: Xiaoguang(William) Zhang Date: Wed Sep 30 18:49:32 2020 +0000 Add Alerta plugins Change-Id: If8bd0799efc02f51b0accef79b23ce07bffe9a6b diff --git a/alerta/Dockerfile b/alerta/Dockerfile index 71e8d86..1de4c34 100644 --- a/alerta/Dockerfile +++ b/alerta/Dockerfile @@ -31,6 +31,7 @@ RUN apt-get -y update && apt-get -y upgrade && apt-get -y install --no-install-r curl \ wget \ gcc \ + git \ python3.7 \ python3-pip \ python3-venv \ @@ -65,6 +66,10 @@ RUN pip3 --no-cache-dir install pip virtualenv && \ ENV PATH $PATH:/venv/bin RUN /venv/bin/pip --no-cache-dir install alerta==${CLIENT_VERSION} alerta-server==${SERVER_VERSION} +COPY install-plugins.sh /app/install-plugins.sh +COPY plugins.txt /app/plugins.txt +COPY alertad.conf /app/alertad.conf +RUN /app/install-plugins.sh ENV ALERTA_SVR_CONF_FILE /app/alertad.conf ENV ALERTA_CONF_FILE /app/alerta.conf diff --git a/alerta/alertad.conf b/alerta/alertad.conf new file mode 100644 index 0000000..d630618 --- /dev/null +++ b/alerta/alertad.conf @@ -0,0 +1,3 @@ +DEBUG = True +PLUGINS = ['enhance', 'forward', 'normalise', 'prometheus'] +ALERTMANAGER_SILENCE_FROM_ACK = True \ No newline at end of file diff --git a/alerta/install-plugins.sh b/alerta/install-plugins.sh new file mode 100755 index 0000000..8959c5d --- /dev/null +++ b/alerta/install-plugins.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +while read plugin version; do + echo "Installing '${plugin}' (${version})" + /venv/bin/pip --no-cache-dir install git+https://github.com/alerta/alerta-contrib.git@${version}#subdirectory=${plugin} +done