mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
add systemctl device type configuration option
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
"Mode": "list(Collector+WebUI|Collector)?",
|
||||
"TZ": "str?",
|
||||
"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,
|
||||
|
||||
@@ -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