From 63ec6340442a8462a5a90f967ea0c46488e62518 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 21 Nov 2024 21:28:01 +0100 Subject: [PATCH] lib/postgres/host_report.sql --- lib/postgres/host_report.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/postgres/host_report.sql b/lib/postgres/host_report.sql index 364af909..92998501 100644 --- a/lib/postgres/host_report.sql +++ b/lib/postgres/host_report.sql @@ -5,9 +5,12 @@ CREATE VIEW host_report AS ,COUNT(DISTINCT CASE WHEN key LIKE 'git.%.path' THEN val ELSE null END) as git_path ,MAX(DISTINCT CASE WHEN key LIKE 'git.%.exit_code' THEN val ELSE null END) as git_exit ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'git.%.branch' THEN val ELSE null END),' ') as git_branch + ,TO_CHAR((SELECT MAX(hb.updated) FROM host_info hb WHERE hb.key LIKE CONCAT('backup_servers.',hi.host,'.%')),'YYYY-MM-DD HH:MI:SS') as backup_updated ,(SELECT array_to_string(array_agg(DISTINCT hb.host),' ') FROM host_info hb WHERE hb.key LIKE CONCAT('backup_servers.',hi.host,'.time')) as backup_hosts ,(SELECT MAX(hb.val) FROM host_info hb WHERE hb.key LIKE CONCAT('backup_servers.',hi.host,'.files_transfer')) as backup_files + + ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'backup-datas.%' THEN CONCAT(REPLACE(key,'backup-datas.',''),':',val,':',TO_CHAR(updated,'YYYY-MM-DD')) ELSE null END),' ') as datas_service FROM host_info hi GROUP BY host ORDER BY backup_updated DESC,git_updated DESC,host -- 2.47.3