Jump to content

Make a monitoring system


NabillaGustiviana

Recommended Posts

I want to make machine monitoring system between 2 PC. This system indicate machine ON or OFF. In the page in 1st PC, there is button to switch machine between ON or OFF. And the 2nd PC show the condition from 1st PC (there are no button to switch machine's condition, it's just display). My question, how to make the 2nd PC get the real time action from 1st PC? Is it possible?Anyone have suggestion?Thank You

Link to comment
Share on other sites

One way could be to have a webserver running on both machines, and then have JS make an AJAX request to a proxy script running on that machines webserver, that makes an HTTP request to and endpoint on the other machine, and if the response comes back as 200, you can assume the other machine is up and running. You can then update the UI of the machine making the request accordingly.

 

A proxy script could be a simple PHP script that just makes a cURL request and returns the response status, or whatever you want to pass back to the AJAX request, to determine success or failure.

Link to comment
Share on other sites

If the pc's have fixed IP addresses they should be able to ping each other with a dos script. If you wanted to use javascript then I don't think you could do it without making both pc's into servers.

Edited by davej
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...