-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Standby-Support][FEAT] Add support for smartctl --nocheck=
to the collector
#221
Comments
After getting more familiar with the repo... Will that be supported by the scrutiny/example.scrutiny.yaml Lines 85 to 88 in 060ac7b
|
Yeah, I eventually want to make the collector command flags completely customizable. |
smartctl --nocheck=
to the collectorsmartctl --nocheck=
to the collector
apologies, I should have updated & closed this issue earlier. This functionality has been available since You can update the collector config files and specify the command flags you'd like to use when Scrutiny triggers # example to show how to override the smartctl command args globally
commands:
metrics_scan_args: '--scan --json' # used to detect devices
metrics_info_args: '--info --json' # used to determine device unique ID & register device with Scrutiny
metrics_smart_args: '--xall --json' # used to retrieve smart data for each device. Closing this issue for now, feel free to comment/reopen if you have any concerns. |
Are there any plans to add these options as env variables in a future release of the collector? |
You should already be able to do that @boomam |
Cool, i didn't see it documented anywhere (unless i egregiously missed it....) , so i thought I'd ask. |
@boomam did you ever figure this out? trying to do the same thing |
No, i gave up and decided to use a different method to get the same data. |
Would you share this method with me :D? |
I also couldn't get it to work that way. And now use a workaround. I have multiple hosts sending data to scrutiny. Therefore, each of them has the collector running and the container itself has no drives handed over:
On the host with sleeping drives I use 2 config files. One that checks all drives and one that has the drives that go to sleep ignored with: # drives to ignore:
devices:
- device: /dev/sdc
ignore: true
- device: /dev/sdd
ignore: true
- device: /dev/sde
ignore: true
# scrutiny endpoint:
api:
endpoint: 'http://interalip:port' I use a script that checks the drives state first. This doesn't wake them up. Based on that I run the collector with one or the other config: #!/bin/bash
# Function to check if any of the drives are in standby
check_standby() {
for drive in "sdc" "sdd" "sde"; do
state=$(smartctl -i -n standby /dev/$drive | grep "ACTIVE or IDLE")
if [[ -z $state ]]; then
return 1
fi
done
return 0
}
# Check if any drive is in standby and execute the corresponding scrutiny collector
if check_standby; then
/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --config /opt/scrutiny/bin/alldrives.yaml
else
/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --config /opt/scrutiny/bin/nowakeup.yaml
fi ...but it would be much easier if scrutiny could be configured to just not force-wake disks. |
Hi there, I'm facing the same challenge and want to prevent my disks from staying active. I already set the ENV variables correspondingly but without success.
My guess is that the code is missing the respective binding so I created a PR. It's in draft mode as I haven't had the chance to test it. |
An update from my testing efforts show bad results. Unfortunately, neither my above solution nor the configuration keeps the disk in standby mode. I guess there's another command somewhere executed in the code which isn't covered and causes the disks to spin up but above solution. I used the solution #221 (comment) which works (thanks @WhoTheHeck!) and will use it. Not very elegant but working. |
@AnalogJ is there any documentation how it should work to change the parameters so we could (for example) include the I would really like to avoid spinning up my drives unnecessarily and it would be nice if there was an "official" way of achieving this without adding custom scripts or changing existing code in the container. |
I think https://github.com/AnalogJ/scrutiny/pull/619/files Can someone make a PR (and test that change)? |
Hi @AnalogJ, sorry for the late reply. I was able to complete the fix. Please see my PR. Thx |
The
smartctl
tool has a bunch of useful arguments, Scrutiny's collector could make use of them, similarly to Telegraf.I suggested only the
nocheck
argument, because for me personally it's the most important one because of "standby" option, so the drive is not woken up constantly.Describe the solution you'd like
Extend collector's config file with more options, covering smartctl's arguments.
Excerpt from smartctl manual
-- https://linux.die.net/man/8/smartctl
The text was updated successfully, but these errors were encountered: