useful cluster log parsing script

useful cluster log parsing script

Post by George Potts [MS » Tue, 02 May 2000 04:00:00



Here's a script that I wrote that might be useful for some folks on these
ng's.

I haven't completely verified that this doesn't strip
out something important, but so far I haven't found anything in the stripped
out stuff that couldn't be essentially ignored.  If nothing else this will
help you home in on the important stuff to get an exact time then go back to
the original log and do a more thorough lookover.

In my testing on a 7 meg SQL Cluster log it compressed it down to 260k.

Cheers :)

Quote:>>>>>>>>>>>>>>>>>>>>>begin script

'Usage: wscript parsesql.vbs <inputfile> <outputfile>

Set objArgs = Wscript.Arguments

oInputFile = objArgs( 0 )
oOutputFile = objArgs( 1 )

' create our file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")

' open a text stream object to begin our parsing
Set oInText = oFSO.OpenTextFile(oInputFile, 1, False)

' open a text to send our data (force creation if needed)
Set oOutText = oFSO.OpenTextFile(oOutputFile, 2, True)

' poll the input stream and perform our parse/replace
Do While Not (oInText.AtEndOfStream)

 ' read in the next line of data
 strInput = oInText.ReadLine
 strOutput = strInput

 bOut = TRUE

 ' if the line has 'SQL Server' on it along with any of the "y=" strings
then
 ' we'll not dump anything to the output stream
 x = InStr(1, strInput, "SQL Server", vbTextCompare)
 If x > 0 Then
  If  TRUE = bOut Then
   y = InStr(1, strInput, "Alive request", vbTextCompare)
   If y > 0 Then
    'if it's an Alive request (is or looks) then s*it
    bOut = FALSE
   End If
  End If

  If  TRUE = bOut Then
   y = InStr(1, strInput, "CheckQueryProcessorAlive: returning TRUE",
vbTextCompare)
   If y > 0 Then
    bOut = FALSE
   End If
  End If

  If  TRUE = bOut Then
   y = InStr(1, strInput, "CheckQueryProcessorAlive: enter", vbTextCompare)
   If y > 0 Then
    bOut = FALSE
   End If
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "MakeSelfRelativeSD failed", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "NmGetClusterOperationalVersion", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[GUM]", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "s_Gum", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] GUM update", vbTextCompare)
  If y > 0 Then
   'bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[API] Notification on port", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[DM] DmUpdateSetValue ", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "Bring online first.", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[dm]DmWriteToQuorumLog Entry Seq#", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] FmpOfflineResourceList: Bring non quorum
resource offline", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "DM: Setting value PersistentState for key
Resources\", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] NotifyCallBackRoutine: enqueuing event",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] FmpRmOnlineResource: called
InterlockedIncrement on gdwQuoBlockingResources", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] FmpRmWorkItemHandler: Exit", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "FmsOfflineResourceRequest: To take resource",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "FmsOnlineResourceRequest: To bring resource",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "DM: Setting value RestartAction for key
Resources\", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "InterlockedDecrement", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "InterlockedIncrement", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] FmpRmOnlineResource: Resource",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "[FM] FmpPropagateResourceState: resource",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "OnlineWaitingTree, Start resource ",
vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

 If  TRUE = bOut Then
  y = InStr(1, strInput, "CppResourceNotify for resource ", vbTextCompare)
  If y > 0 Then
   bOut = FALSE
  End If
 End If

' If  TRUE = bOut Then
'  y = InStr(1, strInput, "New string to find here", vbTextCompare)
'  If y > 0 Then
'   bOut = FALSE
'  End If
' End If

 ' write to our output stream
 If TRUE = bOut Then
  Call oOutText.WriteLine(strOutput)
 End If

Loop

' we are done, close and release our objects
Call oInText.Close
Call oOutText.Close

Set oInText = Nothing
Set oOutText = Nothing
Set oFSO = Nothing
<<<<<<<<<<<<<<<end script

 
 
 

useful cluster log parsing script

Post by ccro.. » Wed, 03 May 2000 04:00:00


You must not have had anything interesting (ie problems ;)) happen in
your 7MB example - mine only went from 6MB to 3MB.
But it's an excellent foundation to build on - thanks heap!!

Cam



Quote:> Here's a script that I wrote that might be useful for some folks on
these
> ng's.

> I haven't completely verified that this doesn't strip
> out something important, but so far I haven't found anything in the
stripped
> out stuff that couldn't be essentially ignored.  If nothing else this
will
> help you home in on the important stuff to get an exact time then go
back to
> the original log and do a more thorough lookover.

> In my testing on a 7 meg SQL Cluster log it compressed it down to
260k.

> Cheers :)

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

useful cluster log parsing script

Post by George Potts [MS » Wed, 03 May 2000 04:00:00


It was tweaked for a SQL Cluster, and anyone who has looked through a SQL
Cluster log knows how chatty SQL is.  The code is pretty easy to understand
and should be pretty easy to tweak for your particular Cluster.

Cheers :)


> You must not have had anything interesting (ie problems ;)) happen in
> your 7MB example - mine only went from 6MB to 3MB.
> But it's an excellent foundation to build on - thanks heap!!

> Cam



> > Here's a script that I wrote that might be useful for some folks on
> these
> > ng's.

> > I haven't completely verified that this doesn't strip
> > out something important, but so far I haven't found anything in the
> stripped
> > out stuff that couldn't be essentially ignored.  If nothing else this
> will
> > help you home in on the important stuff to get an exact time then go
> back to
> > the original log and do a more thorough lookover.

> > In my testing on a 7 meg SQL Cluster log it compressed it down to
> 260k.

