I manage a number of remote hosts on shared servers. Sometimes because of resource problems, or by users or other reasons, one or several servers running on those private IPs will be interrupted, and I need to manually ssh into these servers to restart NoMachine server.
I wonder if it is possible to automate this process by periodically checking to see if the NoMachine server on that remote host is still active?
If with ssh server, you just need to use netcat like: nc <ssh server address> <ssh port>
then you can see its status, like SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11
.
But with NoMachine server it’s not possible: nc <nomachine server address> 4000
– hangs endlessly.
Just want to ask, if is there any way (or other command line options) to do so?