Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 242751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:51:50+00:00 2026-05-11T20:51:50+00:00

I’ve seen the question asked can you run Monit on Windows?, and unless you

  • 0

I’ve seen the question asked “can you run Monit on Windows?”, and unless you want to use a VM, the answer appears to be no.

So…are there any small footprint monit-like applications actually for Windows OS’s? What I’m looking for is not only monitoring (of which there are hundreds of apps), but also the ability to execute a script or restart a service. For example, monitor a web page, and restart Tomcat if that page becomes unresponsive (can’t just watch the service, because the service is still running but not responding properly).

This is for a small application, not a large application, so the heavyweight/expensive solutions aren’t desired.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:51:50+00:00Added an answer on May 11, 2026 at 8:51 pm

    I didn’t find anything out there that fit my needs, so I learned a little Powershell scripting and rolled a solution that should be useful to others as well. Assuming a Windows platform (otherwise use monit!), Powershell is really powerful and easy.

    sample-monitor.ps1 script:

    $webClient = new-object System.Net.WebClient
    
    ###################################################
    # BEGIN USER-EDITABLE VARIABLES
    
    # the URL to ping
    $HeartbeatUrl = "http://someplace.com/somepage/"
    
    # the response string to look for that indicates things are working ok
    $SuccessResponseString = "Some Text"
    
    # the name of the windows service to restart (the service name, not the display name)
    $ServiceName = "Tomcat6"
    
    # the log file used for monitoring output
    $LogFile = "c:\temp\heartbeat.log"
    
    # used to indicate that the service has failed since the last time we checked.
    $FailureLogFile = "c:\temp\failure.log"
    
    # END USER-EDITABLE VARIABLES
    ###################################################
    
    # create the log file if it doesn't already exist.
    if (!(Test-Path $LogFile)) {
        New-Item $LogFile -type file
    }
    
    $startTime = get-date
    $output = $webClient.DownloadString($HeartbeatUrl)
    $endTime = get-date
    
    if ($output -like "*" + $SuccessResponseString + "*") {
        # uncomment the below line if you want positive confirmation
        #"Success`t`t" + $startTime.DateTime + "`t`t" + ($endTime - $startTime).TotalSeconds + " seconds" >> $LogFile
    
        # remove the FailureLog if it exists to indicate we're in good shape.
        if (Test-Path $FailureLogFile) {
            Remove-Item $FailureLogFile
        }
    
    } 
    else {
        "Fail`t`t" + $startTime.DateTime + "`t`t" + ($endTime - $startTime).TotalSeconds + " seconds" >> $LogFile
    
        # restart the service if this is the first time it's failed since the last successful check.
        if (!(Test-Path $FailureLogFile)) {
            New-Item $FailureLogFile -type file
            "Initial failure:" + $startTime.DateTime >> $FailureLogFile
            Restart-Service $ServiceName
        }
    }
    

    The only logic in this script is that it will only try to restart the service once after an initial failure. This is to prevent a situation where a service takes a while to restart, and while it’s restarting, the monitor keeps seeing the failure and restarts again (bad infinite loop). Otherwise you can do just about anything, like add email notifications, or do more than just restart a service.

    This script will execute once, which means you’ll need to control its repetition externally. You could put it in an infinite loop right in the script, but that seems a little flaky. I used windows Task Scheduler, executing it like so:
    Program: Powershell.exe
    arguments: -command “C:\projects\foo\scripts\monitor.ps1” -noprofile
    Start In: C:\projects\foo\scripts

    You could also use a more robust scheduler like VisualCron, plug it into a windows service, or via an application server scheduler like Quart.NET. In my case the task scheduler works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.