[MXS-3384] Able to list/group servers by Monitor name Created: 2021-01-26  Updated: 2022-09-15  Resolved: 2022-09-15

Status: Closed
Project: MariaDB MaxScale
Component/s: Monitor
Affects Version/s: None
Fix Version/s: 22.08.2

Type: New Feature Priority: Minor
Reporter: Faisal Saeed (Inactive) Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-166

 Description   

Have the ability to list the servers by a specific Monitor

shell> maxctrl list servers --monitor <monitor-name>

or maybe just add the Monitor name in the output as a column, but depending on the column name, the output might not be able to fit on the screen

Another thought to have the output automatically grouped by the respective monitors of no specific monitor name is specified.



 Comments   
Comment by markus makela [ 2021-08-22 ]

Should be easy to implement:

diff --git a/maxctrl/lib/list.js b/maxctrl/lib/list.js
index 279276c5a..d55ae7976 100644
--- a/maxctrl/lib/list.js
+++ b/maxctrl/lib/list.js
@@ -44,6 +44,11 @@ const list_servers_fields = [
     path: "attributes.gtid_current_pos",
     description: "Current value of @@gtid_current_pos",
   },
+  {
+    name: "Monitor",
+    path: "relationships.monitors.data[0].id",
+    description: "The monitor for this server",
+  },
 ];
 
 const list_services_fields = [

Generated at Thu Feb 08 04:21:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.