diff --git a/README.md b/README.md index a1d677c..7f24a9b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Configuration is done through a user-friendly interface, with custom thresholds, - Control multiple PWM fans independently - Monitor temps from array disks, NVMe, unassigned devices, and optionally the CPU - Monitor auxiliary hwmon, storcli, NVIDIA GPU, and Mellanox NIC (`mget_temp`) temperature sensors, or any sensor of your own through a custom script -- Sends one Unraid warning per fan per boot when a configured CPU or auxiliary sensor gives no reading for at least 60 seconds, since the fan cannot react to that sensor then and, if nothing else reads, stays at its Idle or Min Speed +- Sends Unraid notifications when a fan has a problem, while fan control keeps running. A fan gets one warning when, for at least 30 seconds, its PWM controller disappears, the BIOS or another program takes it over, the controller reports a speed 10 or more points away from the one set, or the fan reports 0 RPM while set above 40% after spinning earlier. A fan whose controller is missing when fan control starts also gets one warning. A notice follows once the problem has stayed away for 30 seconds. A configured CPU or auxiliary sensor without a reading for at least 60 seconds also gets one warning per fan per boot, since the fan cannot react to it and, if nothing else reads, stays at its Idle or Min Speed. Alerts are on by default and can be turned off per fan under Syslog & Alerts, for example for a controller with only a few speed steps that never reads back the exact speed set - Use independent temperature ranges for multiple disk groups on one fan - Uses a linear control algorithm to smoothly adjust fan speed (PWM) based on the current temperature (disk or CPU) between your defined low/high values - Identify and label PWM controllers to match physical fans easily @@ -157,8 +157,8 @@ detected, the settings page shows a notice with the workaround. The option's loaded state is read from the driver's `fan_control_watchdog` attribute or its "MSI fan brute force mode" kernel log line, falling back to the modprobe configuration. While a fan on one of those channels is set above 60% but reads -back 60% or less for 10 seconds, the plugin also sends one Unraid -notification per fan per boot. On Unraid, set the option on the flash drive and +back 60% or less for 30 seconds, the plugin also sends an Unraid warning that +names the option (see the problem alerts above). On Unraid, set the option on the flash drive and reboot: ```bash diff --git a/plugin/plugin.j2 b/plugin/plugin.j2 index abb57e7..5c0f8e4 100644 --- a/plugin/plugin.j2 +++ b/plugin/plugin.j2 @@ -91,7 +91,8 @@ if [[ -f "$src" ]]; then fi mkdir -p /var/tmp/fanctrlplus2 -rm -f /var/tmp/fanctrlplus2/* +# Fan alert state (faults_* directories) survives updates, so recoveries are still announced. +find /var/tmp/fanctrlplus2 -maxdepth 1 -type f -delete pkill -f "/usr/local/emhttp/plugins/fanctrlplus2/scripts/array_monitor.sh" rm -f /boot/config/plugins/fanctrlplus2/.config.lock # the lock now lives in /var/run diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css b/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css index 9f50cd3..6a67efd 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/css/fcp.base.css @@ -462,7 +462,7 @@ dt.containerSettingsDt { line-height: 1.6; } -/* Identify PWM Controller and Syslog Setting wrapper. */ +/* Identify PWM Controller and Syslog & Alerts wrapper. */ .fcp-block-wrap{ display: flex; justify-content: center; @@ -583,7 +583,7 @@ dt.containerSettingsDt { .fcp-airflow-switch{ display: none; } .fcp-history-switch{ display: none; } -.syslog-switch{ display: none; } +.syslog-switch, .notify-switch{ display: none; } .switch-button-label{ font-size: 12px; } .switch-button-label.on{ display: none; } .switch-button-background.checked ~ .switch-button-label.on{ display: inline; } diff --git a/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page b/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page index b38eab2..a3bef3e 100644 --- a/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page +++ b/src/usr/local/emhttp/plugins/fanctrlplus2/fanctrlplus2.page @@ -1346,9 +1346,8 @@ $(function() { $area.find('.switch-button-button').css('left', checked ? '12px' : '-1px'); // Persist the relevant switch. - if ($input.hasClass('syslog-switch')) { - var cfgFile = $input.data('cfg'); - saveSyslogSwitchState(cfgFile, checked); + if ($input.hasClass('syslog-switch') || $input.hasClass('notify-switch')) { + saveFanSwitchState($input.hasClass('syslog-switch') ? 'setsyslog' : 'setnotify', $input.data('cfg'), checked); } else if ($input.hasClass('fcp-airflow-switch')) { saveAirflowSwitchState(checked); } else if ($input.hasClass('fcp-history-switch')) { @@ -1356,8 +1355,8 @@ $(function() { } }); - // Shared change handler for the syslog and FCP Airflow/History switches. - $(document).on('change', '.syslog-switch, .fcp-airflow-switch, .fcp-history-switch', function() { + // Shared change handler for the per-fan and FCP Airflow/History switches. + $(document).on('change', '.syslog-switch, .notify-switch, .fcp-airflow-switch, .fcp-history-switch', function() { var checked = $(this).prop('checked'); var $area = $(this).closest('.switch-area'); @@ -1375,12 +1374,18 @@ $(function() { $('#syslog-settings-area').load('/Settings/fanctrlplus2 #syslog-settings-area > *'); } - function saveSyslogSwitchState(cfgFile, checked) { - $.post('/plugins/fanctrlplus2/include/FanctrlLogic.php', { - op: 'setsyslog', - cfg: cfgFile, - enabled: checked ? 1 : 0 - }); + // One save at a time per switch, so a quick off-on cannot land out of order. + var fanSwitchSaves = {}; + function saveFanSwitchState(op, cfgFile, checked) { + var key = op + '|' + cfgFile; + var post = function() { + return $.post('/plugins/fanctrlplus2/include/FanctrlLogic.php', { + op: op, + cfg: cfgFile, + enabled: checked ? 1 : 0 + }); + }; + fanSwitchSaves[key] = (fanSwitchSaves[key] || $.when()).then(post, post); } function saveAirflowSwitchState(checked) { @@ -1890,7 +1895,7 @@ $(function() {

Identify PWM Controller: Use this tool to help locate which physical fan is linked to each PWM controller. After identification, adding a custom label makes it easier to recognize and configure later.

-

Syslog Setting: Enable or disable syslog logging for each fan individually. When enabled, changes in temperature and fan speed will be recorded in the system log. If a fan setup is already stable or updates too frequently, you can turn off its logging to reduce clutter.

+

Syslog & Alerts: Enable or disable syslog logging for each fan individually. When enabled, changes in temperature and fan speed will be recorded in the system log. If a fan setup is already stable or updates too frequently, you can turn off its logging to reduce clutter. Problem alerts send Unraid notifications when a fan has a problem; turn them off for a fan whose controller raises false alarms.

Notes: