modify-task-tpl

Generates and troubleshoots Nightingale alert self-healing scripts for the ibex task_tpl subsystem.

13.3k|1.8k|Updated Mar 3, 2020
One-click install
npx skills add https://github.com/ccfos/nightingale --skill modify-task-tpl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modify-task-tpl
Source: https://github.com/ccfos/nightingale/tree/main/aiagent/skill/embedded/builtin/modify-task-tpl
Command: npx skills add https://github.com/ccfos/nightingale --skill modify-task-tpl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Nightingale (n9e) alert self-healing scripts is error-prone: users confuse the stdin payload format with notification template syntax, misconfigure timeout and batch fields, expect recovery events that never fire, and risk running destructive commands on production hosts. This Skill produces correct, guarded task_tpl scripts and diagnoses common failures.

Core Features & Use Cases

  • Script generation with correct stdin handling: Produces shell, Python, Go, or PowerShell scripts that parse the flat JSON stdin payload (event labels plus alert_severity, alert_trigger_value, is_recovered) injected by the ibex callback.
  • Field semantics and validation guidance: Explains timeout defaults and limits, batch/tolerance/pause semantics, and CleanFields constraints so saved templates pass validation.
  • Safety guardrails: Refuses blacklisted destructive commands (rm -rf /, shutdown, dd to disk) and wraps graylist commands (systemctl restart, find -delete, docker prune) with locks, dry-run switches, and before/after state output.
  • Troubleshooting playbooks: Diagnoses stuck tasks, missing stdin labels caused by PromQL by-clause aggregation, and the misconception that is_recovered can trigger recovery actions.
  • Use Case: A user asks for a self-healing script that cleans logs older than 7 days when disk usage exceeds 90%; the Skill outputs a guarded bash script with stdin parsing, a 120-second timeout recommendation, and rollback notes.

Quick Start

Ask the assistant to write a Nightingale self-healing script that restarts a service when its port check alert fires, including stdin parsing and a cooldown guard.

Frequently Asked Questions about modify-task-tpl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Nightingale self-healing script that reads alert parameters?

Read the entire stdin payload as a flat JSON object of string key-value pairs, using jq in bash or json.load(sys.stdin) in Python. The payload contains the alert event labels plus injected keys alert_severity, alert_trigger_value, and is_recovered.

How does a Nightingale alert rule trigger a self-healing script?

Set the alert rule callbacks field to ${ibex}/<task_tpl_id>. When the alert fires, Nightingale dispatches the task_tpl script to the categraf agent on the host matching the event TargetIdent and passes the event labels through stdin.

Why is is_recovered always false in my self-healing script?

The ibex callback returns immediately for recovered events and never dispatches the task, so is_recovered in stdin is always the string false. To act on recovery, use a notify_rule with a callback channel that has recovery notifications enabled.

Why can't my self-healing script get the k8s namespace label?

Labels aggregated away by PromQL never reach stdin. Write the alert rule query with an explicit by clause, such as sum by (instance, namespace, deployment), so the labels survive into the event and the stdin payload.

What timeout should I set for a Nightingale self-healing task?

Timeout is in seconds, defaults to 30 when set to 0, and is capped at five days. Use 30-60 for service restarts, 120-300 for log or image cleanup, and 300-600 for heap dumps; the process is SIGKILLed after the timeout.

Why does my self-healing task stay running forever?

Common causes are a stdout feedback bug fixed in Nightingale v8.3.0, scripts with infinite loops that never exit, or network jitter preventing the kill signal from reaching categraf. Upgrade past v8.3.0 and add explicit timeouts and loop limits in the script.