DOCS/workflow/05_admin/service_health_check.json
happybell80 0252dd1a7f fix: 51123 서버 IP 주소 업데이트 (성수 이전)
192.168.219.45 → 192.168.0.100 일괄 변경

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:52:26 +09:00

108 lines
3.5 KiB
JSON

{
"name": "robeing-admin-service-health-check",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"interval": 10
}
]
}
},
"id": "health-001",
"name": "Every 10 mins",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [200, 240]
},
{
"parameters": {
"jsCode": "return [\n { name: 'robeing-gateway', url: 'http://192.168.0.100:8100/health' },\n { name: 'auth-server', url: 'http://192.168.0.100:9000/health' },\n { name: 'rb8001', url: 'http://192.168.219.52:8001/health' },\n { name: 'skill-email', url: 'http://192.168.219.52:8501/healthz' },\n { name: 'skill-news', url: 'http://192.168.219.52:8505/healthz' },\n { name: 'skill-rag-file', url: 'http://192.168.219.52:8508/healthz' },\n { name: 'skill-calendar', url: 'http://192.168.219.52:8512/health' }\n];"
},
"id": "health-002",
"name": "Service List",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [440, 240]
},
{
"parameters": {
"method": "GET",
"url": "={{ $json.url }}",
"options": {
"response": {
"response": {
"fullResponse": true
}
},
"timeout": 5000
}
},
"id": "health-003",
"name": "Check Health",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [680, 240],
"onError": "continueErrorOutput"
},
{
"parameters": {
"jsCode": "const service = $item.input.json.name;\nconst response = $json.body || {};\nconst statusCode = $json.statusCode;\nconst isUp = statusCode === 200 || statusCode === 201;\nreturn {\n service,\n is_up: isUp,\n status: isUp ? 'UP' : 'DOWN',\n code: statusCode || 'TIMEOUT/ERROR'\n};"
},
"id": "health-004",
"name": "Assess Status",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [940, 240]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.is_up }}",
"value2": false
}
]
}
},
"id": "health-005",
"name": "Is Down?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [1180, 240]
},
{
"parameters": {
"resource": "message",
"operation": "post",
"channel": "C07...",
"text": "=🚨 *서비스 장애 감지*\\n\\n서비스: *{{ $json.service }}*\\n상태: DOWN (Code: {{ $json.code }})\\n\\n확인이 필요합니다.",
"otherOptions": {}
},
"id": "health-006",
"name": "Alert Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2,
"position": [1440, 180]
}
],
"connections": {
"Every 10 mins": { "main": [[{ "node": "Service List", "type": "main", "index": 0 }]] },
"Service List": { "main": [[{ "node": "Check Health", "type": "main", "index": 0 }]] },
"Check Health": { "main": [[{ "node": "Assess Status", "type": "main", "index": 0 }]] },
"Assess Status": { "main": [[{ "node": "Is Down?", "type": "main", "index": 0 }]] },
"Is Down?": {
"main": [
[{ "node": "Alert Slack", "type": "main", "index": 0 }],
[]
]
}
},
"pinData": {},
"meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-admin" }
}