Notification program for Monit
Small notification program to send Monit alerts over Matrix. Signed-off-by: Luca Beltrame <lbeltrame@kde.org>
This commit is contained in:
parent
3aef4a4194
commit
d86c6ed4b8
1 changed files with 17 additions and 0 deletions
17
sysadmin/monit_matrix_alert.sh
Normal file
17
sysadmin/monit_matrix_alert.sh
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
warn_icon="⚠"
|
||||||
|
|
||||||
|
message=$(cat <<- EOF
|
||||||
|
${warn_icon} <strong>Service:</strong> $MONIT_SERVICE on $MONIT_HOST<br>
|
||||||
|
$MONIT_EVENT<br />
|
||||||
|
<strong>When:</strong> $MONIT_DATE <br/>
|
||||||
|
<strong>Info:</strong> $MONIT_DESCRIPTION <br/>)
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
/usr/local/bin/matrix-commander.py \
|
||||||
|
--credentials /etc/matrix-commander/credentials.json \
|
||||||
|
--store /var/lib/matrix-commander/store/ \
|
||||||
|
--html \
|
||||||
|
-m "${message}"
|
Loading…
Add table
Reference in a new issue