Forum Discussion

jondyke_46152's avatar
jondyke_46152
Icon for Nimbostratus rankNimbostratus
Feb 04, 2009

Monitoring a Microsoft Windows Service

Is it possible to setup a monitor on the F5 so that it monitors a Windows service on a pool member? What methods could I use to do this?

6 Replies

  • F5Isapi.dll with WMI monitor is out (it only supports disk, mem, etc)

     

     

    You should able to use SNMP to query what services are running.

     

     

    I am Assuming this is a Web server. You can script this with powershell get-service command. If the service is running,update a page (ex. status.htm) with some text (ex. SUCCESS) and use the http monitor to look for that text.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Better yet, write a script local to the webserver that checks the service in question and if it's healthy, return a specific message. Then create a simple HTTP monitor that requests the script, with the expected message as the receive string. That way you'll get real runtime status.
  • This would be difficult...you could possibly do this via an external monitor script that calls curl for the test and then uses preconfigured passwordless SSH to connect to the Windows box to execute the batch file. The LTM doesn't really have any clients other than SSH and telnet that it can connect to other devices with, and it doesn't have Expect for interactive scripting. A quick Google search shows a few SSH servers for Windows (running under Cygwin mostly), I'm not aware of any Windows-native capability to handle that though, so you'd have to install something that LTM could connect to on the Windows box.

     

     

    So, from a practical standpoint, having the LTM actually execute remote commands on a Windows box is not a trivial endeavor. I also would not recommend doing this on a site that had anything more than a light amount of traffic, because the health monitoring could take up a large amount of resources on the LTM itself. You'd be better off doing something similar to what Deb suggested; a script local to the webserver that would restart the service if it didn't get the expected application response.

     

     

    Denny
  • aneilsingh,

     

     

    You could use PowerShell and iControl for this. The PowerShell script would poll the LTM for pool member status and restart the local Windows service if the pool member (or node) is marked down by the HTTP monitor.
  • Yes, you can use wmic, but you'll need to build the executable and copy it over to the LTM. Details here: http://links.f5.com/gqVlUe Click Here
  • Update for those who may come across this: In at least version 12.1, there is a native WMI Health Monitor that you can use to check on a Windows Server. K6914