There are a number of discussions re monitoring XI3 so I thought it best to just list some options.
Note: these solutions all require additional work so choose wisely as to which strategy to adopt in investing your time and effort.
First understand what is running :
Use Task manager or Process Monitor or Process Explorer:
SAP/BOE Monitoring
The download contains a document as to using MOMS, Tivoli and Probes - read this document irrespective of which strategy you adopt as it also provides some generic pointers as to setting up a monitoring strategy as well as including some useful guides as to what can be monitored.
https://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/b08e88db-7a98-2b10-8bbd-a699b7bd0290
More on MOMS
Not many are aware of this product, but it helps to always check with your server and network support guys prior to adopting a monitoring strategy as they are sure to have some industry standard already in place. http://www.microsoft.com/systemcenter/operationsmanager/en/us/default.aspx
Quick Ref Custom Scripts:
http://www.systemcenterforum.org/wp-content/uploads/Process_monitor_in_MOM1.doc
Nagios (OpenSource)
This is an industry accepted alternative that offers a wider scope than just BOE monitoring: http://www.nagios.org/
For Windows read: http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html
There are additional addons & plugins available including a check for muliple processes:
http://www.monitoringexchange.org/cgi-bin/page.cgi?g=Detailed%2F1431.html;d=1
Scripts
I’m always of the opion that you can find something similar to what you want on the net, and then just customize it accordingly.
In this instance, you have to separate out service and process checks i.e. CMS and SIA, and then all your BO processes.
There are a number of service monitoring scripts around so I’ll concentrate on processes.
But here’s the kicker, you have multiple processes depending on how you’ve scaled your system i.e. multiple JobServers etc.
To play around with how to access process info you can use this script which will list them:
’ Process.vbs
’ Free Sample VBScript to discover which processes are running
’ Author Guy Thomas http://computerperformance.co.uk/
’ Version 1.4 - December 2005
’ -------------------------------------------------------’
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\” _
& strComputer & “\root\cimv2”)
Set colProcess = objWMIService.ExecQuery _
(“Select * from Win32_Process Where Name = ‘CMS.exe’ OR Name = ‘sia.exe’ OR Name = ‘JobServer.exe’ OR Name = ‘ConnectionServer.exe’ OR Name = ‘crcache.exe’ OR Name = ‘crproc.exe’ OR Name = ‘AAAnalytics.exe’ OR Name = ‘AADashboard.exe’ OR Name = ‘fccache.exe’ OR Name = ‘fcproc.exe’ OR Name = ‘EventServer.exe’ OR Name = ‘fileserver.exe’ OR Name = ‘AAMetrics.exe’ OR Name = ‘AASPC.exe’ OR Name = ‘crystalras.exe’ OR Name = ‘AAProfiler.exe’ OR Name = ‘AAQueryMgr.exe’ OR Name = ‘WIReportServer.exe’”)
For Each objProcess in colProcess
strList = strList & vbCr & _
objProcess.Name
Next
WSCript.Echo strList
WScript.Quit
’ End of List Process Example VBScript
Multiple Processes
To extend this you can look into how to test for multiple process - there are two files (ini and vbs) and they are nagios compliant:
Ini file containing the logic:
'* File : check_processes.ini
'*
'* Usage : Read from check_processes.vbs in same directory
'*
'* Syntax : Create a section for each process to monitor
'*
'* [process]
'*
'* Where is a number starting with 1 and incremented for each process to monitor
'*
'* Each section should have to parameters :
'*
'* name="<process_name>"
'* instances="<number_of_instances>"
'* criticity=""
'*
'* Where : <process_name> is the name of the process to monitor as specified in task manager
'*
'* is either “=” or “>” or “<” to specify the if the number of instances of
'* the given process should be respectively equal, higher or smaller than the <number_of_instances>
'*
'* <number_of_instances> is the number of allowed instances of the given process
'*
'*
'* is the criticity of the alarm reported to nagios if the number of
'* instances of the process is not in allowed range (WARNING or CRITICAL)
'*
'* Double quote should be used around each parameters value
'*
'* Example : [process1]
'* name=“JobServer.exe”
'* instances="<10"
'* criticity=“WARNING”
'*
'* [process2]
'* name=“fcproc.exe”
'* instances=">1"
'* criticity=“CRITICAL”
'*
'*
'* This example will report a warning alert to nagios if 6 or more processes storageArchive.exe are running
'*
'* This example will report a critical alert to nagios if process sqlserver.exe is not running
'*
'**************************************************************************************************
[process1]
name=“JobServer.exe”
instances="<10"
criticity=“WARNING”
[process2]
name=“fcproc.exe”
instances=">1"
criticity=“CRITICAL”
The script you run to call the above ini file:
'********************************************************************
'*
'* Copyright (c) Pierre Gremaud : checks windows processes
'*
'* Module Name: Check_Processes.vbs
'*
'* Arguments: none
'*
'* Parameters : Read from file check_processes.ini in same directory
'*
'* Output : Nagios compatible Exit code (Ok, Warning, Critical or Unknown)
'*
'* and output message with monitored processes and results.
'*
'* Example:
'*
'* OK : JobServer.exe → (9<10);fcproc.exe → (1>0);
'*
'********************************************************************
'Global declaration
’ ON ERROR RESUME NEXT
ON ERROR GOTO 0
Err.Clear
'Constant declaration
CONST Exit_OK = 0
CONST Exit_Warning = 1
CONST Exit_Critical = 2
CONST Exit_Unknown = 3
'Creates needed objects
Set objWMIService = GetObject(“winmgmts:\.\root\cimv2”)
Set dicProcesses = CreateObject(“Scripting.Dictionary”)
Set colListOfProcesses = objWMIService.ExecQuery (“Select * from Win32_Process”)
Set filesys = CreateObject(“Scripting.FileSystemObject”)
'Gets current script path
strScriptPath=Left(WScript.ScriptFullName,Instr(WScript.ScriptFullName,WScript.ScriptName)-1)
'Creates Dictionary dicProcesses with processes and number of instances
'Loops for each processes
For Each objProcess in colListOfProcesses
strProc=Ucase(objProcess.Name)
If dicProcesses.Exists(strProc) Then
'Increments intances number
dicProcesses.Item(strProc)=dicProcesses.Item(strProc)+1
Else
'Creates new item
dicProcesses.Add strProc,"1"
End if
Next
'Inits variables
strWorstStatus=“OK”
strMessage=""
i=1
Do Until RemoveQuotes(ReadINIFile(strScriptPath & “check_processes.ini”,“process” & i,“name” )) = “”
'Reads the ini file
strName = RemoveQuotes(ReadINIFile(strScriptPath & “check_processes.ini”,“process” & i,“name” ))
strInstances = RemoveQuotes(ReadINIFile(strScriptPath & “check_processes.ini”,“process” & i,“instances” ))
strCriticity = RemoveQuotes(ReadINIFile(strScriptPath & “check_processes.ini”,“process” & i,“criticity” ))
'Put everything in upper case
strName = Ucase(strName)
strInstances = Ucase(strInstances)
strCriticity = Ucase(strCriticity)
'Removes > and < signs form strInstances
If IsNumeric(strInstances) then
strOperator="="
ElseIf Left(strInstances,1)=">" then
strOperator=">"
strInstances=Right(strInstances,Len(strInstances)-1)
ElseIf Left(strInstances,1)="<" then
strOperator="<"
strInstances=Right(strInstances,Len(strInstances)-1)
ElseIf Left(strInstances,1)="=" then
strOperator="="
strInstances=Right(strInstances,Len(strInstances)-1)
Else
wscript.echo "Please specify a correct number on instances in check_process.ini file for process " & strName
wscript.Quit(Exit_Unknown)
End If
'Checks that strInstances is numeric
If NOT IsNumeric(strInstances) then
wscript.echo "Please specify a valid number on instances in check_process.ini file for process " & strName
wscript.Quit(Exit_Unknown)
End If
'Checks that strCriticity is valid
If (strCriticity <> “WARNING”) and (strCriticity <> “CRITICAL”) Then
wscript.echo "Please specify a valid criticity in check_process.ini file for process " & strName
wscript.Quit(Exit_Unknown)
End If
'If process does not run and is not supposed to run then OK
If NOT dicProcesses.Exists(strName) Then
If ((strOperator)="=") and (strInstances = “0”) or _
((strOperator)="<") and (strInstances <> “0”) Then
strMessage=strMessage & strName & " -> (0" & strOperator & strInstances & ");"
'If process does not run and is supposed to run at least once then KO
Else
strMessage=strMessage & strName & " -> (0" & strOperator & strInstances & ");"
'updates status
If strWorstStatus <> "CRITICAL" Then
strWorstStatus = strCriticity
End If
End If
Else
'If the process runs and the number of instances is OK
If ((strOperator)="=" and (Cstr(dicProcesses.Item(strName)) = strInstances)) or _
((strOperator)="<" and (Cstr(dicProcesses.Item(strName)) < strInstances)) or _
((strOperator)=">" and (Cstr(dicProcesses.Item(strName)) > strInstances)) Then
strMessage=strMessage & strName & " -> (" & Cstr(dicProcesses.Item(strName)) & strOperator & strInstances & ");"
'If the process runs and the number of instances is Not OK
ElseIf ((strOperator)="=" and (Cstr(dicProcesses.Item(strName)) <> strInstances)) or _
((strOperator)="<" and (Cstr(dicProcesses.Item(strName)) >= strInstances)) or _
((strOperator)=">" and (Cstr(dicProcesses.Item(strName)) <= strInstances)) Then
strMessage=strMessage & strName & " -> (" & Cstr(dicProcesses.Item(strName)) & strOperator & strInstances & ");"
'updates status
if strWorstStatus <> "CRITICAL" Then
strWorstStatus = strCriticity
End If
End If
End If
i=i+1
Loop
'Cleans up a little
Set objWMIService = Nothing
Set dicProcesses = Nothing
Set colListOfProcesses = Nothing
'Treats results
If strMessage="" Then
wscript.echo “Nothing to do, please check file check_processes.ini”
wscript.Quit(Exit_Unknown)
ElseIf strWorstStatus=“OK” Then
wscript.echo "OK : " & strMessage
Wscript.Quit(Exit_OK)
ElseIf strWorstStatus=“WARNING” Then
wscript.echo "WARNING : " & strMessage
Wscript.Quit(Exit_Warning)
ElseIf strWorstStatus=“CRITICAL” Then
wscript.echo "CRITICAL : " & strMessage
Wscript.Quit(Exit_Critical)
Else
wscript.echo "UNKNOWN : " & strMessage
wscript.Quit(Exit_Unknown)
End If
’ This line should never been executed
wscript.Quit(Exit_Unknown)
Function ReadINIFile(FileName, Section, KeyName)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim INIContents, PosSection, PosEndSection, sContents, Value, Found, INILine
‘Get contents of the INI file As a string
Set filetxt = filesys.OpenTextFile(FileName, ForReading, False)
Do Until filetxt.AtEndOfStream
INILine = filetxt.ReadLine
If Instr(INILine,"’")=0 Then
INIContents = INIContents & INILine & vbCrLf
End If
Loop
filetxt.close
'Find section
PosSection = InStr(1, INIContents, “[” & Section & “]”, vbTextCompare)
If PosSection>0 Then
'Section exists. Find end of section
PosEndSection = InStr(PosSection, INIContents, vbCrLf & “[”)
'Is this last section?
If PosEndSection = 0 Then
PosEndSection = Len(INIContents)+1
End If
'Separate section contents
sContents = Mid(INIContents, PosSection, PosEndSection - PosSection)
If InStr(1, sContents, vbCrLf & KeyName & "=", vbTextCompare)>0 Then
Found = True
' Separate value of a key.
ReadINIFile = SeparateField(sContents, vbCrLf & KeyName & "=", vbCrLf)
End If
End If
End Function
'Separates one field between sStart And sEnd
Function SeparateField(ByVal sFrom, ByVal sStart, ByVal sEnd)
Dim PosB: PosB = InStr(1, sFrom, sStart, 1)
If PosB > 0 Then
PosB = PosB + Len(sStart)
Dim PosE: PosE = InStr(PosB, sFrom, sEnd, 1)
If PosE = 0 Then PosE = InStr(PosB, sFrom, vbCrLf, 1)
If PosE = 0 Then PosE = Len(sFrom) + 1
SeparateField = Mid(sFrom, PosB, PosE - PosB)
End If
End Function
'Remove left and right quote
Function RemoveQuotes(ByVal strParam)
If strParam = “” Then
RemoveQuotes=""
Else
'Removes the left quotes
strParam=Right(strParam,Len(strParam)-InStr(strParam,""""))
'Removes the right quote
strParam=Left(strParam,InStr(strParam,"""")-1)
RemoveQuotes=strParam
End If
End Function
Good Luck …
MikeD (BOB member since 2002-06-18)