Add Alerta plugins

Change-Id: If8bd0799efc02f51b0accef79b23ce07bffe9a6b
This commit is contained in:
Xiaoguang(William) Zhang 2020-09-30 18:49:32 +00:00 committed by Steven Fitzpatrick
parent 8a51d5dbcd
commit 6632dd8611
4 changed files with 18 additions and 0 deletions

View File

@ -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

3
alerta/alertad.conf Normal file
View File

@ -0,0 +1,3 @@
DEBUG = True
PLUGINS = ['enhance', 'forward', 'normalise', 'prometheus']
ALERTMANAGER_SILENCE_FROM_ACK = True

6
alerta/install-plugins.sh Executable file
View File

@ -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 </app/plugins.txt

4
alerta/plugins.txt Normal file
View File

@ -0,0 +1,4 @@
plugins/enhance master
plugins/forward master
plugins/normalise master
plugins/prometheus master