Skip to content

beegfs cli --output=json inconsistent #121

Description

@ksheumaker

Describe the bug
We are looking at integrating data from the beegfs cli command and the --output=json is a nice feature. However it's pretty inconsistent, and a lot of the output isn't really json

Describe the system
BeeGFS 8.3.1

To Reproduce

# beegfs --tls-disable health check --output=json
#################################################
Running Health Check for beegfs://10.1.50.30:8010
#################################################
###################################
>>>>> Checking for Busy Nodes <<<<<
###################################

✅ Busy Metadata Nodes -> Number of queued requests does not exceed the degraded (16) or critical (512) thresholds.
✅ Busy Storage Nodes -> Number of queued requests does not exceed the degraded (16) or critical (512) thresholds.

############################
>>>>> Checking Targets <<<<<
############################

✅ Reachability -> All targets are responding.
✅ Consistency -> All mirrors are synchronized.
⚠️  Available Capacity -> Not all targets have sufficient free space based on the thresholds defined by the management service's configuration.
✅ Mapping Status -> All targets are mapped to a storage node.

----------------
Metadata Targets
----------------
[{"alias":"target_meta_1","cap_pool":"Normal","consistency":"Good","id":{"num_id":1,"node_type":2},"inodes":"26.0M","inodes_free":"25.7M","inodes_used":"278.6k (1.07%)","last_contact":"13s ago","node":"m:1","reachability":"Online","space":"49.6GiB","space_free":"42.8GiB","space_used":"6.8GiB (13.66%)","storage_pool":"(n/a)","sync_state":"Healthy","type":2}]

---------------
Storage Targets
---------------
[{"alias":"target_storage_101","cap_pool":"Low","consistency":"Good","id":{"num_id":101,"node_type":3},"inodes":"26.0M","inodes_free":"25.7M","inodes_used":"278.6k (1.07%)","last_contact":"16s ago","node":"s:1","reachability":"Online","space":"49.6GiB","space_free":"42.8GiB","space_used":"6.8GiB (13.66%)","storage_pool":"s:1","sync_state":"Healthy","type":3}]

HINT: This mode does not check file system consistency. To check for file system inconsistencies,
      you can run 'beegfs-fsck --checkfs --readOnly' and consult with ThinkParQ support.

################################################
>>>>> Checking Connections to Server Nodes <<<<<
################################################
=============================================================================
Client ID: c1364-6A3C0C28-node21.cluster (beegfs://10.1.50.30 -> /mnt/beegfs)
=============================================================================

✅ Fallbacks -> All connections are using preferred NICs and protocols.


Error: one or more checks failed

another one

#  beegfs health capacity --output=json
----------------
Metadata Targets
----------------
[{"alias":"target_meta_1","cap_pool":"Normal","id":{"num_id":1,"node_type":2},"inodes":"26.0M","inodes_free":"25.7M","inodes_used":"278.6k (1.07%)","node":"m:1","space":"49.6GiB","space_free":"42.8GiB","space_used":"6.8GiB (13.66%)","storage_pool":"(n/a)","type":2}]

---------------
Storage Targets
---------------
[{"alias":"target_storage_101","cap_pool":"Low","id":{"num_id":101,"node_type":3},"inodes":"26.0M","inodes_free":"25.7M","inodes_used":"278.6k (1.07%)","node":"s:1","space":"49.6GiB","space_free":"42.8GiB","space_used":"6.8GiB (13.66%)","storage_pool":"s:1","type":3}]

and here's one that just doesn't do it at all

# beegfs --tls-disable health network --output=json
=============================================================================
Client ID: c1364-6A3C0C28-node21.cluster (beegfs://10.1.50.30 -> /mnt/beegfs)
=============================================================================
---------------
Management Node
---------------
management [ID: 1]
   Connections: ethernet: 1 (10.1.50.30:8008);
--------------
Metadata Nodes
--------------
node_meta_1 [ID: 1]
   Connections: rdma: 1 (10.3.50.30:8005);
-------------
Storage Nodes
-------------
node_storage_1 [ID: 1]
   Connections: rdma: 1 (10.3.50.30:8003);

Expected behavior
It would be nice for the entire output to be valid json so it could be just sent to another application for parsing. Having to pull out headers in plain text.

The beegfs health capacity one could be easily fixed with output like

{ 
    "meta" : [ .... ],
    "storage": [ ... ]
}

I'm sure the beegfs health check could be redone as a json data structure, and would be nice if there were no emoji in the output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnewIssues that haven't been triaged yet

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions