1

We have a windows desktop application which needs to be running all the time (100% uptime). It's running on windows server 2012 and runs as expected except for a nasty issue which when occurs, the application keeps on running (visible on Task manager & Resource Monitor) but the main Timer thread inside it has stopped, essentially failing to do its core work. Only the app UI is visible. Surprisingly this exception isn't even captured in logs, the log generation just halts. So log monitoring technique fails to work here.

We're fixing this issue, but nevertheless we want to monitor/ make sure internally the desktop app is working. I'm planning to monitor it using a heartbeat URL which will be consumed by this desktop app on every Timer event fired. It'll inform the monitoring server (heartbeat URL host) that "I'm alive". If for N minutes a heartbeat is not received, notifications will be generated.

My questions are, Is this the right approach? Are there any off the shelf paid/free tools for the said purpose?

Given that we cannot monitor an app internally using an external monitoring service, I had this one solution in mind.

1
  • If you can setup a lighthttpd on a linux box and monitor it's logs through a bash script. That's a quick and free solution. I don't know if this is the right/best approach though.
    – Marco
    Oct 4, 2017 at 19:36

1 Answer 1

3

This sounds like something you have developed yourself, if you already have an external monitoring service adding and external URL to post/get would work, but sounds like a bit of a janky solution.

You can also spin off another process on the same server and do something similarr. Since the log generation halts and if it writes to a log on a certain period, have a process watch that log file and to see if it hasn't been written to in period. If it hasn't been written to , kill the process and re-start the program.

If you are able to spin off another thread, as opposed to another process, you can create some shared LastTimeCalled variable. the Timer loop sets the variable to the current time and the other process monitors that variable.

But, the underlying issue is some bug that causes it to stop, that bug should be fixed instead of using a band-aid.

1
  • +1 And in addition, adding more code to an already known buggy code base is just going to make debugging the original problem harder. Oct 4, 2017 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.