@nuvlore/extension-bds 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +3 -0
- package/agents/bds-airflow-job-status-readonly.yaml +123 -0
- package/agents/bds-disk-investigator.yaml +112 -0
- package/agents/bds-inventory-readonly.yaml +60 -0
- package/agents/bds-oncall-reporter.yaml +113 -0
- package/agents/bds-prism-service-proxy-timeout-readonly.yaml +105 -0
- package/agents/bds-scylla-tenant-bucket-readonly.yaml +104 -0
- package/agents/bds-tenant-data-operation-log-readonly.yaml +98 -0
- package/agents/bds-yarn-app-health-readonly.yaml +114 -0
- package/agents/pharos-alert-investigator.yaml +81 -0
- package/package.json +60 -0
- package/skills/bds-airflow-job-status-investigation/SKILL.md +104 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-access-runbook.md +35 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-bas-dr-runbook.md +42 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-copy-and-migration-runbook.md +63 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-job-status-runbook.md +15 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-output-runbook.md +28 -0
- package/skills/bds-airflow-job-status-investigation/references/airflow-snapshot-runbook.md +38 -0
- package/skills/bds-disk-io-alert-investigation/SKILL.md +116 -0
- package/skills/bds-hadoop-review/SKILL.md +66 -0
- package/skills/bds-machine-inventory/SKILL.md +48 -0
- package/skills/bds-oncall-followup/SKILL.md +71 -0
- package/skills/bds-oncall-followup/references/oncall-followup-runbook.md +58 -0
- package/skills/bds-prism-service-proxy-timeout-investigation/SKILL.md +73 -0
- package/skills/bds-prism-service-proxy-timeout-investigation/references/service-proxy-timeout-runbook.md +48 -0
- package/skills/bds-scylla-tenant-bucket-investigation/SKILL.md +73 -0
- package/skills/bds-scylla-tenant-bucket-investigation/references/tenant-bucket-runbook.md +91 -0
- package/skills/bds-tenant-data-operation-log-investigation/SKILL.md +89 -0
- package/skills/bds-yarn-app-health-investigation/SKILL.md +77 -0
- package/skills/bds-yarn-app-health-investigation/references/yarn-app-health-runbook.md +53 -0
- package/skills/pharos-alert-investigation/SKILL.md +80 -0
- package/src/bds-atomic-log-tools.mjs +300 -0
- package/src/bds-team-membership-claude-output.mjs +36 -0
- package/src/bds-team-membership-quality.mjs +90 -0
- package/tools/bds_airflow_dag_log_read.mjs +24 -0
- package/tools/bds_airflow_job_status_command_pack.mjs +587 -0
- package/tools/bds_bas_log_read.mjs +23 -0
- package/tools/bds_bdm_httpd_log_read.mjs +24 -0
- package/tools/bds_chef_client_log_read.mjs +23 -0
- package/tools/bds_dashboard_links.mjs +178 -0
- package/tools/bds_dashboard_query_knowledge.mjs +258 -0
- package/tools/bds_dashboard_query_read.mjs +120 -0
- package/tools/bds_disk_io_alert_command_pack.mjs +287 -0
- package/tools/bds_environment_host_lookup.mjs +741 -0
- package/tools/bds_hdfs_datanode_log_read.mjs +23 -0
- package/tools/bds_hdfs_journalnode_log_read.mjs +23 -0
- package/tools/bds_hdfs_namenode_log_read.mjs +23 -0
- package/tools/bds_hdfs_path_knowledge.mjs +324 -0
- package/tools/bds_information_source_knowledge.mjs +356 -0
- package/tools/bds_kms_log_read.mjs +23 -0
- package/tools/bds_log_path_knowledge.mjs +267 -0
- package/tools/bds_machine_inventory.mjs +434 -0
- package/tools/bds_mapreduce_historyserver_log_read.mjs +23 -0
- package/tools/bds_migration_service_operation_command_pack.mjs +233 -0
- package/tools/bds_oncall_followup_payload_draft.mjs +285 -0
- package/tools/bds_pharos_query_pack.mjs +218 -0
- package/tools/bds_portal_operation_knowledge.mjs +212 -0
- package/tools/bds_prism_clone_status_links.mjs +129 -0
- package/tools/bds_prism_service_proxy_timeout_query_pack.mjs +224 -0
- package/tools/bds_public_cloud_pod_log_read.mjs +18 -0
- package/tools/bds_scylla_tenant_bucket_command_pack.mjs +323 -0
- package/tools/bds_service_proxy_log_read.mjs +23 -0
- package/tools/bds_spark_historyserver_log_read.mjs +32 -0
- package/tools/bds_spas_mt_log_read.mjs +23 -0
- package/tools/bds_tenant_data_operation_log_command_pack.mjs +321 -0
- package/tools/bds_yarn_app_health_command_pack.mjs +529 -0
- package/tools/bds_yarn_nodemanager_log_read.mjs +23 -0
- package/tools/bds_yarn_resourcemanager_log_read.mjs +23 -0
- package/tools/bds_zookeeper_log_read.mjs +23 -0
- package/tools/confluence_handoff_page_draft.mjs +173 -0
- package/vendor/dashboard/src/grafana-dashboard-query.mjs +61 -0
- package/vendor/extension-read-only-toolkit/LICENSE +202 -0
- package/vendor/extension-read-only-toolkit/README.md +29 -0
- package/vendor/extension-read-only-toolkit/package.json +46 -0
- package/vendor/extension-read-only-toolkit/src/devops-data-paths.mjs +222 -0
- package/vendor/extension-read-only-toolkit/src/devops-diagnostics.mjs +440 -0
- package/vendor/extension-read-only-toolkit/src/enterprise-api-read.mjs +180 -0
- package/vendor/extension-read-only-toolkit/src/read-only-command-pack.mjs +1 -0
- package/vendor/extension-read-only-toolkit/src/read-only-plan.mjs +45 -0
- package/vendor/extension-read-only-toolkit/src/read-only-shell-policy.d.mts +26 -0
- package/vendor/extension-read-only-toolkit/src/read-only-shell-policy.mjs +170 -0
- package/vendor/extension-workday-infra-access/LICENSE +202 -0
- package/vendor/extension-workday-infra-access/README.md +3 -0
- package/vendor/extension-workday-infra-access/agents/workday-infra-access-readonly.yaml +183 -0
- package/vendor/extension-workday-infra-access/package.json +49 -0
- package/vendor/extension-workday-infra-access/skills/workday-infra-access/SKILL.md +102 -0
- package/vendor/extension-workday-infra-access/skills/workday-infra-access/references/access-boundary-runbook.md +43 -0
- package/vendor/extension-workday-infra-access/skills/workday-infra-access/references/access-runbook.md +15 -0
- package/vendor/extension-workday-infra-access/skills/workday-infra-access/references/access-scylla-cloud-runbook.md +39 -0
- package/vendor/extension-workday-infra-access/skills/workday-infra-access/references/access-spc-argo-runbook.md +99 -0
- package/vendor/extension-workday-infra-access/src/workday-access-profiles.mjs +194 -0
- package/vendor/extension-workday-infra-access/tools/aws_cust_federated_readonly_command_pack.mjs +234 -0
- package/vendor/extension-workday-infra-access/tools/gcp_readonly_command_pack.mjs +167 -0
- package/vendor/extension-workday-infra-access/tools/public_cloud_access_status.mjs +48 -0
- package/vendor/extension-workday-infra-access/tools/workday_boundary_login.mjs +460 -0
- package/vendor/extension-workday-infra-access/tools/workday_private_cloud_sudo_readonly_command.mjs +386 -0
- package/vendor/extension-workday-infra-access/tools/workday_public_cloud_environment_map.mjs +189 -0
- package/vendor/extension-workday-infra-access/tools/workday_public_cloud_kubernetes_read.mjs +297 -0
- package/vendor/extension-workday-infra-access/tools/workday_public_cloud_spc_login.mjs +505 -0
- package/vendor/extension-workday-infra-access/tools/workday_spc_argo_readonly_command_pack.mjs +215 -0
- package/vendor/extension-workday-infra-access/workflows/public-cloud-readonly-investigation.js +99 -0
- package/workflows/bds-airflow-job-status-investigation.js +168 -0
- package/workflows/bds-disk-io-alert-investigation.js +173 -0
- package/workflows/bds-oncall-followup.js +112 -0
- package/workflows/bds-prism-service-proxy-timeout-investigation.js +69 -0
- package/workflows/bds-scylla-tenant-bucket-investigation.js +139 -0
- package/workflows/bds-tenant-data-operation-log-investigation.js +189 -0
- package/workflows/bds-yarn-app-health-investigation.js +217 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
export const description = "Generate a atomic-helper, read-only BDS storage command pack for disk IO, HDFS DataNode failed volumes, kernel medium errors, PERC virtual disks, physical disk predictive failure, and concise RCA handoff; does not SSH, inspect hosts, or call Pharos.";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { defineReadOnlyTool, fail, ok } from "@nuvlore/extension-read-only-toolkit/devops-diagnostics";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_ALERT_NAME = "bds_disk_kernel_daily_io_error_total";
|
|
7
|
+
const SAFETY_RULES = [
|
|
8
|
+
"read-only only: lsblk, df, findmnt, iostat, journalctl reads, omreport reads, smartctl health reads",
|
|
9
|
+
"never unmount, format, repair, fsck, xfs_repair, hdparm write, dd, wipefs, or modify RAID state",
|
|
10
|
+
"never restart services, stop workloads, mark disks offline, clear logs, delete data, or write files",
|
|
11
|
+
"never print LDAP passwords, Keychain payloads, tokens, or sudo stdin",
|
|
12
|
+
"if sudo is required, use mcp__devops-tool__workday_private_cloud_sudo_readonly_command; do not read Keychain directly"
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const hostSchema = z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(255)
|
|
19
|
+
.regex(/^(?!-)[a-zA-Z0-9._:@%-]+$/);
|
|
20
|
+
|
|
21
|
+
const identifierSchema = z
|
|
22
|
+
.string()
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(128)
|
|
25
|
+
.regex(/^[A-Za-z0-9_.:/@%-]+$/)
|
|
26
|
+
.optional();
|
|
27
|
+
|
|
28
|
+
const mountSchema = z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(128)
|
|
32
|
+
.regex(/^\/[A-Za-z0-9._/-]+$/)
|
|
33
|
+
.optional();
|
|
34
|
+
|
|
35
|
+
const timestampSchema = z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.max(64)
|
|
39
|
+
.regex(/^[0-9TZ:+ ._-]+$/)
|
|
40
|
+
.optional();
|
|
41
|
+
|
|
42
|
+
class ReadOnlyCommand {
|
|
43
|
+
constructor({ id, purpose, command, expectedEvidence }) {
|
|
44
|
+
this.id = id;
|
|
45
|
+
this.purpose = purpose;
|
|
46
|
+
this.command = command;
|
|
47
|
+
this.expectedEvidence = expectedEvidence;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
toMarkdown() {
|
|
51
|
+
return [
|
|
52
|
+
`### ${this.id}`,
|
|
53
|
+
`Purpose: ${this.purpose}`,
|
|
54
|
+
"",
|
|
55
|
+
"```bash",
|
|
56
|
+
this.command,
|
|
57
|
+
"```",
|
|
58
|
+
"",
|
|
59
|
+
`Evidence to capture: ${this.expectedEvidence}`
|
|
60
|
+
].join("\n");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
toJson() {
|
|
64
|
+
return {
|
|
65
|
+
id: this.id,
|
|
66
|
+
purpose: this.purpose,
|
|
67
|
+
command: this.command,
|
|
68
|
+
expectedEvidence: this.expectedEvidence
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
class CredentialHandlingGuide {
|
|
74
|
+
constructor({ sourceHost }) {
|
|
75
|
+
this.sourceHost = sourceHost;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
toMarkdown() {
|
|
79
|
+
return [
|
|
80
|
+
"## Credential Handling",
|
|
81
|
+
"",
|
|
82
|
+
"- Prefer read-only commands that do not need sudo, such as `lsblk`, `df`, `findmnt`, `iostat`, and many `omreport` reads.",
|
|
83
|
+
"- If sudo is needed for kernel journal or hardware health reads, use `workday_private_cloud_sudo_readonly_command`.",
|
|
84
|
+
"- Do not call Keychain directly from this command pack or from an agent.",
|
|
85
|
+
"",
|
|
86
|
+
"```json",
|
|
87
|
+
JSON.stringify({
|
|
88
|
+
tool: "mcp__devops-tool__workday_private_cloud_sudo_readonly_command",
|
|
89
|
+
input: {
|
|
90
|
+
action: "run",
|
|
91
|
+
host: this.sourceHost,
|
|
92
|
+
command: "journalctl -k --since '24 hours ago' | head -80",
|
|
93
|
+
humanApprovedSudoRead: true
|
|
94
|
+
}
|
|
95
|
+
}, null, 2),
|
|
96
|
+
"```"
|
|
97
|
+
].join("\n");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
class BdsDiskIoAlertCommandPack {
|
|
102
|
+
constructor(input) {
|
|
103
|
+
this.alertName = input.alertName ?? DEFAULT_ALERT_NAME;
|
|
104
|
+
this.cluster = input.cluster;
|
|
105
|
+
this.sourceHost = input.sourceHost;
|
|
106
|
+
this.device = input.device;
|
|
107
|
+
this.mountPoint = input.mountPoint;
|
|
108
|
+
this.physicalDisk = input.physicalDisk;
|
|
109
|
+
this.virtualDisk = input.virtualDisk;
|
|
110
|
+
this.sinceUtc = input.sinceUtc;
|
|
111
|
+
this.untilUtc = input.untilUtc;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
ssh(command) {
|
|
115
|
+
return `ssh -o BatchMode=yes -o ConnectTimeout=10 -- ${this.sourceHost} ${JSON.stringify(command)}`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
journalWindowArgs() {
|
|
119
|
+
const args = [];
|
|
120
|
+
if (this.sinceUtc) args.push(`--since=${JSON.stringify(this.sinceUtc)}`);
|
|
121
|
+
if (this.untilUtc) args.push(`--until=${JSON.stringify(this.untilUtc)}`);
|
|
122
|
+
if (args.length === 0) args.push("--since='24 hours ago'");
|
|
123
|
+
return args.join(" ");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
deviceFilter() {
|
|
127
|
+
return this.device ? this.device.replace(/^\/dev\//, "") : "sd[a-z]|nvme";
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
commands() {
|
|
131
|
+
const deviceName = this.deviceFilter();
|
|
132
|
+
const physicalDisk = this.physicalDisk ?? "0:1:8";
|
|
133
|
+
const virtualDisk = this.virtualDisk ?? "9";
|
|
134
|
+
const mountPoint = this.mountPoint ?? "/hadoop/disk9";
|
|
135
|
+
return [
|
|
136
|
+
new ReadOnlyCommand({
|
|
137
|
+
id: "01-host-identity",
|
|
138
|
+
purpose: "Confirm host identity, UTC clock, boot time, kernel, and whether sudo currently has a cached timestamp.",
|
|
139
|
+
command: this.ssh("hostname -f; date -u; uptime -s; uname -a; sudo -n true >/dev/null 2>&1; echo SUDO_N_STATUS_$?"),
|
|
140
|
+
expectedEvidence: "host, UTC time anchor, boot time, kernel version, sudo timestamp availability"
|
|
141
|
+
}),
|
|
142
|
+
new ReadOnlyCommand({
|
|
143
|
+
id: "02-disk-topology",
|
|
144
|
+
purpose: "Map OS block devices to model, serial, filesystem, and mount point.",
|
|
145
|
+
command: this.ssh("lsblk -d -o NAME,MAJ:MIN,MODEL,SERIAL,SIZE,ROTA,STATE,TRAN,HCTL; lsblk -o NAME,KNAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUID,MODEL,SERIAL"),
|
|
146
|
+
expectedEvidence: "device to mount mapping, especially impacted data disk and backing controller logical disk"
|
|
147
|
+
}),
|
|
148
|
+
new ReadOnlyCommand({
|
|
149
|
+
id: "03-filesystem-state",
|
|
150
|
+
purpose: "Confirm whether the impacted filesystem is mounted, capacity, and current usage.",
|
|
151
|
+
command: this.ssh(`df -hT; findmnt -D | egrep '${mountPoint}|SOURCE|TARGET'`),
|
|
152
|
+
expectedEvidence: "mount state, filesystem type, capacity, used/free percentage"
|
|
153
|
+
}),
|
|
154
|
+
new ReadOnlyCommand({
|
|
155
|
+
id: "04-realtime-io",
|
|
156
|
+
purpose: "Check whether the alert is accompanied by current high iowait, queue depth, latency, or device utilization.",
|
|
157
|
+
command: this.ssh("iostat -xz 1 3"),
|
|
158
|
+
expectedEvidence: "current await, aqu-sz, util, iowait, and whether the issue is active under current workload"
|
|
159
|
+
}),
|
|
160
|
+
new ReadOnlyCommand({
|
|
161
|
+
id: "05-kernel-io-errors",
|
|
162
|
+
purpose: "Read bounded kernel evidence for disk medium errors, timeouts, resets, and unrecovered reads.",
|
|
163
|
+
command: this.ssh(`sudo -n journalctl -k ${this.journalWindowArgs()} --no-pager | egrep -i 'I/O error|blk_update_request|critical medium|medium error|uncorrect|failed command|reset|timeout|sense key|Buffer I/O|end_request|megaraid|${deviceName}' | tail -300`),
|
|
164
|
+
expectedEvidence: "kernel timestamps, OS device, sector/LBA, SCSI sense key, PERC physical disk and virtual disk references"
|
|
165
|
+
}),
|
|
166
|
+
new ReadOnlyCommand({
|
|
167
|
+
id: "06-dell-controller",
|
|
168
|
+
purpose: "Read Dell controller state without changing RAID configuration.",
|
|
169
|
+
command: this.ssh("/opt/dell/srvadmin/bin/omreport storage controller"),
|
|
170
|
+
expectedEvidence: "controller status, firmware, driver, patrol read state, cache and policy details"
|
|
171
|
+
}),
|
|
172
|
+
new ReadOnlyCommand({
|
|
173
|
+
id: "07-dell-virtual-disk",
|
|
174
|
+
purpose: "Confirm impacted virtual disk status, layout, bad block state, OS device, and redundancy level.",
|
|
175
|
+
command: this.ssh(`/opt/dell/srvadmin/bin/omreport storage vdisk controller=0 vdisk=${virtualDisk}`),
|
|
176
|
+
expectedEvidence: "virtual disk status, RAID layout, bad block flag, device name"
|
|
177
|
+
}),
|
|
178
|
+
new ReadOnlyCommand({
|
|
179
|
+
id: "08-dell-physical-disk",
|
|
180
|
+
purpose: "Confirm physical disk predictive failure and hardware identity for replacement.",
|
|
181
|
+
command: this.ssh(`/opt/dell/srvadmin/bin/omreport storage pdisk controller=0 pdisk=${physicalDisk}`),
|
|
182
|
+
expectedEvidence: "physical disk status, `Failure Predicted`, serial, part number, SAS address, capacity"
|
|
183
|
+
}),
|
|
184
|
+
new ReadOnlyCommand({
|
|
185
|
+
id: "09-dell-alert-log",
|
|
186
|
+
purpose: "Correlate Dell storage alert log with kernel errors and alert firing time.",
|
|
187
|
+
command: this.ssh(`/opt/dell/srvadmin/bin/omreport system alertlog | egrep -A4 -B1 'PDR64|VDR58|${physicalDisk}|Virtual Disk ${virtualDisk}' | head -260`),
|
|
188
|
+
expectedEvidence: "PDR64, VDR58, STOR0210, timestamps, and repeated error cadence"
|
|
189
|
+
}),
|
|
190
|
+
new ReadOnlyCommand({
|
|
191
|
+
id: "10-health-summary",
|
|
192
|
+
purpose: "Summarize risk without performing remediation.",
|
|
193
|
+
command: this.ssh(`printf 'device=${this.device ?? "unknown"}\\nmount=${mountPoint}\\nphysicalDisk=${physicalDisk}\\nvirtualDisk=${virtualDisk}\\n'`),
|
|
194
|
+
expectedEvidence: "stable identifiers to include in RCA and handoff"
|
|
195
|
+
})
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
toMarkdown() {
|
|
200
|
+
return [
|
|
201
|
+
"# BDS Disk IO Alert Read-Only Command Pack",
|
|
202
|
+
"",
|
|
203
|
+
`Alert: ${this.alertName}`,
|
|
204
|
+
this.cluster ? `Cluster: ${this.cluster}` : "",
|
|
205
|
+
`Source host: ${this.sourceHost}`,
|
|
206
|
+
this.device ? `Device: ${this.device}` : "",
|
|
207
|
+
this.mountPoint ? `Mount point: ${this.mountPoint}` : "",
|
|
208
|
+
this.physicalDisk ? `Physical disk: ${this.physicalDisk}` : "",
|
|
209
|
+
this.virtualDisk ? `Virtual disk: ${this.virtualDisk}` : "",
|
|
210
|
+
"",
|
|
211
|
+
"## Safety Boundary",
|
|
212
|
+
"",
|
|
213
|
+
...SAFETY_RULES.map((rule) => `- ${rule}`),
|
|
214
|
+
"",
|
|
215
|
+
new CredentialHandlingGuide({
|
|
216
|
+
sourceHost: this.sourceHost
|
|
217
|
+
}).toMarkdown(),
|
|
218
|
+
"",
|
|
219
|
+
"## Read-Only Commands",
|
|
220
|
+
"",
|
|
221
|
+
...this.commands().map((command) => command.toMarkdown()),
|
|
222
|
+
"",
|
|
223
|
+
"Procedure, interpretation, and RCA shape live in the `bds-disk-io-alert-investigation` skill."
|
|
224
|
+
].filter(Boolean).join("\n");
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
toJson() {
|
|
228
|
+
return {
|
|
229
|
+
alertName: this.alertName,
|
|
230
|
+
cluster: this.cluster,
|
|
231
|
+
sourceHost: this.sourceHost,
|
|
232
|
+
device: this.device,
|
|
233
|
+
mountPoint: this.mountPoint,
|
|
234
|
+
physicalDisk: this.physicalDisk,
|
|
235
|
+
virtualDisk: this.virtualDisk,
|
|
236
|
+
safetyBoundary: SAFETY_RULES,
|
|
237
|
+
commands: this.commands().map((command) => command.toJson())
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function buildResponse(input) {
|
|
243
|
+
const commandPack = new BdsDiskIoAlertCommandPack(input);
|
|
244
|
+
if (input.format === "json") {
|
|
245
|
+
return JSON.stringify(commandPack.toJson(), null, 2);
|
|
246
|
+
}
|
|
247
|
+
return commandPack.toMarkdown();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const sharedTool = defineReadOnlyTool({
|
|
251
|
+
name: "bds_disk_io_alert_command_pack",
|
|
252
|
+
description: "Generate a atomic-helper, read-only BDS storage command pack for disk IO, HDFS DataNode failed volumes, kernel medium errors, PERC virtual disks, physical disk predictive failure, and concise RCA handoff; does not SSH, inspect hosts, or call Pharos.",
|
|
253
|
+
meta: {
|
|
254
|
+
permissions: { rule: "ask" },
|
|
255
|
+
secret_provider: "keychain"
|
|
256
|
+
},
|
|
257
|
+
inputSchema: {
|
|
258
|
+
alertName: z.string().min(1).max(128).default(DEFAULT_ALERT_NAME),
|
|
259
|
+
cluster: z.string().min(1).max(128).regex(/^[A-Za-z0-9_.:-]+$/).optional(),
|
|
260
|
+
sourceHost: hostSchema.describe("Alert source host to inspect with read-only SSH commands."),
|
|
261
|
+
device: identifierSchema.describe("Optional impacted OS device, for example /dev/sdk or sdk."),
|
|
262
|
+
mountPoint: mountSchema.describe("Optional impacted mount point, for example /hadoop/disk9."),
|
|
263
|
+
physicalDisk: identifierSchema.describe("Optional Dell physical disk ID, for example 0:1:8."),
|
|
264
|
+
virtualDisk: identifierSchema.describe("Optional Dell virtual disk ID, for example 9."),
|
|
265
|
+
sinceUtc: timestampSchema.describe("Optional UTC lower bound for journal reads."),
|
|
266
|
+
untilUtc: timestampSchema.describe("Optional UTC upper bound for journal reads."),
|
|
267
|
+
format: z.enum(["markdown", "json"]).default("markdown")
|
|
268
|
+
},
|
|
269
|
+
annotations: { openWorldHint: true },
|
|
270
|
+
async handler(input) {
|
|
271
|
+
try {
|
|
272
|
+
return ok(buildResponse(input));
|
|
273
|
+
} catch (error) {
|
|
274
|
+
return fail(error);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
export default {
|
|
280
|
+
name: sharedTool.name,
|
|
281
|
+
description,
|
|
282
|
+
inputSchema: sharedTool.inputSchema,
|
|
283
|
+
meta: sharedTool.meta,
|
|
284
|
+
annotations: sharedTool.annotations,
|
|
285
|
+
invoke: sharedTool.invoke,
|
|
286
|
+
handler: sharedTool.handler
|
|
287
|
+
};
|