360 Secure SkillHub
360 安全技能中心

PagerDuty On-Call

该 Skill 提供脚本与说明,通过 PagerDuty REST API 执行事件查询、确认、触发、解决、备注、暂停、转派,以及查询当前值班人员、值班表、升级策略与服务列表。需设置 PAGERDUTY_API_KEY 环境变量,可选设置默认邮箱;高级操作可用 curl 直接调用接口。

fr3kstyle
fr3kstyle
热度 39.84
最近更新 2026-05-18 12:30:54
分类:自动化依赖:代码执行 / 第三方 API应用场景:DevOps / 自动化脚本 / API 集成 / 工作流 ...

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pagerduty-oncall
Metadata
name
pagerduty-oncall
description
Manage PagerDuty incidents, on-call schedules, escalation policies, and services via the PagerDuty REST API. Use when you need to: (1) List or acknowledge active incidents, (2) Trigger or resolve incidents, (3) Check who is on-call right now, (4) View escalation policies, (5) Manage PagerDuty services, (6) Get incident timelines or notes, (7) Snooze or reassign incidents, (8) Run PagerDuty operations from the agent. Requires PAGERDUTY_API_KEY env var.

PagerDuty On-Call Skill

Manage incidents and on-call operations via the PagerDuty REST API (v2).

Setup

export PAGERDUTY_API_KEY="your-api-key-here"
# Optional: set default email for actions that require it
export PAGERDUTY_FROM_EMAIL="oncall@yourcompany.com"

Get your API key: PagerDuty → User Icon → My Profile → User Settings → API Access Keys → Create New API Key

Core Workflows

List Active Incidents

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py incidents --status triggered,acknowledged

Acknowledge an Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py acknowledge --id P1234AB

Resolve an Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py resolve --id P1234AB

Trigger a New Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py trigger \
  --service-key "your-service-integration-key" \
  --description "Database is down" \
  --severity critical

Who is On-Call Right Now?

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py oncall
# With schedule filter:
python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py oncall --schedule-id PABC123

Get Incident Details

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py get --id P1234AB

List Services

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py services

List Escalation Policies

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py escalations

Add Note to Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py note --id P1234AB --message "Investigating DB failover"

Snooze Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py snooze --id P1234AB --duration 3600

Reassign Incident

python3 ~/.openclaw/workspace/skills/pagerduty-oncall/scripts/pd.py reassign --id P1234AB --user-id PU12345

Direct API Calls (Advanced)

For operations not covered by the script, use curl directly:

curl -s -H "Authorization: Token token=$PAGERDUTY_API_KEY" \
  -H "Accept: application/vnd.pagerduty+json;version=2" \
  "https://api.pagerduty.com/incidents?statuses[]=triggered&limit=25"

Key Concepts

  • Incidents: The core alert object. States: triggered → acknowledged → resolved
  • Services: Represent monitored systems/applications
  • Escalation Policies: Define who gets paged and when
  • Schedules: Define on-call rotation rotations
  • Integration Keys: Service-specific keys for triggering incidents

Common Tasks for Agents

  • Morning standup briefing: run incidents to check overnight alerts
  • On-call handoff: oncall + incidents for current state
  • Post-incident: get for timeline, then note to document RCA
  • Auto-acknowledge low-severity pages: incidents filtered by urgency, then acknowledge

API Rate Limits

  • 900 requests/minute for REST API
  • Events API (triggering): 120 events/minute per service
  • Use --limit flag to control result set size