大网数据广告活动
服务器运维问答

Ceph alertmanager config

· 52CE 我爱测

I've installed ceph using cephadm Including monitoring stack prometheus , alertmanager , node-exporter Currently I'm trying to add a telegram receiver (Telegram is supported from v0.24.0, so I've manually updated mgr/container_im…

问题原文

原帖链接 · SergkeiM · CC BY-SA 4.0

I've installed ceph using cephadm

Including monitoring stack prometheus, alertmanager, node-exporter

Currently I'm trying to add a telegram receiver (Telegram is supported from v0.24.0, so I've manually updated mgr/container_image_alertmanager fro 0.23 to 0.24) for alertmanager, but can't find in docs where alertmanager.yml should be created.

I can see this file is created inside ceph cluster /var/lib/ceph/{hash}/alertmanager.ceph-1/etc/alertmanager/alertmanager.yml

I've added the config to the above file as below:

templates:
  - '/etc/alertmanager/config/*.tmpl'
route:
  receiver: 'default'
  routes:
    - group_by: ['alertname']
      group_wait: 10s
      group_interval: 10s
      repeat_interval: 30m
      receiver: 'telegram'
receivers:
- name: 'default'
  webhook_configs:
- name: 'ceph-dashboard'
  webhook_configs:
  - url: 'https://ceph-1:8443/api/prometheus_receiver'
- name: 'telegram'
  telegram_configs:
    - bot_token: <bot_token>
      chat_id: <chat_id>
      send_resolved: true
      parse_mode: 'HTML'
      api_url: 'https://api.telegram.org'
      message: '{{ template "telegram.text" . }}'

The receiver works fine, but after redeploying the alertmanager from Ceph dashboard the config is gone, and is logical, becuase I'm editing generated file.

Please if anyone can assist and/or point to correct direction where I should create alertmanager config to extend/override the defaults.

已采纳解答

原帖链接 · Ginnungagap · CC BY-SA 4.0

Reading the ceph manual regarding its monitoring, there's this part about using custom configuration for components of the stack.

Option names

The following templates for files that will be generated by cephadm can be overridden. These are the names to be used when storing with `ceph config-key set`:
 - services/alertmanager/alertmanager.yml
 - services/grafana/ceph-dashboard.yml
 - services/grafana/grafana.ini
 - services/prometheus/prometheus.yml
 - services/prometheus/alerting/custom_alerts.yml
 - services/loki.yml
 - services/promtail.yml

You can look up the file templates that are currently used by cephadm in src/pybind/mgr/cephadm/templates:
 - services/alertmanager/alertmanager.yml.j2
 - services/grafana/ceph-dashboard.yml.j2
 - services/grafana/grafana.ini.j2
 - services/prometheus/prometheus.yml.j2
 - services/loki.yml.j2
 - services/promtail.yml.j2

Simply take the ceph template, edit it to your liking and ceph config-key set it as the template to use when generating alert manager's configuration.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-11-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。