自动化
如何远程给OpenClaw发送消息
· ☕ 1 分钟
1. 配置 hooks 在 openclaw.json 中配置 hooks 1 2 3 4 5 6 7 "hooks": { "enabled": true, "token": "xxx", "path": "/openclaw/hooks", "allowRequestSessionKey": true, "allowedAgentIds": ["*"] }, 参考 https://docs.openclaw.ai/automation/webhook 这里的 token 不能与 gateway 的 token 相同。 2. 发送消息 1 2 3 4 5 6 7 8 9 10 11 12 curl --location 'https://xxx.com/openclaw/hooks/agent' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer xxx' \ --data '{ "message": "介绍下自己,将消息发送到 https://xxx.com/api/v1/webhook/send?key=xxx", "agentId": "main", "sessionKey": "hooks-api-002", "wakeMode": "now", "deliver": true, "thinking": "low", "timeoutSeconds": 120 }' 由于以上请求是异步的

你也可以这样落地 AI Agent - 案例篇
· ☕ 2 分钟
1. 处理确定故障 对于有具体处理方式的故障,直接使用 Agent 处理,发通知周知即可。 类似的自动处理,我们有应用层的异常负载删除、节点层的磁盘清理、GPU 掉卡屏蔽卡、屏蔽节点等。先找出团队中遇到得最多、需要最多人力的事情,对其进行自动化处理。你可以认为,

使用 Ops 项目查看并监控集群事件
· ☕ 2 分钟
https://github.com/shaowenchen/ops 1. 告警 Kubernetes 集群的事件 监控指定的关键字 1 2 3 4 5 6 7 8 9 10 11 apiVersion: crd.chenshaowen.com/v1 kind: EventHooks metadata: name: kube-pod-falid namespace: ops-system spec: type: xiezuo url: https://xxx.com/api/v1/webhook/send?key=xxx subject: "ops.clusters.*.namespaces.*.pods.*.event" keywords: - failed 一份简单的配置,即可收获大量的相关告警。 监控之后,自动化处理 1 2 3 4 5 6 7 8 9 10 11 12 apiVersion: crd.chenshaowen.com/v1 kind: EventHooks metadata: name: kube-no-free-node namespace: ops-system spec: additional: "action: restart-kubelet-bypod" keywords: - no free node subject: ops.clusters.*.namespaces.*.pods.*.event type: webhook url: http://x.x.x.x/webhook 借助 Ops Copilot 的执

使用事件总线改造运维体系
· ☕ 4 分钟
1. 积重难返的运维服务体系 针对明确的运维诉求,开发相应的运维服务以供运维、业务用户使用,本无可厚非。但如果仅满足于此,很容易出现下面的情况: 用户频繁地寻找各个系统的入口,在各个系统之间来回跳转,忙于寻找各种按钮、拷贝参数。 一旦这样的运维服务多

使用 systemd timer 配置定时任务
· ☕ 2 分钟
1. 准备定时脚步 如果是 Bash 脚本,第一行需要指定解释器。 1 2 mkdir -p /root/scripts vim /root/scripts/quick-clear.sh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/bin/sh /usr/local/bin/kubectl --kubeconfig /root/.kube/config get pods --all-namespaces -o wide | grep Evicted | awk '{print $1,$2}' | xargs --no-run-if-empty -L1 /usr/local/bin/kubectl --kubeconfig /root/.kube/config delete pod -n || true /usr/local/bin/kubectl --kubeconfig /root/.kube/config get pods --all-namespaces -o wide | grep Error | awk '{print $1,$2}' | xargs --no-run-if-empty -L1 /usr/local/bin/kubectl --kubeconfig /root/.kube/config delete pod -n || true /usr/local/bin/kubectl --kubeconfig /root/.kube/config get pods --all-namespaces -o wide | grep Completed | awk '{print $1,$2}' | xargs --no-run-if-empty