repair server

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
claker
Posts: 11
Joined: Fri Feb 24, 2012 12:42 pm

repair server

Post by claker »

All,

Say I have set up a test and I have an action profile assocated with that test but I want to recycle an applicaton pool in IIS rather then restart IIS service. Is there a command I may use for this?

Thanks!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You may use script like this
====================
AppPoolName = "DefaultAppPool"
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery _
("Select * From IIsApplicationPool Where Name LIKE '%/" & AppPoolName & "'")
For Each objItem in colItems
objItem.Recycle
Next

Regards
Alex
claker
Posts: 11
Joined: Fri Feb 24, 2012 12:42 pm

Post by claker »

so i would create a new action profile and under bad status actions click add then execute script from command line or execute HMS script?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You should use "Execute external program" action and command line like
cmd /c cscript /B /E:VBScript recycleIISpool.vbs
(where recycleIISpool.vbs is file with your script)

Regards
Alex
Post Reply