From 2b514921bb187a9cf8aa82e999146783a6257ebc Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 16 Oct 2024 22:22:12 +0200 Subject: [PATCH] etc/dbq/data.php --- etc/dbq/data.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 -- 2.47.3