통합에 대하여:
Prometheus는 신뢰성과 확장성을 위해 설계된 강력한 오픈 소스 모니터링 및 알림 도구입니다. 이 가이드는 Freshservice 환경에 Prometheus를 통합하는 과정을 안내합니다.
Freshservice에서의 구성:
1단계:
관리자 패널로 이동하여 IT 운영 관리로 스크롤한 후 모니터링 도구를 선택합니다.
: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ;">
2단계:
현재 모니터링 도구 목록 페이지에 있습니다. 새로운 통합을 추가하려면 모니터링 도구 추가를 선택하세요.
; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; margin-bottom: 0px; margin-left: 0px; font-size: 16px; line-height: 1.6; word-break: normal; overflow-wrap: break-word; font-weight: 400; text-align: start; text-indent: 0px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif;">
3단계:
사전 구성된 통합 목록, 웹훅을 사용한 사용자 정의 통합의 게이트웨이 및 경고를 위한 채널로 이메일을 사용하는 옵션을 볼 수 있습니다. Prometheus.
opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; font-family: Arial, Helvetica, sans-serif;">
4단계:
URL과 인증 키가 생성됩니다. Prometheus에서 통합을 설정할 때 필요합니다.
Prometheus에서의 구성:
-
다음 파일/애플리케이션에 접근할 수 있고 최신 버전을 다운로드했는지 확인하십시오:
- Prometheus - 기기에 적합한 Prometheus 모니터링 시스템 버전을 다운로드하십시오
groups: - name: server_monitoring rules: - alert: ServerStatus expr: up == 0 for: 2s labels: severity: '{{ if eq .Value "0" }}critical{{ else }}info{{ end }}' annotations: summary: Server status is {{ if eq .Value "0" }}down{{ else }}up{{ end }}. description: The server status has changed to {{ if eq .Value "0" }}down{{ else }}up{{ end }} for more than 2 seconds.
# Global configurationglobal:
scrape_interval: 15s
evaluation_interval: 15s
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
# Load rules for evaluation
rule_files:
- 'prometheus.rules.yml'
- 'alert.rules.yml'
# Scrape configurations
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- targets: ["127.0.0.1:8080"]global: resolve_timeout: 5m route: group_by: ['alertname', 'severity'] group_wait: 10s group_interval: 1m repeat_interval: 3m receiver: 'webhook' receivers: - name: 'webhook' webhook_configs: - url: 'http://your-freshservice-webhook-url-here' send_resolved: true templates: - 'alertmanager/default.tmpl'
통합 테스트
1. 시스템에서 터미널을 열고 Prometheus 폴더로 이동합니다. 다음 명령을 실행하십시오.
prometheus --config.file=prometheus.yml
2. alertmanager 폴더로 이동하여 다음 명령어를 실행하세요
./alertmanager --config.file=alertmanager.yml
3. Node Exporter로 이동하여 다음 명령어를 실행하세요
./node_exporter --web.listen-address 127.0.0.1:8080
4. 다음 링크를 사용하여 로컬에서 Prometheus와 Alert Manager를 확인하세요:
- Prometheus: http://localhost:9090/alerts
-
AlertManager: http://localhost:9093/#/alerts
- 5. 치명적인 경고를 생성하려면, 터미널에서 Node Exporter 프로세스를 중지하여 서버 중단을 시뮬레이션하세요. 그런 다음 통합 테스트의 3단계에서 제공된 명령어를 다시 실행하여 서버를 온라인으로 복구하고 경고를 해제할 수 있습니다.