]> Finds the logs that are spamming and tells you who is doing it: the plugin, program or container behind a message that repeats thousands of times, and the Docker logs that are growing without bound. Choose how often it scans, and switch each source on or off. System Information > Log Health**. Each finding is named after the plugin (with file and line), program or container behind it. - Looks at PHP errors, the system log, the log of every Docker container (its size, growth, limit, and what is repeating inside it) and other plugin logs. Each source can be switched off. - A message is flagged when it repeats a lot and either fast or as most of its own log. Findings are ranked flooding, noisy and chatty (slow but repetitive, such as healthchecks), still-happening first. A traceback that prints many lines is one finding. - Mute any finding you know about and don't care about, and unmute it later. - Choose how often to scan in words (every 5, 10, 15 or 30 minutes, every hour, every 3, 6 or 12 hours, once a day, or off). The default is every 15 minutes. The plugin writes the cron entry for you and keeps it across reboots and updates. - Reads only. It never changes a log, a Docker setting or a file outside its own settings. It reads only what a log gained since the last scan, and keeps its working data in RAM, so it does not write to your flash drive. - Works on Unraid 7.2 and newer. ]]> for pkg in /var/log/packages/&name;-*; do if [ -e "$pkg" ]; then removepkg "$(basename "$pkg")" >/dev/null 2>&1; fi done exit 0 &pluginURL; &sha256; mkdir -p /boot/config/plugins/&name; # installpkg keeps whatever modes the archive had, so set them here chown -R root:root /usr/local/emhttp/plugins/&name; chmod -R 755 /usr/local/emhttp/plugins/&name; find /usr/local/emhttp/plugins/&name; -type f -exec chmod 644 {} \; chmod 755 /usr/local/emhttp/plugins/&name;/scripts/* # Unraid reinstalls every plugin at boot, so this runs on every boot too. The cron file is rebuilt from the # saved schedule (the default, every 15 minutes, only when nothing was ever saved), so a chosen schedule is kept. LH_NO_UPDATE_CRON=1 php -q /usr/local/emhttp/plugins/&name;/scripts/cron # update_cron builds the crontab from the plugins registered in /var/log/plugins, and # Unraid only registers this one after these scripts have finished, so wait for that ( for i in $(seq 1 60); do if [ -e /var/log/plugins/&name;.plg ]; then /usr/local/sbin/update_cron; break; fi sleep 1 done ) >/dev/null 2>&1 </dev/null & # a first look, in the background, so the page has something to show (a scan reads logs and changes nothing) ( nohup php -q /usr/local/emhttp/plugins/&name;/scripts/scan ) >/dev/null 2>&1 </dev/null & rm -f $(ls /boot/config/plugins/&name;/&name;-*.txz 2>/dev/null | grep -v "&version;") echo "Log Health &version; installed" # stop any scan in progress, then take the schedule out of cron pkill -f "/usr/local/emhttp/plugins/&name;/scripts/scan" 2>/dev/null rm -f /boot/config/plugins/&name;/&name;.cron /boot/config/plugins/&name;/&name;-*.txz /usr/local/sbin/update_cron 2>/dev/null # Unraid does not forget the package on its own: without this, reinstalling the same # version before a reboot is skipped as "already installed" and installs nothing for pkg in /var/log/packages/&name;-*; do [ -e "$pkg" ] && removepkg "$(basename "$pkg")" >/dev/null 2>&1 done rm -rf /usr/local/emhttp/plugins/&name; /tmp/&name; # config.json (your schedule, switches and muted messages) is kept so a reinstall picks up where you left off