-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inputs.smartctl): Introduce smartctl JSON input plugin #15066
Conversation
Hi! To answer your question in the issue, here is the command which returns exit code 4 |
I think the plugin only collects data from the last disk of the raid controller.
Only the sd[x] and megaraid disk 14 are mentioned in the telegraf logs (and visible in influxdb):
EDIT: |
Adding scan result with megaraid controller in case you want to make a test out of it. |
Yes, thank you very much! |
I've pushed an update that does not assume unique names during scan. The next set of artifacts after this message will contain a build with those changes. If you could once again give it a shot and let me know if all the data is collected, I would really appreciate it! Thanks again! |
It work perfectly now!
|
Thanks for confirming! |
@powersj FYI: there is a pure-go library for accessing SMART information: https://github.com/anatol/smart.go |
I am comming from #15095. I gave the build above from the bot a spin. result however is it is working for normal disks but not showing any smart data for the raid disks. Same config and machine as in #15095 - so attribute read is not enabled in config. edit adding potential output:
|
Hopefully you are not using the same config, as this PR introduces a new plugin called If you still have issues after updating the input name, please provide the results of:
And the device scan from the device you are not seeing:
|
thanks for the config change hint. I just missed that. while i just added the output above the path for me however is |
Thanks for confirming!
There is a config option for this ;) ## Optionally specify the path to the smartctl executable
# path = "/usr/bin/smartctl"
You can use metric filtering to remove unwanted metrics. For example, using the |
btw: thanks for the work you put in this! another thing I realized is that the smart plugin in newer versions used to call
That is what I used. Pointing to
sure I can filter but this option would have been an more easy config and may reduce computational load. |
Archlinux! (BTW™) |
Yeah this is part of the reason why this is a new plugin. I specifically did not want to continue doing this. The nvme calls should have been a second plugin.
hahah exactly :) I copied that path over from the previous plugin, but if the bulk of distros use |
RHEL does. |
Thanks for finding this. I took a look at this and have the following comments:
edit: the repo mentioned https://github.com/dswarbrick/smart/ as a source, and it looks like they even had to have megaraid specific details: https://github.com/dswarbrick/smart/blob/master/megaraid/megaraid.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @powersj! The code looks good, my only question is how this relates to inputs.smart
? Is this a replacement? If not, what are the differences?
Should I add the following to the readme? Smartctl is focused only on collecting data from smartctl via the JSON output it provides via the scan and collection commands. The smart plugin parses the raw output of the smartctl using a variety of regex. It can also optionally collect additional details via the nvme command including some vendor specific details. I don't fully consider smartctl as a replacement, given it lacks the additional intel nvme collection/details, but for users who report issues using smart in the future, I would absolutely point them at smartctl first. |
@powersj after sleeping over it, it would be nice to add this statement to the readme. I guess this will also clarify things for the user. |
done, give it a read and let me know if I should add something to the smart plugin as well. |
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 🥳 This pull request decreases the Telegraf binary size by -2.19 % for linux amd64 (new size: 231.5 MB, nightly size 236.7 MB) 📦 Click here to get additional PR build artifactsArtifact URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks @powersj!
Summary
Checklist
Related issues
resolves #