mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-16 01:18:19 +01:00
Merge pull request #567 from scavara/master
add systemctl device type configuration option
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
- New options SMARTCTL_COMMAND_DEVICE_TYPE & SMARTCTL_MEGARAID_DISK_NUM (@scavara)
|
||||
- New option "Mode" : Collector+WebUI or Collector only
|
||||
|
||||
## v0.5.0 (26-08-2022)
|
||||
|
||||
@@ -38,10 +38,12 @@
|
||||
"COLLECTOR_API_ENDPOINT": "str?",
|
||||
"Mode": "list(Collector+WebUI|Collector)?",
|
||||
"TZ": "str?",
|
||||
"Updates": "list(Hourly|Daily|Weekly)"
|
||||
"Updates": "list(Hourly|Daily|Weekly)",
|
||||
"SMARTCTL_COMMAND_DEVICE_TYPE": "list(auto|ata|scsi|sat|usbcypress|usbjmicron|usbsunplus|marvell|megaraid)?",
|
||||
"SMARTCTL_MEGARAID_DISK_NUM":"int?"
|
||||
},
|
||||
"slug": "scrutiny_fa",
|
||||
"udev": true,
|
||||
"url": "https://github.com/AnalogJ/scrutiny",
|
||||
"version": "v0.5.0-4"
|
||||
"version": "v0.5.0-5"
|
||||
}
|
||||
|
||||
@@ -62,3 +62,29 @@ case "$FREQUENCY" in
|
||||
sed -i "1a export COLLECTOR_CRON_SCHEDULE=\"0 0 * * 0\"" /etc/cont-init.d/50-cron-config
|
||||
;;
|
||||
esac
|
||||
############################
|
||||
# SMARTCTL COMMAND OPTIONS #
|
||||
############################
|
||||
|
||||
# Alignt with smartctl commands options
|
||||
if bashio::config.has_value "SMARTCTL_COMMAND_DEVICE_TYPE"; then
|
||||
device_type="$(bashio::config 'SMARTCTL_COMMAND_DEVICE_TYPE')"
|
||||
if ! bashio::config.has_value "SMARTCTL_MEGARAID_DISK_NUM"; then
|
||||
megaraid_disk_num="$(bashio::config 'SMARTCTL_MEGARAID_DISK_NUM')"
|
||||
{
|
||||
echo "commands:"
|
||||
echo " metrics_smartctl_bin: '/usr/sbin/smartctl'"
|
||||
echo " metrics_scan_args: '--scan --json --dev ${device_type}'"
|
||||
echo " metrics_info_args: '--info --json --dev ${device_type}'"
|
||||
echo " metrics_smart_args: '--xall --json --dev ${device_type}'"
|
||||
} > /opt/scrutiny/config/collector.yaml
|
||||
else
|
||||
{
|
||||
echo "commands:"
|
||||
echo " metrics_smartctl_bin: '/usr/sbin/smartctl'"
|
||||
echo " metrics_scan_args: '--scan --json --dev ${device_type},${megaraid_disk_num}'"
|
||||
echo " metrics_info_args: '--info --json --dev ${device_type},${megaraid_disk_num}'"
|
||||
echo " metrics_smart_args: '--xall --json --dev ${device_type},${megaraid_disk_num}'"
|
||||
} > /opt/scrutiny/config/collector.yaml
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user