Incluindo webhooks do Alertmanager
É possível incluir novos webhooks em uma configuração do Alertmanager existente para receber alertas em tempo real sobre o funcionamento do cluster de armazenamento É necessário ativar webhooks de entrada para permitir mensagens assíncronas em aplicativos de terceiros
Por exemplo, se um OSD estiver inativo em um cluster do IBM Storage Ceph , será possível configurar o Alertmanager para enviar notificação no bate-papo do Google .
Pré-requisitos
Um cluster do IBM Storage Ceph em execução com componentes de pilha de monitoramento ativados
Webhooks de entrada configurados no aplicativo de terceiros de recebimento
Procedimento
Efetue login no shell
cephadm:Exemplo
[root@host01 ~]# cephadm shellConfigure o Alertmanager para usar o webhook para notificação:
Sintaxe
service_type: alertmanager spec: user_data: default_webhook_urls: - "_URLS_"A configuração de 'default_webhook_urls
is a list of additional URLs that are added to the default receivers’webhook_configs `Exemplo
service_type: alertmanager spec: user_data: webhook_configs: - url: 'http:127.0.0.10:8080'Atualizar configuração do Alertmanager:
Exemplo
[ceph: root@host01 /]# ceph orch reconfig alertmanager
Verificação
Uma notificação de exemplo de Alertmanager para Gchat:
Exemplo
using: https://chat.googleapis.com/v1/spaces/(xx- space identifyer -xx)/messages posting: {'status': 'resolved', 'labels': {'alertname': 'PrometheusTargetMissing', 'instance': 'postgres-exporter.host03.chest response: 200 response: { "name": "spaces/(xx- space identifyer -xx)/messages/3PYDBOsIofE.3PYDBOsIofE", "sender": { "name": "users/114022495153014004089", "displayName": "monitoring", "avatarUrl": "", "email": "", "domainId": "", "type": "BOT", "isAnonymous": false, "caaEnabled": false }, "text": "Prometheus target missing (instance postgres-exporter.cluster.local:9187)\n\nA Prometheus target has disappeared. An e "cards": [], "annotations": [], "thread": { "name": "spaces/(xx- space identifyer -xx)/threads/3PYDBOsIofE" }, "space": { "name": "spaces/(xx- space identifyer -xx)", "type": "ROOM", "singleUserBotDm": false, "threaded": false, "displayName": "_privmon", "legacyGroupChat": false }, "fallbackText": "", "argumentText": "Prometheus target missing (instance postgres-exporter.cluster.local:9187)\n\nA Prometheus target has disappea "attachment": [], "createTime": "2022-06-06T06:17:33.805375Z", "lastUpdateTime": "2022-06-06T06:17:33.805375Z"