Skip to main content 首页 创作者 cinience alicloud-skills aliyun-sls-openclaw-integration
aliyun-sls-openclaw-integration Use when the user needs to integrate OpenClaw with Alibaba Cloud SLS/Observability, including collector setup, machine groups, indexes, dashboards, collection configs, or Logtail bindings on Linux.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cinience/alicloud-skills --skill aliyun-sls-openclaw-integration命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... alicloud-acs-agent-sandbox Bootstrap, create, connect to, operate, secure, scale, upgrade, troubleshoot, inspect, and tear down Alibaba Cloud Container Compute Service (ACS) Agent Sandbox environments. Use for zero-to-Sandbox deployments from VPC and ACS cluster creation, Sandbox, SandboxSet, SandboxClaim, Checkpoint, SandboxUpdateOps, E2B SDK integration, tenant API keys and quotas, OSS or NAS CSI mounts, TrafficPolicy and SecurityProfile controls, SandboxGateway routing, Prometheus monitoring, ACK-based deployments, or ACK One multi-cluster fleet operations.
name aliyun-sls-openclaw-integration description Use when the user needs to integrate OpenClaw with Alibaba Cloud SLS/Observability, including collector setup, machine groups, indexes, dashboards, collection configs, or Logtail bindings on Linux. metadata {"openclaw":{"emoji":"📊","requires":{"bins":"[Truncated]"}}}
OpenClaw SLS Integration
This skill provisions Alibaba Cloud SLS observability for OpenClaw on Linux and keeps reruns safe.
At a high level, execute this flow:
Check and install aliyun CLI (install latest when missing)
Install LoongCollector by project region (skip if already running)
Create an identifier-based machine group (local identifier + cloud machine group)
Create logstore index and dashboards
Create logstore collection config
Bind the collection config to the machine group
Capture Intent Before Execution
Before running commands, make sure the user intent is complete:
Confirm the target PROJECT and LOGSTORE.
Confirm Linux host access with sudo available.
Confirm AK/SK are already exported in environment variables.
If any required input is missing, ask for it first and do not run partial setup.
Prerequisites
Required:
PROJECT: SLS project name
LOGSTORE: SLS logstore name
Read from environment variables:
ALIBABACLOUD_ACCESS_KEY_ID
ALIBABACLOUD_ACCESS_KEY_SECRET
ALIYUN_UID (used for the local UID file under /etc/ilogtail/users)
Recommended optional:
ALIBABACLOUD_REGION_ID (auto-resolved from PROJECT when not set)
If you use different AK/SK variable names, export them to these standard names first.
Expected Result
After successful execution, the environment should contain:
Running LoongCollector (or ilogtaild) on the host
Machine group openclaw-sls-collector
Logstore index created on the target LOGSTORE
Dashboards openclaw-audit and openclaw-gateway
Collection config openclaw-audit_${LOGSTORE}
Config binding between openclaw-audit_${LOGSTORE} and openclaw-sls-collector
One-Time Execution Flow (Idempotent)
The commands below are designed as "exists -> skip" and are safe to rerun.
Strict template mode: for index/config/dashboard payloads, always read from files in references/.
Do not handcraft or simplify JSON bodies beyond required placeholder replacement.
set -euo pipefail
: "${PROJECT:?Please export PROJECT} "
: "${LOGSTORE:?Please export LOGSTORE} "
: "${ALIBABACLOUD_ACCESS_KEY_ID:?Please export ALIBABACLOUD_ACCESS_KEY_ID} "
: "${ALIBABACLOUD_ACCESS_KEY_SECRET:?Please export ALIBABACLOUD_ACCESS_KEY_SECRET} "
: "${ALIYUN_UID:?Please export ALIYUN_UID} "
MACHINE_GROUP="openclaw-sls-collector"
CONFIG_NAME="openclaw-audit_${LOGSTORE} "
if ! command -v aliyun >/dev/null 2>&1; then
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y aliyun-cli
elif command -v dnf >/dev/null 2>&1; then
sudo dnf install -y aliyun-cli
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y aliyun-cli
elif command -v zypper >/dev/null 2>&1; then
sudo zypper -n install aliyun-cli
else
echo "aliyun CLI not found. Install aliyun-cli manually for your Linux distribution." >&2
exit 1
fi
fi
export ALIBABACLOUD_ACCESS_KEY_ID
ALIBABACLOUD_ACCESS_KEY_SECRET
() {
/etc/init.d/loongcollectord status 2>/dev/null | grep -qi ;
0
/etc/init.d/ilogtaild status 2>/dev/null | grep -qi ;
0
1
}
REGION_ID=
[ -z ];
REGION_ID=
[ -z ];
>&2
1
! is_loong_running;
wget -O loongcollector.sh
+x loongcollector.sh
./loongcollector.sh install
! is_loong_running;
/etc/init.d/loongcollectord start >/dev/null 2>&1 ||
/etc/init.d/ilogtaild start >/dev/null 2>&1 ||
! is_loong_running;
>&2
1
-p /etc/ilogtail
-p /etc/ilogtail/users
[ ! -f /etc/ilogtail/user_defined_id ];
/etc/ilogtail/user_defined_id
RAND8=
USER_DEFINED_ID_PREFIX=
EXISTING_USER_DEFINED_ID=
[ -n ];
USER_DEFINED_ID=
USER_DEFINED_ID=
| -a /etc/ilogtail/user_defined_id >/dev/null
! grep -Fxq /etc/ilogtail/user_defined_id 2>/dev/null;
>&2
1
[ ! -f ];
[ ! -f ];
>&2
1
! aliyun sls GetMachineGroup --project --machineGroup >/dev/null 2>&1;
> /tmp/openclaw-machine-group.json <<
aliyun sls CreateMachineGroup \
--project \
--body
! aliyun sls GetMachineGroup --project --machineGroup >/dev/null 2>&1;
>&2
1
! aliyun sls GetLogStore --project --logstore >/dev/null 2>&1;
aliyun sls CreateLogStore --project \
--body
! aliyun sls GetIndex --project --logstore >/dev/null 2>&1;
aliyun sls CreateIndex \
--project \
--logstore \
--body
sed references/dashboard-audit.json > /tmp/openclaw-audit-dashboard.json
sed references/dashboard-gateway.json > /tmp/openclaw-gateway-dashboard.json
aliyun sls GET --project >/dev/null 2>&1;
aliyun sls PUT \
--project \
--body
aliyun sls POST \
--project \
--body
aliyun sls GET --project >/dev/null 2>&1;
aliyun sls PUT \
--project \
--body
aliyun sls POST \
--project \
--body
sed \
-e \
-e \
-e \
references/collector-config.json > /tmp/openclaw-collector-config.json
aliyun sls GetConfig --project --configName >/dev/null 2>&1;
aliyun sls UpdateConfig \
--project \
--configName \
--body
aliyun sls CreateConfig \
--project \
--body
aliyun sls ApplyConfigToMachineGroup \
--project \
--machineGroup \
--configName
Response Format
When this skill completes, return a concise status report with:
Inputs used: PROJECT, LOGSTORE, resolved REGION_ID
Created/updated resources (machine group, index, dashboards, config, binding)
Any skipped steps (already existed / already running)
Next verification commands for the user
Verification Commands
aliyun sls GetMachineGroup --project "$PROJECT " --machineGroup openclaw-sls-collector
aliyun sls GetIndex --project "$PROJECT " --logstore "$LOGSTORE "
aliyun sls GetDashboard --project "$PROJECT " --dashboardName openclaw-audit
aliyun sls GetDashboard --project "$PROJECT " --dashboardName openclaw-gateway
aliyun sls GetConfig --project "$PROJECT " --configName "openclaw-audit_${LOGSTORE} "
Reference Files
Command flow: references/cli-commands.md
Index definition: references/index.json
Dashboard templates: references/dashboard-audit.json, references/dashboard-gateway.json
Collection config template: references/collector-config.json
Read reference files only when needed:
Use cli-commands.md for step-by-step troubleshooting.
Use JSON templates when creating/updating resources.
export
is_loong_running
if
sudo
"running"
then
return
fi
if
sudo
"running"
then
return
fi
return
"${ALIBABACLOUD_REGION_ID:-} "
if
"$REGION_ID "
then
"$(aliyun sls GetProject --project "$PROJECT " --cli-query 'region' --quiet 2>/dev/null | tr -d '\"' || true) "
fi
if
"$REGION_ID "
then
echo
"Cannot resolve region from project: $PROJECT . Please set ALIBABACLOUD_REGION_ID."
exit
fi
if
then
"https://aliyun-observability-release-${REGION_ID} .oss-${REGION_ID} .aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh"
chmod
"${REGION_ID} "
fi
if
then
sudo
true
sudo
true
fi
if
then
echo
"LoongCollector installation check failed: neither loongcollectord nor ilogtaild is running."
exit
fi
sudo
mkdir
sudo
mkdir
if
then
sudo
touch
fi
"$(LC_ALL=C tr -dc 'a-z0-9' </dev/urandom | head -c 8) "
"${PROJECT} _openclaw_sls_collector_"
"$(sudo awk -v p="${USER_DEFINED_ID_PREFIX} " 'index($0,p) ==1 {print; exit}' /etc/ilogtail/user_defined_id 2>/dev/null || true)"
if
"${EXISTING_USER_DEFINED_ID} "
then
"${EXISTING_USER_DEFINED_ID} "
else
"${USER_DEFINED_ID_PREFIX} ${RAND8} "
echo
"${USER_DEFINED_ID} "
sudo
tee
fi
if
sudo
"${USER_DEFINED_ID} "
then
echo
"Failed to persist USER_DEFINED_ID to /etc/ilogtail/user_defined_id"
exit
fi
if
"/etc/ilogtail/users/${ALIYUN_UID} "
then
sudo
touch
"/etc/ilogtail/users/${ALIYUN_UID} "
fi
if
"/etc/ilogtail/users/${ALIYUN_UID} "
then
echo
"Failed to create UID marker file: /etc/ilogtail/users/${ALIYUN_UID} "
exit
fi
if
"$PROJECT "
"$MACHINE_GROUP "
then
cat
EOF
{
"groupName": "${MACHINE_GROUP}",
"groupType": "",
"machineIdentifyType": "userdefined",
"machineList": ["${USER_DEFINED_ID}"]
}
EOF
"$PROJECT "
"$(cat /tmp/openclaw-machine-group.json) "
fi
if
"$PROJECT "
"$MACHINE_GROUP "
then
echo
"Machine group was not created successfully: ${MACHINE_GROUP} "
exit
fi
if
"$PROJECT "
"$LOGSTORE "
then
"$PROJECT "
"{\"logstoreName\":\"${LOGSTORE} \",\"ttl\":30,\"shardCount\":2}"
fi
if
"$PROJECT "
"$LOGSTORE "
then
"$PROJECT "
"$LOGSTORE "
"$(cat references/index.json) "
fi
"s/\${logstoreName}/${LOGSTORE} /g"
"s/\${logstoreName}/${LOGSTORE} /g"
if
"/dashboards/openclaw-audit"
"$PROJECT "
then
"/dashboards/openclaw-audit"
"$PROJECT "
"$(cat /tmp/openclaw-audit-dashboard.json) "
else
"/dashboards"
"$PROJECT "
"$(cat /tmp/openclaw-audit-dashboard.json) "
fi
if
"/dashboards/openclaw-gateway"
"$PROJECT "
then
"/dashboards/openclaw-gateway"
"$PROJECT "
"$(cat /tmp/openclaw-gateway-dashboard.json) "
else
"/dashboards"
"$PROJECT "
"$(cat /tmp/openclaw-gateway-dashboard.json) "
fi
"s/\${configName}/${CONFIG_NAME} /g"
"s/\${logstoreName}/${LOGSTORE} /g"
"s/\${region_id}/${REGION_ID} /g"
if
"$PROJECT "
"$CONFIG_NAME "
then
"$PROJECT "
"$CONFIG_NAME "
"$(cat /tmp/openclaw-collector-config.json) "
else
"$PROJECT "
"$(cat /tmp/openclaw-collector-config.json) "
fi
"$PROJECT "
"$MACHINE_GROUP "
"$CONFIG_NAME "
echo
"OpenClaw SLS observability setup completed."