> > Cheers :)

> Sent via Deja.com http://www.deja.com/
> Before you buy.

 
 
 

useful cluster log parsing script

Post by Scott Schnoll [MVP » Wed, 03 May 2000 04:00:00


Cool!  Thanks for sharing this, too, George!
--
Regards,

Scott Schnoll, MCSE MCT MCP+I
Microsoft MVP
TNT Software - http://www.tntsoftware.com
Microsoft Cluster Server Center -
http://www.nwnetworks.com/cluster.html
Internet Explorer Security Center -
http://www.nwnetworks.com/iesc.html

"George Potts [MS]" <gpo...@spamlessmicrosoft.com> wrote in message
news:OTjgmj8s$GA.208@cppssbbsa02.microsoft.com...

> Here's a script that I wrote that might be useful for some folks on
these
> ng's.

> I haven't completely verified that this doesn't strip
> out something important, but so far I haven't found anything in the
stripped
> out stuff that couldn't be essentially ignored.  If nothing else
this will
> help you home in on the important stuff to get an exact time then go
back to
> the original log and do a more thorough lookover.

> In my testing on a 7 meg SQL Cluster log it compressed it down to
260k.

> Cheers :)

> >>>>>>>>>>>>>>>>>>>>>begin script
> 'Usage: wscript parsesql.vbs <inputfile> <outputfile>

> Set objArgs = Wscript.Arguments

> oInputFile = objArgs( 0 )
> oOutputFile = objArgs( 1 )

> ' create our file system object
> Set oFSO = CreateObject("Scripting.FileSystemObject")

> ' open a text stream object to begin our parsing
> Set oInText = oFSO.OpenTextFile(oInputFile, 1, False)

> ' open a text to send our data (force creation if needed)
> Set oOutText = oFSO.OpenTextFile(oOutputFile, 2, True)

> ' poll the input stream and perform our parse/replace
> Do While Not (oInText.AtEndOfStream)

>  ' read in the next line of data
>  strInput = oInText.ReadLine
>  strOutput = strInput

>  bOut = TRUE

>  ' if the line has 'SQL Server' on it along with any of the "y="
strings
> then
>  ' we'll not dump anything to the output stream
>  x = InStr(1, strInput, "SQL Server", vbTextCompare)
>  If x > 0 Then
>   If  TRUE = bOut Then
>    y = InStr(1, strInput, "Alive request", vbTextCompare)
>    If y > 0 Then
>     'if it's an Alive request (is or looks) then scrap it
>     bOut = FALSE
>    End If
>   End If

>   If  TRUE = bOut Then
>    y = InStr(1, strInput, "CheckQueryProcessorAlive: returning
TRUE",
> vbTextCompare)
>    If y > 0 Then
>     bOut = FALSE
>    End If
>   End If

>   If  TRUE = bOut Then
>    y = InStr(1, strInput, "CheckQueryProcessorAlive: enter",
vbTextCompare)
>    If y > 0 Then
>     bOut = FALSE
>    End If
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "MakeSelfRelativeSD failed", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "NmGetClusterOperationalVersion",
vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[GUM]", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "s_Gum", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] GUM update", vbTextCompare)
>   If y > 0 Then
>    'bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[API] Notification on port",
vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[DM] DmUpdateSetValue ", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "Bring online first.", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[dm]DmWriteToQuorumLog Entry Seq#",
vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] FmpOfflineResourceList: Bring non
quorum
> resource offline", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "DM: Setting value PersistentState for key
> Resources\", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] NotifyCallBackRoutine: enqueuing
event",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] FmpRmOnlineResource: called
> InterlockedIncrement on gdwQuoBlockingResources", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] FmpRmWorkItemHandler: Exit",
vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "FmsOfflineResourceRequest: To take
resource",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "FmsOnlineResourceRequest: To bring
resource",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "DM: Setting value RestartAction for key
> Resources\", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "InterlockedDecrement", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "InterlockedIncrement", vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] FmpRmOnlineResource: Resource",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "[FM] FmpPropagateResourceState: resource",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "OnlineWaitingTree, Start resource ",
> vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

>  If  TRUE = bOut Then
>   y = InStr(1, strInput, "CppResourceNotify for resource ",
vbTextCompare)
>   If y > 0 Then
>    bOut = FALSE
>   End If
>  End If

> ' If  TRUE = bOut Then
> '  y = InStr(1, strInput, "New string to find here", vbTextCompare)
> '  If y > 0 Then
> '   bOut = FALSE
> '  End If
> ' End If

>  ' write to our output stream
>  If TRUE = bOut Then
>   Call oOutText.WriteLine(strOutput)
>  End If

> Loop

> ' we are done, close and release our objects
> Call oInText.Close
> Call oOutText.Close

> Set oInText = Nothing
> Set oOutText = Nothing
> Set oFSO = Nothing
> <<<<<<<<<<<<<<<end script

 
 
 

1. shell script to parse alert log looking for certain ora- errors

I'm pretty new to writing shell scripts, being mostly familiar with VMS.
I'm now a DBA on a Sun Solaris system.   I need a script that
parses through the alert logs looking for certain ora errors: such as
600... etc.

Is there some samples somewhere that I could use?

Thanks in advance,

2. Oracle Vs Access

3. CONNECT BY loop error & useful script

4. static linkage with libpq?

5. Some useful scripts

6. Identifying duplicates using SQL in VFP6

7. Useful script for Linux

8. Is there MM features in Sybase

9. HOWTO get useful information from LOG?

10. Redo logs only useful if archiving on

11. Sample script to parse records

12. Query parsing script