* Add support for setting power LED via systemctl
* Add documentation for rudimentary ugreen-power-led.service
* Add "Type=oneshot" and "RemainAfterExit=true" as suggested
Smartctl will also return non-zero if it detected past errors even when currently no other errors are observed. It will set up to 8 bits to indicate the differen types of observed results, where bit 5 does not indicate a _current_ error: `SMART status check returned "DISK OK" but some attributes have been at or below threshold in the past.`
The change ignores bit 5 (= 32) when checking the exit code.
Future improvements could detect other bits to color the leds differently depending on the type of error (f.e. bit 4 might indicate a future problem and could turn the led orange instead of red)
* Bugfixes
- add missing led_map thanks @miskcoo
- implement functions for modprobe from drivers
- minor changes for logger messages
- add DXP480T and function to set static white LED
* Bugfix for DXP6800
* fix: turn off the light when no disk in a slot (#16)
* Update ugreen-leds
---------
Co-authored-by: Yuhao Zhou <miskcoo@gmail.com>
1. Add the config file /etc/ugreen-leds.conf for environment variables used in ugreen-diskiomon (see scripts/ugreen-leds.conf)
2. Make the blinking of netdev activities, colors of different disk states / NIC link speeds configurable
3. Add the check of zpool health
4. Add the check of gateway connectivity and the link speed of network device
5. Split the systemd service to ugreen-diskiomon.service and ugreen-netdevmon@<device name>.service
6. HCTL mapping will fail in some cases (hctl mapping for SATA drives only #14), UGOS uses ATA number to map disks to slots. I changed the default mapping to ATA, which can be shown by the following scripts:
Few changes for unRAID plugin.
- create lock file on script execution
- create function to to remove lockfile and kill subprocess if running
- trap exit from script
- check if environment variables are set for: `mapping_method`, `CHECK_SMART`& `CHECK_SMART_INTERVAL` otherwise use default values
- set `CHECK_SMART` to false if file `/etc/unraid-release` is found (unRAID specific since it check on it's own for smart errors)
- create variable `LED_REFRESH_INTERVAL` for while looop
- run smart check in subprocess
- put `zpool-leds.sh` in a variable to make the while loop a bit more efficient
- remove check for `/sys/class/leds/$led/color` and set color <- I'm not too sure about that one but this path should always exist correct?
* fix some bugs in the smart check loop
* improve the efficiency of ugreen-diskiomon
* Additional changes
- change mpaaing_method to upper case to unify settings which can be set by environment variables
- read config file from plugin with variables (unRAID specific)
---------
Co-authored-by: Yuhao Zhou <miskcoo@gmail.com>
* Added disk SMART monitoring to ugreen-diskiomon
Added SMART monitoring based on smartctl. The led now turns red if the corresponding disk fails (smartctl -H does not show PASSED).
Optimized the pooling loop to only iterate the existing drives at the execution of the script
The led will be turned off if no disk in installed in the slot.
* fixed some silly mistake
* Update ugreen-diskiomon
The sata devices are now mapped to leds based on hctl by default.
Added an option to map devices based on serial number. (serial numbers must be manually configured)
Fixed a bug in SMART polling invertal control.
Failed disk will be marked and left untouched. The failure date will be recorded.
* fix an error in ugreen_diskiomon
---------
Co-authored-by: Yuhao Zhou <miskcoo@gmail.com>