Save application shutdown mode

Asked

Viewed 32 times

0

I have the following scenario:

1 application that runs on 10 machines, where when the application is running it is in on-line and when it’s not, that machine is like off-line, that communicates with a database SQL to inform your Status.

The problem is, if the power goes down?

I thought I’d stay and save txt the status every 10 seconds for example, and when turning on the PC query that information, but I do not know if it is the best way, someone has some better idea?

  • 1

    Guy for this case there, if I understand your problem, the ideal is to use the client server approach. Where the applications that run on the 10 machines are server. So you will use a customer to check whether these machines are online or offline and the customer will update the status in the database.

  • Gustavo, can you give us more information about how it’s working? Is this application located on each machine not on a server? When the program starts it asks to update the status to online (update in a table), and when it ends it makes a new request but now to offline is this?

1 answer

1


Hello!

There are N ways to do this, I’ll give you a few tips.

If you have communication with the database via application, you can do something very simple that is a ping. You record from time to time that your application is online, so you will know via bank this.

Example: Table status_micros(id_micro,ultimo_ping);

You’ll know when her last ping was, so you’ll know if she’s off or not.

Another solution would be to do this same ping concept but using a p2p communication to obtain the information.

You can create a micro Rest, where you via http protocol send a request to your application asking if it is offline.

There are still numerous other solutions for this.

I hope I’ve helped!

  • 1

    Hello Felipe, Thanks for the reply, forgive my delay to give a return. So I guess I didn’t explain correctly, a computer may be on, logged in but offline, if the power goes down, how do I know who was off and on? I will do by the same bank, create a table and save the general STS at each certain time, when falling caught the that table, thanks man.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.