name: opsgenie-integration description: Opsgenie 告警管理和值班调度。用于列出告警、检查值班、计算 MTTA/MTTR 和告警疲劳分析。支持团队和优先级过滤。 allowed-tools: Bash(python *)
Opsgenie 集成
身份验证
重要:凭据由代理层自动注入。不要在环境变量中检查 OPSGENIE_API_KEY - 您将无法看到它。直接运行脚本;身份验证是透明处理的。
您可以检查的配置环境变量(非机密):
OPSGENIE_BASE_URL- 代理基础 URL(在生产中自动设置)OPSGENIE_API_URL- 自定义 API URL(默认:https://api.opsgenie.com)
可用脚本
所有脚本都在 .claude/skills/alerting-opsgenie/scripts/ 目录中
list_alerts.py - 列出告警
python .claude/skills/alerting-opsgenie/scripts/list_alerts.py [--status open] [--priority P1] [--query QUERY] [--max-results N]
get_alert.py - 获取告警详情
python .claude/skills/alerting-opsgenie/scripts/get_alert.py --alert-id ALERT_ID
get_alert_logs.py - 告警时间线
python .claude/skills/alerting-opsgenie/scripts/get_alert_logs.py --alert-id ALERT_ID [--max-results 50]
list_alerts_by_date_range.py - 历史告警带 MTTA/MTTR
python .claude/skills/alerting-opsgenie/scripts/list_alerts_by_date_range.py --since "2024-01-01T00:00:00Z" --until "2024-01-31T23:59:59Z" [--query QUERY]
list_services.py - 列出服务
python .claude/skills/alerting-opsgenie/scripts/list_services.py
list_teams.py - 列出团队
python .claude/skills/alerting-opsgenie/scripts/list_teams.py
get_on_call.py - 值班排班
python .claude/skills/alerting-opsgenie/scripts/get_on_call.py [--schedule-id ID] [--team-id ID]
get_alert_analytics.py - 告警疲劳分析
python .claude/skills/alerting-opsgenie/scripts/get_alert_analytics.py --since "2024-01-01T00:00:00Z" --until "2024-01-31T23:59:59Z" [--team-id ID]
calculate_mttr.py - MTTR 统计
python .claude/skills/alerting-opsgenie/scripts/calculate_mttr.py [--team-id ID] [--priority P1] [--days 30]
调查工作流程
值班与告警处理
1. 检查谁在值班:
get_on_call.py
2. 列出开放告警:
list_alerts.py --status open
3. 获取告警详情:
get_alert.py --alert-id <id>
4. 审查告警时间线:
get_alert_logs.py --alert-id <id>
告警疲劳分析
1. 获取告警分析:
get_alert_analytics.py --since "2024-01-01T00:00:00Z" --until "2024-01-31T23:59:59Z"
2. 审查嘈杂告警(高触发次数,低确认率)
3. 审查抖动告警(快速自动解决)
4. MTTR 按优先级:
calculate_mttr.py --priority P1 --days 30