Hello Heiner,
we had written an Icinga-integration for Spectrum Scale years ago, the Bash script is still available here:
Within this script we had defined two generic functions:
getColumnNoByHeader() and getColumnValueByColHeader(). These allow extraction of data from ':'-separated command output, and have served me well ever since... I'm not aware of any formal library for this purpose.-------------------------------------------------------------------------------
Mit freundlichen Grüßen / Kind regards - Achim Christ
Mit freundlichen Grüßen / Kind regards - Achim Christ
----- Original message -----
From: "Billich Heinrich Rainer (ID SD)" <[email protected]>
Sent by: [email protected]
To: gpfsug main discussion list <[email protected]>
Cc:
Subject: [EXTERNAL] [gpfsug-discuss] Parse -Y command output
Date: Wed, May 27, 2020 10:56
Hello,
I wonder if any python or bash functions exist to parse the output of mm-command's -Y format, i.e. colon-separated with HEADER rows. I would be nice to convert the output to a python list of named tuples or even better pandas dataframe. I would like to access the values by column name and row index. This would allow to do quick scripts or reports easily. Imagine using a jupyter notebook to dig into mmrepquota or mmlsdisk output, even doing charts, ..., easily.
I know the ReST interface does exisit, which I could call to get the data in Json format, but to parse the Y-format seems much less cumbersome and allows to collect the data at one time and process it later.
If you have other suggestions please let me know. What I would like to get:
A list of NSDs which shows the connection to vdisk-set. Vdisk, recovery group and ESS system for each NSD. To get this I need to merge at least two tables.
A list of user of fileset quota values highlighting those having non-default vaulues or close to the limit.
The ability to get the data quickly in an uniform way into some tool, preferably python, to do analysis or formatting.
Cheers,
Heiner
_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
