Files
aiagent/scripts/setup_kibana.sh
renjianbo beff3fac8d fix: delete agent 500 error + dynamic personality + deployment guide
- Fix delete agent 500: clean up FK records (agent_llm_logs, permissions,
  schedules, executions, team_members) and unbind goals/tasks before delete
- Remove hardcoded personality templates in Android, replace with dynamic
  system prompt generation from name + description
- Set promptSectionsEnabled=false to bypass PromptComposer for personality
- Add Tencent Cloud Linux deployment guide (Docker Compose)
- Accumulated backend service updates, frontend UI fixes, Android app changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-29 01:17:21 +08:00

56 lines
1.5 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Kibana 索引模式 + 基础仪表板初始化
# 用法: ./setup_kibana.sh [KIBANA_URL]
#
# 前置: Elasticsearch + Kibana 已运行
# 开发: http://localhost:5601
# 预发布: http://localhost:5602
# 生产: http://localhost:5601
KIBANA_URL="${1:-http://localhost:5601}"
ES_URL="${2:-http://localhost:9200}"
echo "=== 天工智能体 ELK — Kibana 初始化 ==="
echo "Kibana: $KIBANA_URL"
echo "ES: $ES_URL"
# 1. 等待 Kibana 就绪
echo "等待 Kibana 就绪..."
for i in $(seq 1 30); do
if curl -s -o /dev/null "$KIBANA_URL/api/status"; then
echo "Kibana 已就绪"
break
fi
echo " 等待中... ($i/30)"
sleep 5
done
# 2. 创建 Index Pattern
echo ""
echo "创建 Index Pattern: aiagent-logs-*"
curl -s -X POST "$KIBANA_URL/api/data_views/data_view" \
-H "Content-Type: application/json" \
-H "kbn-xsrf: true" \
-d '{
"data_view": {
"title": "aiagent-logs-*",
"name": "天工应用日志",
"timeFieldName": "timestamp"
}
}' | python3 -m json.tool 2>/dev/null || echo "(可能已存在,忽略错误)"
# 3. 确认索引有数据
echo ""
echo "检查 Elasticsearch 索引:"
curl -s "$ES_URL/_cat/indices/aiagent-logs-*?v"
echo ""
echo "=== 完成 ==="
echo "Kibana: $KIBANA_URL"
echo "Discover: $KIBANA_URL/app/discover"
echo ""
echo "提示: 在 Kibana 中手动创建 Dashboard"
echo " 1. 打开 Discover → 选择 aiagent-logs-*"
echo " 2. 创建 Visualization (柱状图按 level / 折线图按时间)"
echo " 3. 保存为 Dashboard"