测试方案: - lm2机器端口映射到本机:18080, 18081, 8082-8085 - 访问URL: http://localhost:18080/dashboard       端到端测试通过:  Co-authored-by: sundapeng.sdp <sundapeng@hashdata.cn> Reviewed-on: #35 Reviewed-by: xuxt <xuxt@zgclab.edu.cn> Reviewed-by: sundapeng <sundp@mail.zgclab.edu.cn> Reviewed-by: huhy <husteryezi@163.com>
26 lines
894 B
Bash
26 lines
894 B
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
echo "[INFO] Starting Alertmanager under supervisor..."
|
|
|
|
ALERTMANAGER_BASE_PATH=${ALERTMANAGER_BASE_PATH:-/private/argus/alert/alertmanager}
|
|
|
|
echo "[INFO] Alertmanager base path: ${ALERTMANAGER_BASE_PATH}"
|
|
|
|
# 使用容器内的 /etc/alertmanager/alertmanager.yml 作为配置文件,避免写入挂载卷导致的权限问题
|
|
echo "[INFO] Using /etc/alertmanager/alertmanager.yml as configuration"
|
|
|
|
|
|
# 记录容器 IP 地址
|
|
DOMAIN=alertmanager.alert.argus.com
|
|
IP=$(ifconfig | grep -A 1 eth0 | grep inet | awk '{print $2}')
|
|
echo "current IP: ${IP}"
|
|
echo "${IP}" > /private/argus/etc/${DOMAIN}
|
|
chmod 755 /private/argus/etc/${DOMAIN}
|
|
|
|
|
|
echo "[INFO] Starting Alertmanager process..."
|
|
|
|
# 启动 Alertmanager 主进程
|
|
exec /usr/local/alertmanager/alertmanager --config.file=/etc/alertmanager/alertmanager.yml --storage.path=/alertmanager --cluster.listen-address=""
|