tencentcloud-cls-alarm
БесплатноЗапускает вложенные скриптыНе проверенManage Tencent Cloud CLS alarm policies, notice groups, shields and alarm execution logs. Use when the user asks to: list / create / modify / delete CLS…
от AceDataCloud★ 17 звёзд на GitHubОб этом скилле
Tencent Cloud CLS — Alarm Management
CRUD on CLS alarm policies, notice groups, mute shields, and the alarm execution log.
Setup: See tencentcloud authentication. Defaults to
TENCENTCLOUD_REGIONfrom env; CLS alarms live per-region.Companion skill:
tencentcloud-clsfor log content search.
CLI (preferred)
The skill ships scripts/cls_alarm.py — wraps every alarm / notice / shield operation as a subcommand.
# $SKILL_DIR can point at another skill loaded this turn — anchor on our own
# script (re-run this at the top of every fresh-shell Bash block).
CLSA="$SKILL_DIR/scripts/cls_alarm.py"; [ -f "$CLSA" ] || CLSA=$(find /tmp -maxdepth 8 -path '*/skills/*/scripts/cls_alarm.py' 2>/dev/null | head -1)
[ -f "$CLSA" ] || { echo "tencentcloud-cls-alarm script not found (SKILL_DIR=$SKILL_DIR)" >&2; exit 1; }
python3 "$CLSA" alarms # list policies
python3 "$CLSA" alarm <alarm-id> # full detail
python3 "$CLSA" alarm-disable <alarm-id> # quick mute (Status=false)
python3 "$CLSA" alarm-enable <alarm-id>
python3 "$CLSA" alarm-create --json /tmp/alarm.json --dry-run
python3 "$CLSA" alarm-modify <alarm-id> --condition '$1.cnt > 20'
python3 "$CLSA" alarm-delete <alarm-id> --yes # destructive
python3 "$CLSA" notices # notice groups
python3 "$CLSA" notice <notice-id>
python3 "$CLSA" shields # mute rules
python3 "$CLSA" shield-create --notice-id <notice-id> --start $(date +%s) --end $(date -v+2H +%s) --type 1 --reason "deploy"
python3 "$CLSA" alarm-log --time 6h # firing history
For the rare schema field the CLI doesn't surface, fall through to the raw SDK examples below.
When to Use
- Inspect existing alarm policies (filter by name, enabled flag)
- Create a new log-based alarm: CQL/SQL query → trigger condition → notice group
- Modify thresholds, query, period, recipients
- Quick enable / disable to mute during incidents
- Manage notice groups (recipients: users, groups, webhooks, with escalation)
- Time-bounded shield rules to mute during deploys
- Pull the alarm execution log to see which alarms fired and when
Dependencies
pip install tencentcloud-sdk-python
Quick start
import os
import json
from tencentcloud.common import credential
from tencentcloud.cls.v20201016 import cls_client, models
cred = credential.EnvironmentVariableCredential().get_credential()
client = cls_client.ClsClient(cred, os.environ["TENCENTCLOUD_REGION"])
Key concepts
| Object | API methods | What it is |
|---|---|---|
| Alarm policy | DescribeAlarms / CreateAlarm / ModifyAlarm / DeleteAlarm |
Query against one or more topics + condition + notice groups |
| Notice group | DescribeAlarmNotices / CreateAlarmNotice / … |
Recipients (users / groups / webhooks) + escalation |
| Shield | DescribeAlarmShields / CreateAlarmShield / … |
Time-bounded mute scoped to a notice group |
| Alarm log | GetAlarmLog |
Firing history |
Workflows
List alarm policies
req = models.DescribeAlarmsRequest()
req.Limit = 100
# Optional filters: req.Filters = [{"Key": "name", "Values": ["DeepSeek"]}]
resp = client.DescribeAlarms(req)
for a in resp.Alarms:
print(a.AlarmId, a.Name, "Enable=", a.Enable, "Status=", a.Status)
Get a single alarm policy in full
req = models.DescribeAlarmsRequest()
req.Filters = [{"Key": "alarmId", "Values": ["<alarm-id>"]}]
resp = client.DescribeAlarms(req)
print(json.dumps(resp.Alarms[0]._serialize(), indent=2, ensure_ascii=False))
Create an alarm
req = models.CreateAlarmRequest()
req.Name = "OpenAI 5xx burst"
req.AlarmTargets = [{
"TopicId": "<trace-topic-id>",
"Query": "* | select count(*) as cnt where status_code >= 500",
"Number": 1,
"StartTimeOffset": -5,
"EndTimeOffset": 0,
"SyntaxRule": 1, # 1 = CQL, 0 = Lucene
}]
req.MonitorTime = {"Type": "Period", "Time": 1}
req.Condition = "$1.cnt > 10"
req.AlarmPeriod = 5 # evaluate every 5 minutes
req.TriggerCount = 1 # fire after 1 consecutive match
req.AlarmLevel = 2 # 0=Notice, 1=Warning, 2=Critical
req.AlarmNoticeIds = ["<notice-id-a>", "<notice-id-b>"]
req.MonitorObjectType = 0
req.Enable = True
resp = client.CreateAlarm(req)
print("Created", resp.AlarmId)
Quick enable / disable
req = models.ModifyAlarmRequest()
req.AlarmId = "<alarm-id>"
req.Status = False # mute (Status — runtime), keep Enable=True
client.ModifyAlarm(req)
EnablevsStatusare different fields.Enable=Falsearchives the alarm definition;Status=Falseis the everyday on/off switch you want for muting.
Modify thresholds without rewriting the whole payload
req = models.ModifyAlarmRequest()
req.AlarmId = "<alarm-id>"
req.Condition = "$1.cnt > 20"
req.AlarmPeriod =
Установить tencentcloud-cls-alarm в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tencentcloud-cls-alarm?
Manage Tencent Cloud CLS alarm policies, notice groups, shields and alarm execution logs. Use when the user asks to: list / create / modify / delete CLS alarms, enable or disable alarms, manage notice recipients (SMS / email / webhook), mute alarms during deploys, or view which alarms fired and when. For searching the underlying log content, use the companion `tencentcloud-cls` skill.
Как установить скилл tencentcloud-cls-alarm?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tencentcloud-cls-alarm запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic