Closed SaimonWoidig closed 10 months ago
Do you have a concrete use for this?
Sorry for the late response, I was on a vacation. I am developing a Zabbix Agent2 plugin for monitoring MD RAID and I thought, I could use the mdstat parsing functionality from this package. For now, I just copied the file, did some changes to make it work (mainly rewrite errors). I made sure, that it's known that I took this part of code from the procfs module. I also used the same license.
Why don't you use MDStat()
and only the parsing? Just trying to understand, in general I'm totally fine with exporting it. @SuperQ wdyt?
AFAIU, the general consensus is to move away from the regex-based parsing of /proc/mdstat
in mdstat.go, and use the sysfs-based parser in sysfs/mdraid.go.
Oh my god, I don't even know, how I missed that MDRaid functionality in mdraid.go
. Thanks, I will look and try it out, and I honestly think, that it's a better way to go. Sorry for your wasted time. 🤦😔
Ok then let's close this for now!
Currently the
parseMDStat
function in filemdstat.go
is unexported. It would be practical to export it. Perhaps someone wants to use only the mdstat file parsing functionality. This way, it wouldn't be needed to initialize the FS and read the mdstat from it. Instead, the mdstat file content would be passed instead.