Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the internal drive in my mac (M4 mini, Sonoma) doesn't appear in the metrics because of this error:
I'm not sure what this is about, but a google search appears to show this in a lot of macOS smartctl outputs. This PR ignores this error so that the drive metrics can be exported.
Also, device name parsing appears to be broken due to how macOS presents device names to smartctl:
This PR includes a change to the
extractDiskName
function, such that it returns the entire input stringIOService:/AppleARMPE/arm-io@10F00000/AppleH16GFamilyIO/apciec3@80000000/AppleT8132PCIeC/pcic3-bridge@0/IOPP/pci-bridge@0/IOPP/pci-bridge@1/IOPP/pci144d,a80c@0/IONVMeController/IONVMeBlockStorageDevice@1
as the name instead of an empty string. This resolves the restriction that no two devices can have the same name.