Add alertmanager render script with optional thread id

This commit is contained in:
g4st3r
2026-03-07 17:50:19 +00:00
parent 7def3d708e
commit 403f33e2bb
3 changed files with 17 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env sh
set -e
tmp=/etc/alertmanager/alertmanager.yml
envsubst < /etc/alertmanager/alertmanager.tmpl.yml > "$tmp"
if [ -n "$TELEGRAM_THREAD_ID" ]; then
sed -i "s#__THREAD_LINE__#message_thread_id: $TELEGRAM_THREAD_ID#" "$tmp"
else
sed -i "s#__THREAD_LINE__##" "$tmp"
fi
exec /bin/alertmanager --config.file="$tmp" --storage.path=/alertmanager