From: Nicolas Boisselier Date: Wed, 16 Oct 2024 20:22:12 +0000 (+0200) Subject: etc/dbq/data.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2b514921bb187a9cf8aa82e999146783a6257ebc;p=nb.git etc/dbq/data.php --- diff --git a/etc/dbq/data.php b/etc/dbq/data.php index 83d589ce..8ddddf61 100644 --- a/etc/dbq/data.php +++ b/etc/dbq/data.php @@ -54,15 +54,20 @@ $DBQ['data'] = [ }, ], 'host_info_git' => [ + /* + ,0 as count + ,(SELECT string_agg((name.val),' ') as repos FROM host_info name WHERE name.host=hi.host AND name.key LIKE 'git.%.name') as repos + */ 'sql' => preg_replace('/[\t\r\n]/',''," SELECT host ,max(updated) as last_updated ,min(updated) as first_updated - ,0 as count - ,(SELECT max(CAST(ex.val as INTEGER)) as exit FROM host_info ex + ,(SELECT count(count.val) FROM host_info count + WHERE count.host=hi.host AND count.key LIKE 'git.%.name' + ) as count + ,(SELECT max(CAST(ex.val as INTEGER)) FROM host_info ex WHERE ex.host=hi.host AND ex.key LIKE 'git.%.exit_code' ) as exit - ,(SELECT string_agg((name.val),' ') as repos FROM host_info name WHERE name.host=hi.host AND name.key LIKE 'git.%.name') as repos FROM host_info hi WHERE key LIKE 'git.%' GROUP BY host ORDER BY last_updated DESC, host