|
View previous topic :: View next topic |
Author |
Message |
luigi.mazzucchetti
Joined: 16 Sep 2004 Posts: 1
|
Posted: Thu Sep 16, 2004 8:31 am Post subject: Configure services monitor |
|
|
Is there a way to monitor all the services on a system that must start in "automatic mode" and they aren't "started" without configuring a rule for every service?
Thanks. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu Sep 16, 2004 12:10 pm Post subject: |
|
|
Sorry, HostMonitor does not have such option. You should create separate test item for each service.
On the other hand, you may create single test to monitor Event Log. Windows records message when some service was not started.
Regards
Alex |
|
Back to top |
|
|
nicksp
Joined: 20 Jan 2004 Posts: 7
|
Posted: Mon Oct 11, 2004 3:36 am Post subject: Script to monitor failed auto services |
|
|
Hi,
Here is a script that we use - it uses wmi to query for all services whos start type = auto and status <> started. Returns the name(s) of the failed services.
Here is the code - it is a bit rough but you should get the drift.
Code: |
Option Explicit
const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"
'---- entry point ----
FUNCTION performtest()
Dim strComputer, qryWMI, failedservices, objWMIService, colServices, objService
IF "%Reply%"="%"+"Reply"+"%" THEN
performtest = statusUnknown+"Please enable 'Translate macros' option"
ELSE
' query all services that are stopped and startup type is auto
strComputer = "."
qryWMI = "Select * from Win32_Service where State='Stopped' AND StartMode='Auto' "
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery(qryWMI)
IF colServices.count > 0 THEN
For Each objService in colServices
failedServices = failedServices & objService.DisplayName & " "
Next
PerformTest = statusBAD & failedservices
ELSE
PerformTest = statusOK
END IF
END IF
END FUNCTION
|
Nick |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|