This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

writing a monitor for an app/web server instance  RSS feed

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to design a prototype for an app/web server monitor.

I was wondering on the following aspects.

1> How should the monitor send heartbeat to the server process?

Should it be in the form UDP/TCP-IP packets on the same service port on which the server is listening for incoming client connections?

Or does these app/web servers open up some separate management port which could be pinged periodically by the monitor?

2> Are there some standard design approaches for building such monitors/watchdogs?

The pseudocode for the watchdog is furnished below

 
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you must look into Java Management Extensions
Commercially available app and web servers like weblogic, tomcat have support for JMX.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monitoring can be done on various levels.

To test whether a machine is up and running you can use Ping (which can't be implemented in Java, but you can use Runtime.exec to run the native version).

To test whether it listens to HTTP you can use the URLConnection class to send a request for the root page.

To look inside the Java application, JMX and its JConcole tool would be the way to go.
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!