소스 수정
This commit is contained in:
@@ -5,10 +5,10 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
// 활성 서버 목록
|
||||
const servers = await query<any>(`
|
||||
SELECT target_id, name as server_name
|
||||
SELECT target_id, server_name
|
||||
FROM server_targets
|
||||
WHERE is_active = 1
|
||||
ORDER BY name
|
||||
ORDER BY server_name
|
||||
`)
|
||||
|
||||
const anomalies: any[] = []
|
||||
@@ -16,10 +16,10 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
for (const server of servers) {
|
||||
const snapshots = await query<any>(`
|
||||
SELECT cpu_usage as cpu_percent, memory_usage as memory_percent, checked_at as collected_at
|
||||
FROM server_logs
|
||||
SELECT cpu_percent, memory_percent, collected_at
|
||||
FROM server_snapshots
|
||||
WHERE target_id = $1
|
||||
ORDER BY checked_at DESC
|
||||
ORDER BY collected_at DESC
|
||||
LIMIT 20
|
||||
`, [server.target_id])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user