返回顶部
p

pagerduty-agentPagerDuty代理管理

Manage PagerDuty incidents, on-call schedules, services, and maintenance windows directly from your agent.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
258
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

pagerduty-agent

PagerDuty Agent

⚠️ 这是一个非官方的社区技能,与 PagerDuty, Inc. 无关联且未获其认可。

无需离开你的代理工作流,即可触发、确认和解决 PagerDuty 事件,查看值班人员,管理维护窗口以及检查服务。

设置

  1. 1. 生成一个 PagerDuty API 密钥:PagerDuty → Integrations → API Access Keys → Create New Key
  2. 导出所需的环境变量:

bash
export PAGERDUTYAPIKEY=your-v2-api-key
export PAGERDUTYFROMEMAIL=you@yourcompany.com # 写操作必需

PAGERDUTYFROMEMAIL 必须是你的账户中有效 PagerDuty 用户的邮箱。PagerDuty 的 REST API 要求所有 POST/PUT 请求都提供此信息。

使用方法

所有命令均通过将 { command, params } JSON 对象管道传输至 node pagerduty.js 来调用。该技能在标准输出中返回结构化的 JSON。

bash
echo {command:list_incidents,params:{status:triggered}} | node pagerduty.js



命令

事件


trigger_incident

在某个服务上创建新事件。

参数

字段类型必填描述
service_idstringPagerDuty 服务 ID(例如 P1ABCDE)
title
string | ✓ | 事件标题/摘要 |
| severity | string | | critical、error、warning、info — 映射到紧急程度 |
| body | string | | 详细描述/操作手册上下文 |

示例

json
{
command: trigger_incident,
params: {
service_id: P1ABCDE,
title: 数据库复制延迟超过 60 秒,
severity: critical,
body: 副本 db-02 落后主库 90 秒。请检查 pgstatreplication。
}
}

响应

json
{
id: Q2W3E4R,
incident_number: 1042,
title: 数据库复制延迟超过 60 秒,
status: triggered,
urgency: high,
html_url: https://your-subdomain.pagerduty.com/incidents/Q2W3E4R,
created_at: 2026-03-04T12:00:00Z,
service: { id: P1ABCDE, name: 生产数据库 }
}



acknowledge_incident

确认一个事件,表示正在处理中。

参数

字段类型必填描述
incident_idstringPagerDuty 事件 ID

示例

json
{ command: acknowledgeincident, params: { incidentid: Q2W3E4R } }

响应

json
{
id: Q2W3E4R,
incident_number: 1042,
title: 数据库复制延迟超过 60 秒,
status: acknowledged,
acknowledged_at: 2026-03-04T12:03:00Z
}



resolve_incident

将事件标记为已解决。

参数

字段类型必填描述
incident_idstringPagerDuty 事件 ID

示例

json
{ command: resolveincident, params: { incidentid: Q2W3E4R } }

响应

json
{
id: Q2W3E4R,
incident_number: 1042,
title: 数据库复制延迟超过 60 秒,
status: resolved,
resolved_at: 2026-03-04T12:45:00Z
}



list_incidents

列出事件,可选择按状态过滤。

参数

字段类型必填描述
statusstringtriggered、acknowledged、resolved
limit
number | | 最大结果数(默认 25) |

示例

json
{
command: list_incidents,
params: { status: triggered, limit: 10 }
}

响应

json
{
total: 3,
limit: 10,
incidents: [
{
id: Q2W3E4R,
incident_number: 1042,
title: 数据库复制延迟超过 60 秒,
status: triggered,
urgency: high,
created_at: 2026-03-04T12:00:00Z,
service: { id: P1ABCDE, name: 生产数据库 },
assigned_to: [Alice Smith]
}
]
}



get_incident

获取单个事件的完整详情。

参数

字段类型必填描述
incident_idstringPagerDuty 事件 ID

示例

json
{ command: getincident, params: { incidentid: Q2W3E4R } }

响应

json
{
id: Q2W3E4R,
incident_number: 1042,
title: 数据库复制延迟超过 60 秒,
status: acknowledged,
urgency: high,
html_url: https://your-subdomain.pagerduty.com/incidents/Q2W3E4R,
created_at: 2026-03-04T12:00:00Z,
laststatuschange_at: 2026-03-04T12:03:00Z,
service: { id: P1ABCDE, name: 生产数据库 },
assigned_to: [Alice Smith],
escalation_policy: { id: P9XYZ12, name: 工程值班 },
body: 副本 db-02 落后主库 90 秒。请检查 pgstatreplication。
}



addincidentnote

在事件的时间线上添加一条带时间戳的备注。

参数

字段类型必填描述
incident_idstringPagerDuty 事件 ID
content
string | ✓ | 备注文本(支持 Markdown) |

示例

json
{
command: addincidentnote,
params: {
incident_id: Q2W3E4R,
content: 已确定根本原因:检查点完成时间飙升至 95%。已增加 maxwalsize 并重启备库。
}
}

响应

json
{
id: NOTE123,
content: 已确定根本原因...,
created_at: 2026-03-04T12:20:00Z,
user: Alice Smith
}



值班与排班




get_oncall

列出当前值班人员,可选择按排班范围过滤。

参数

字段类型必填描述
schedule_idstring过滤到特定的排班 ID

示例

json
{ command: getoncall, params: { scheduleid: SCHED01 } }

响应

json
{
oncalls: [
{
user: { id: UABC123, name: Alice Smith },
schedule: { id: SCHED01, name: 主要值班 },
escalation_policy: { id: P9XYZ12, name: 工程值班 },
escalation_level: 1,
start: 2026-03-04T08:00:00Z,
end: 2026-03-11T08:00:00Z
}
]
}



list_schedules

返回账户中的所有值班排

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 pagerduty-agent-1776208507 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 pagerduty-agent-1776208507 技能

通过命令行安装

skillhub install pagerduty-agent-1776208507

下载

⬇ 下载 pagerduty-agent v1.0.0(免费)

文件大小: 7.63 KB | 发布时间: 2026-4-15 13:11

v1.0.0 最新 2026-4-15 13:11
Initial release — trigger/acknowledge/resolve incidents, on-call schedules, services, maintenance windows. Zero deps, native REST, structured JSON, human-readable errors.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部