Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Windows 7, and I have a remote Linux machine that runs a Java application in Tomcat (on port 8080). Sometimes, the remote machine is up but Tomcat doesn't respond.

How can I code something that will check if it is up periodically (e.g. every 10 minutes) and somehow warn me?

share|improve this question

Install curl

Then you can use the curl command on your tomcat URL on port 8080 to see if it is working.

Or you can just use telnet server 8080.

share|improve this answer

I have developed a VBS script which you can schedule in Windows Scheduler to run in 10 minute intervals

The script when executed tries to connect to the URL given as its first argument. If it is not able to connect, it will popup a message box saying "Could not connect".

Here is the source code:

If WScript.Arguments.Count <> 1 then
  Wscript.Echo "Usage: CheckTomcat.vbs URL"
End If 

URL = WScript.Arguments.Item(0)

Set Http = CreateObject("Microsoft.XmlHttp") "GET", URL, FALSE

On Error Resume Next
Http.Send ""

If Err.Number <> 0 Then
    Wscript.Echo "Cannot connect to Tomcat at " & URL
    Wscript.Quit 1
End If

'WScript.Echo "Connection successful. Response Code is " & Http.Status

Set Http = nothing
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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