검색

7.3. Alertmanager Webhook 추가

download PDF

기존 Alertmanager 구성에 새 Webhook를 추가하여 스토리지 클러스터 상태에 대한 실시간 경고를 수신할 수 있습니다. 들어오는 Webhook를 활성화하여 타사 애플리케이션에 대한 비동기 메시지를 허용해야 합니다.

예를 들어 OSD가 Red Hat Ceph Storage 클러스터에서 다운된 경우 Google 채팅에서 알림을 보내도록 Alertmanager를 구성할 수 있습니다.

사전 요구 사항

  • 모니터링 스택 구성 요소가 활성화된 실행 중인 Red Hat Ceph Storage 클러스터입니다.
  • 수신 타사 애플리케이션에 구성된 들어오는 Webhook입니다.

프로세스

  1. cephadm 쉘에 로그인합니다.

    예제

    [root@host01 ~]# cephadm shell

  2. 알림에 Webhook를 사용하도록 Alertmanager를 구성합니다.

    구문

    service_type: alertmanager
    spec:
      user_data:
        default_webhook_urls:
        - "_URLS_"

    default_webhook_urls 는 기본 수신자의 webhook_configs 구성에 추가된 추가 URL 목록입니다.

    예제

    service_type: alertmanager
    spec:
      user_data:
        webhook_configs:
        - url: 'http:127.0.0.10:8080'

  3. Alertmanager 설정을 업데이트합니다.

    예제

    [ceph: root@host01 /]#  ceph orch reconfig alertmanager

검증

  • Alertmanager에서 Gchat로 알림의 예:

    예제

    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"

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.