KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Configure services monitor

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
luigi.mazzucchetti



Joined: 16 Sep 2004
Posts: 1

PostPosted: Thu Sep 16, 2004 8:31 am    Post subject: Configure services monitor Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu Sep 16, 2004 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
nicksp



Joined: 20 Jan 2004
Posts: 7

PostPosted: Mon Oct 11, 2004 3:36 am    Post subject: Script to monitor failed auto services Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

KS-Soft Forum Index