[MXS-97] maxadmin output in parsable format Created: 2015-04-15  Updated: 2017-12-01  Resolved: 2016-10-17

Status: Closed
Project: MariaDB MaxScale
Component/s: maxadmin
Affects Version/s: 1.1.0
Fix Version/s: N/A

Type: New Feature Priority: Minor
Reporter: Joffrey MICHAIE (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None


 Description   

Hi,

it is currently not possible to easily parse output for maxadmin commands.
It would be great to have a common interface to get the output in a parsable (json,sql, csv, xml, ....) format.

The list serversjson command, which was added in 1.1, is a good start, but we would need this for every command.

Maybe forcing commands/modules/plugins to follow a common scheme will be required before implemeting this is possible.

Thanks,
Joffrey

# echo "list servers" | ./bin/maxadmin -uadmin -p mariadb
MaxScale> Servers.
-------------------+-----------------+-------+-------------+--------------------
Server             | Address         | Port  | Connections | Status
-------------------+-----------------+-------+-------------+--------------------
server1            | 10.251.100.6    |  3306 |           1 | Down
server2            | 10.251.100.7    |  3306 |           0 | Slave, Synced, Running
server3            | 10.251.100.8    |  3306 |           0 | Master, Synced, Running
-------------------+-----------------+-------+-------------+--------------------
 

Example of preferred output (but for every command):

# echo "show serversjson" | ./bin/maxadmin -uadmin -p mariadb
MaxScale> [
  {
  "server": "10.251.100.6",
    "status": "Down",
    "protocol": "MySQLBackend",
    "port": "3306",
    "version": "10.0.17-MariaDB-1~wheezy-wsrep",
    "nodeId": "-1",
    "masterId": "-1",
    "replDepth": "-1",
    "totalConnections": "1",
    "currentConnections": "1",
    "currentOps": "0"
  },
  {
  "server": "10.251.100.7",
    "status": "Slave, Synced, Running",
    "protocol": "MySQLBackend",
    "port": "3306",
    "version": "10.0.17-MariaDB-1~wheezy-wsrep-log",
    "nodeId": "1",
    "masterId": "-1",
    "replDepth": "0",
    "totalConnections": "1",
    "currentConnections": "0",
    "currentOps": "0"
  },
  {
  "server": "10.251.100.8",
    "status": "Master, Synced, Running",
    "protocol": "MySQLBackend",
    "port": "3306",
    "version": "10.0.17-MariaDB-1~wheezy-wsrep-log",
    "nodeId": "0",
    "masterId": "-1",
    "replDepth": "0",
    "totalConnections": "3",
    "currentConnections": "0",
    "currentOps": "0"
  }
]



 Comments   
Comment by Johan Wikman [ 2016-10-17 ]

maxinfo provides the desired functionality.

Generated at Thu Feb 08 03:56:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.