I'm trying to create a program where I can monitor when a server running a Tomcat Application Server goes down. I will need to check an IP & PORT every 5 minutes for example and get back a boolean on whether it is up or not. I've tried googling around already, and I didn't really found what I'm looking for, hopefully someone here can help.
Simply connect and catch the exception. On an exception, it is, seemingly, not running, or not running properly. Use HttpURLConnection and connect to the actual site and you can even check the returned http codes (i.e. 404, 501, etc).
This is not the sort of thing you do from a JSP page itself. This would be something that should (if part of a webservice) be started in a thread (or a few threads) when the application starts and left running. They should then perform a pooling operation (i.e. every few minutes attempt to connect) and write the statuses in a DB (or flat file) and the JSP should do nothing but show the results.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...