A way to check the live/offline status of a remote host running NoMachine Server?

Forum / NoMachine for Linux / A way to check the live/offline status of a remote host running NoMachine Server?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47670
    kimberli
    Participant

    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?

    #47680
    Britgirl
    Keymaster

    I’m not sure why the nxserver would need to be restarted. This would need further investigation. Have you set it to not restart when the machine reboots?

    nc won’t restart the nxserver. To check if nxserver’s listening on the port, try with nc -zv <ip_address_here> 4000. Or better IP="Paste_here_IP_address"; echo >/dev/tcp/$IP/4000 && echo "NoMachine is runned" || echo "NoMachine is stopped"

    For scheduling how about crontab?

    #47684
    kimberli
    Participant

    Thanks, I forgot it could just do that. 😀

    I configured it on a proof of concept machine and copied all of its config to all the remaining machines. Perhaps there was an error somewhere when configuring manually.

    I think for crontab is quite simple, I will check every 30 minutes, and if any host has problems, it will automatically call ssh with the command “/etc/NX/nxserver –restart” to restart the nxserver on that host.

    But it’s the immediate solution…. I will find out the reason why it is forced to restart (or it will hang and cannot be accessed).

    #47687
    Britgirl
    Keymaster

    I will find out the reason why it is forced to restart (or it will hang and cannot be accessed).

    This would be of interest to us since nxserver should not be hanging or suddenly becoming inaccessible. To investigate we will to know what you’ve installed it on and the server-side logs (see this document for instructions, https://kb.nomachine.com/DT07S00243.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic was marked as solved, you can't post.