ha-unraid: unRAID Logs Full From Too Many Sessions
Describe the Bug
unRAID logs are getting “spammed” by integration and exhausting disk space for the log with many entries for this per second:
Feb 12 05:26:09 Tower sshd-session[11597]: Starting session: command for root from 192.168.100.143 port 55868 id 1 Feb 12 05:26:09 Tower sshd-session[11597]: Close session: user root from 192.168.100.143 port 55868 id 0
Expected Behavior
unRaid integration for HASS should not “spam” the unRAID log causing it to fill up and prevent other unRAID operations, such as new Docker installs.
Steps To Reproduce (if applicable)
Screenshots
If applicable, add screenshots to help explain your problem.
Debug Log
Provide the debug log of the integration (Enable Debug Logging and Reload Integration).
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 26 (8 by maintainers)
Hi @Guruleenyc,
This issue has been significantly addressed through comprehensive SSH connection management improvements in the current version of the integration.
SSH Session Management Implementation Status
The integration now includes advanced connection pooling and session management to prevent SSH log spam:
Connection Pooling Features
Batched Command Execution
Connection Lifecycle Management
How to Apply the Fix
Manual Update
unraidfolder to your Home Assistantcustom_componentsdirectoryExpected Results
After updating, you should see:
Verification
To confirm the fix is working:
@Guruleenyc @Rudder2 I did some research and will be releasing a fix this week.
Yes, the new code contains breaking changes unfortunately due to refactoring and fixing many bugs.
The current release’s entity naming pattern doesn’t follow home assistant’s best practises
Eg. Duplicate host names in entities naming. Eg duplicate server names “cube_cube”
The updated code fixes the naming pattern.
And the Disk Update Interval and General Update intervals has changed from the current slider options to a dropdown list. This is to add minutes and hours option for disk update intervals and I did the same for general update intervals for consistency in the UI.
I’m also looking at adding support for SSH keys and that will also be a breaking change as the integration setup flow will change to multi-step flow process - https://github.com/domalab/ha-unraid/issues/15
Maybe hold off for a while until it’s in place.
@Guruleenyc @Rudder2 You can try the updated code and see if it works for you. You will need to manually copy the unraid folder and contents to you HA instance and overwrite existing code. Restart HA and see what happens.
Just an FYI You will still see ssh connection logs in unraid but the integration now only uses up to a maximum of 3 connections and then recycles same connections. Shouldn’t need to restart unraid sshd service anymore. You will also see warnings in the HA logs for High Memory usage from Unraid integration but that is normal as it now uses a small cache to improve sensor performance. It automatically clears the cache.
Your entity names will be updated to follow cleaner naming pattern, so you might or might not see old entities.
Any update?
@domalab Thank you! Your work is appreciated.
No update. I don’t know how to fix it yet.
Thanks for letting me know it works.
Yes it resolved the issue for me, since I put in that user script that you provided me I no longer have syslog spamming and filling up my log file location. But I’m running unraid version 6 12.14. I typically do not upgrade to bleeding edge major versions of Unraid until after they’ve been out GA for at least 30 days.
@Rudder2 No idea to be honest. It’s working fine for me. @Guruleenyc is it working for you?
Unraid is releasing their offical API in a few weeks and I’m working on an integration based on that which is better.
Here’s the experimental version of the new integration if you want to take a look but still lots of features missing due to API not supporting it yet
https://github.com/domalab/ha-unraid-connect
Thank you! I’m surprised I missed this work around. I put the script in place and Will monitor
@Guruleenyc Try this
https://github.com/domalab/ha-unraid/wiki/Troubleshooting#ssh-session-log-spam