Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SSH Logging

Featured Replies

Hi Everyone,

 

So this is likely to be a very unusual issue or query for someone to have but here goes

 

I have a system that SSH's into my server every second, runs the "sensors" command and reports the hottest core on the server. This is done as my server is 24/7 and water cooled so a peek in temperature for a while would indicate issues like dead pumps, fans etc. I did have a pump die a few weeks back hence why i'm adding this in

 

Running this system would allow a pro-active shutdown before the cores got too hot and did a forced system shutdown

 

Right now unraid adds a log entry every time the SSH user connects, validates the user, and disconnects which is great except for this system it means i am going to fill the logs very very quickly making it cluttered and filling my logs folder - also making diagnosing any other issues impossible

 

I do know the ip that these requests will come from as it is from an internal docker - does anyone know of a way to prevent log entries for SSH from a certain IP? I understand the risk of disabling the logs for SSH entirely due to brute force attempts etc. so removing them from this 1 ip would be ideal

 

I'm happy to try and alter the system to keep just 1 ssh connection open for ever and just push commands to check but this has flaws in itself so i would prefer to supress the logs unless there are other issues with having so many connections to the server 24/7

 

Help would be greatly appreciated

 

Regards,

Jamie

Why not just run a script every minute via cron (or user.scripts) and have it do every thing?  Seems a lot simpler to me...

 

  • Author

Hi Squid, 

 

The system integrates with a number of server checks for both my local and remote servers

 

I need to be able to fetch the response by a php script for processing. The main script runs loops every 100ms for various things

 

Ssh was the only way I could find to get the sensor data from the system unless there is a way I can get the data directly on the server without ssh that I can fetch by remote system? 

 

In short the system will monitor how long the temp has been over a defined threshold as well as sending text, and email alerts and ensuring the system is shut down correctly 

 

Eventually I want to expand it to check on more so I can remotely monitor the server when I'm out the country

 

Regards, 

Jamie

Fair enough...

 

What I'd do then is process the sensors output directly on the server on a cron schedule.  Save the output to something like /tmp/sensors/output.txt

 

Modify /config/smb-extra.conf on the flash drive and add in

 

[sensors]

  path=/tmp/sensors

  valid users = use what ever user the remote system is using

  write list = use what ever user the remote system is using

 

 

Now, //$server_ip/sensors/output.txt is available on the network for any system to be available to read.

 

If / when it needs to shutdown the server, then you can SSH in and shut the thing down.

  • Author

Hi Squid, 

 

I didn't realise it was so easy to make the data so easily seen. 

 

I'm guessing it's not possible but I know cron normally doesn't have a faster speed than once a minute. Is there any way to make it look and check more often? 

 

Regards, 

Jamie

Not AFAIK.

 

But nothing is stopping you from starting the script and then checking the temps and then issuing usleep() in a loop

  • Author

That's true, I will give that a shot instead, my server gets very hot with it running so many vms so a minutes without cooling is a long time :)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.