ceph / ceph-medic

find common issues in ceph clusters
MIT License
22 stars 18 forks source link

export to JSON #119

Open alfredodeza opened 5 years ago

alfredodeza commented 5 years ago

Right now, all results are for a terminal user running the tool in the foreground. Other systems that may want to consume results to display them (e.g. the Ceph dashboard) will benefit from exporting to JSON instead of the rich terminal output.

A new flag called --format should be added to the check sub-command, that defeaults to plain, but can be set to json so that output is returned as plain JSON. The call should look like:

$ ceph-medic check --format=json

Most of the work for this is already done as the reporting tooling in ceph-medic is a big dictionary that gets passed on to the various functions that use it to format to terminal output.