Windows NLB: Script to detect service not working in server

Answered Windows NLB: Script to detect service not working in server

  • Friday, July 13, 2012 6:23 AM
     
     

    Hello,

    I want to find out if there's a way to have a "detector" that would trigger not to route users in an event of a service not working in a server. I have Windows NLB setup with 3 servers (Windows 2008 R2 ENT Server).

    Please kindly advise mates.

    Cheers,

    DB

All Replies

  • Friday, July 13, 2012 11:59 AM
     
     

    Hello DB, 

    Can you please elaborate more and what are you trying to accomplish?


    Regards, Ravikumar P

  • Saturday, July 14, 2012 9:15 AM
     
     

    Hello DB, 

    Can you please elaborate more and what are you trying to accomplish?


    Regards, Ravikumar P

    Basically when a service for instance "print spooler" fails in a server that's part of the NLB cluster, something that will trigger NLB not to route the user who's just logging in to this server that has the failed service.

    Cheers.

  • Saturday, July 14, 2012 11:37 AM
     
     Answered Has Code

    Hi DB, 

    As per my understanding you have configured "print spooler" service as a resource in NLB and now you want to monitor service.

    Here is VB script to check spooler service status:

    strComputer = "." 
    Set objWMIService = GetObject("winmgmts:" _ 
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
     
    Set colRunningServices =  objWMIService.ExecQuery _ 
        ("Select * from Win32_Service Where Name = 'Spooler'") 
     
    For Each objService in colRunningServices  
        Wscript.Echo objService.DisplayName & " -- " & objService.State 
    Next 

    Also I suggest you check this article to configure print spooler as a resource in NLB.

    http://technet.microsoft.com/en-us/library/cc728344(v=ws.10)

    Note: Thorough checking of event viewer and cluster logs will help you in resolving cluster related issues. 


    Regards, Ravikumar P

  • Monday, July 16, 2012 9:21 AM
    Moderator
     
     Answered

    Hi DB,

    Thanks for posting here.

    I’m afraid NLB is not designed in this so it will not detect status of an individual program or service it hosts on each node ,even in Windows server 2008 R2 but will suggest to start looking for solutions from third parties, like the solutions that listed in the KB article below:

    The load balancing service does not detect program or service problems in Windows 2000, in Windows NT, in Windows Server 2003

    http://support.microsoft.com/kb/234151/

    Microsoft NLB service monitoring? 

    http://social.technet.microsoft.com/Forums/en/winserverClustering/thread/d71caa40-a93a-4911-b0a2-8de2098131d4

    delay start for brain dead NLB? 

    http://social.technet.microsoft.com/Forums/en-US/winserverNIS/thread/709e77c3-4e88-4ba3-8680-85730ad35e7e/

    Thanks.

    Tiger Li


    Tiger Li

    TechNet Community Support