]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/host_report.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 21 Nov 2024 20:28:01 +0000 (21:28 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 21 Nov 2024 20:28:01 +0000 (21:28 +0100)
lib/postgres/host_report.sql

index 364af909cfbac565acbdca63cdeee26b5580f30d..929985013f4fa8e6e62ef3903711c691f8cd3860 100644 (file)
@@ -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