I have some experience with java but have not used it much lately. I have a task where I have to monitor a process running on a UNIX server (server1) from a different UNIX server (server2). If the process on server1 is no longer running, I have to start the same process on server2. That is the only requirement at this time. They do not want us to check for connection leaks or other problem that the process might encounter.
My plan was to create a socket connection where server1 acts as the server and server2 acts as the client. The client will request status from the server. The server would then execute UNIX commands to verify if the process is working and would then return the results. Based on the results, the client would either start the process on server2 or sleep for 5 seconds.
Is this the best solution to my task? This is very high level but want to make sure I have a good solution before proceeding. If there is a better way, please let me know.