Huntland Services Ltd

Tel: +44 (0)1392-490518
Fax: +44 (0)1392-428003
Enquiries@huntland.co.uk

Event Statistics Portfolio

Back Download The Scripts

 

Introduction

What is the chief source for Events in my organisation?  On my SQL Server, which events are the most frequent and how long do they take before being registered in my database? 

The following scripts list events from various angles to provide a view on how many are being created and by whom.  The output will be displayed on screen and also written to a TXT file or CSV file suitable for use with Excel.  The result includes latency details indicating how many seconds it took (Max, Min and Average) from the condition first being detected to the point where it was committed to the Database.  This reflects how well Mom is keeping up.   If the Agent has been in constant contact with the CAM then these figures will be low, but if contact has been interrupted for any reason the latency figures will rise dramatically.

Because of the size of the output these scripts should only be run from a Command Prompt using CSCRIPT.  You will need to specify the following paramaters:

  1. myMomSqlServer - The name of the server hosting the MOM Onepoint Database
  2. outputFile - the full path and name of the file to be used for output.  Specifying a CSV extension will produce a comma separated output suitable for use with Excel.  All other extensions will produce a Text output suitable for other reporting tools.
  3. myServer - the name of the computer to which you want to limit the results.  For example specify 'Server1' if you are only interested in alerts/events for that machine.   SQL wild cards are valid so that Server% or just % widen the scope of eligible machines to be included.

In all cases your account must have access to the MOM SQL Server and at least read access to the Onepoint database.  Windows Security ('Integrated') is assumed.

If your database is many gigabytes in size then you can expect a delay while the query runs.  Each script has two commented timeout values controlling the maximum connection time and the maximum time to run a command.  By default these are set low and may have to be increased for larger databases.

 

1. EventSource.vbs

Purpose:   To list which sources are responsible for registering events per machine.

Syntax:     cscript  eventSource .vbs   myMomSqlServer     C:\temp\eventSource.txt     myServer

Result:

Computer Source Total # Max Min Avg
myServer SMS Performance Data Provider 132142 234 0 523
myServer SQLSERVERAGENT 2345 12 0 25
myServer Null 561 24 0 12

 

 

 

 

2. EventSource_Summary.vbs

Purpose:  To list which sources are responsible for registering events altogether

Syntax:   cscript   eventSource_Summary.vbs   myMomSqlServer     C:\temp\eventSourceSummary.txt    

Result:

Source Total # Max Min Avg
Security 23456 456 0 345
OnePoint Operations Agent 5647 34 0 12
NNTPSVC 3456 45 0 18

 

 

 

 

3. EventProvider.vbs

Purpose: To list which providers have been delivering events per machine

Syntax:  cscript   eventProvider.vbs   myMomSqlServer     C:\temp\eventProv.txt     myServer

Result:

Computer Provider Total # Max Min Avg
myServer System 34 5 0 3
myServer Internally-generated Event 27 12 0 8
myServer File Replication Service 12 234 0 56

 

 

 

 

4. EventProvider_Summary.vbs

Purpose:  To list which providers have been delivering events altogether

Syntax:  cscript   eventProvider_Summary.vbs   myMomSqlServer     C:\temp\eventProv_Summary.txt 

Result:

Provider Total # Max Min Avg
Application 345 456 0 345
DNS Server 281 34 0 12
PingFail Log File 57 45 0 18

 

 

 

 

5. EventSummary.vbs

Purpose:   A summary of all events

Syntax:  cscript   eventSummary.vbs   myMomSqlServer     C:\temp\eventSummary.txt     myServer

Result:

Computer Total # Max Min Avg
Server23 32678 5 0 3
Server12 15345 12 0 8
Server99 2435 234 0 56

 

 

 

 

 

Please accept these scripts as is.  Any feedback will be gratefully received at Debug@Huntland.co.uk