OWSUG.ca

Welcome to Ottawa's Windows Server User Group Community!
Welcome to OWSUG.ca Sign in | Join | Help
in Search

Rantings of an IT Pirate

As a pirate is passionate about the open sea, such is my passion about technology. I am the first "ethical" IT Pirate.

Using the Exchange 2007 converted Management Pack and Mail Store Targeting in a Distributed Application - The Good, The Bad, and The Ugly

I was recently working with another colleague from Infront Consulting on a contract.  My colleague is John Hann, he is a MOM MVP and we were tasked to update a SCOM environment to SP1 and incorporate new features like Savision Live Maps and Cross Platform Extensions to monitor Linux servers.

While these were also interesting to work with, the topic is on Exchange 2007 monitoring within a distributed application in SCOM 2007.  We tried a couple of different approaches which I will explain.

The challenge came in treating the mail store as an isolated component to retrieve health state information from that would roll up into the overall health of a distributed application using all of the component relationships that we defined.

The Good - The mail store is definitely monitored within the Exchange 2007 Management Pack.  Health information, performance information, etc are included as one would expect from the knowledge contained in a product Management Pack.

The Bad - Our first instinct was to monitor the Information Store service on the Exchange server itself.  This is done easily enough within the Operations Manager console authoring node using the Windows Service monitor Management Pack template.  The problem was that when the mailbox store was dismounted, it reflected a bad health state using information within the management pack, but did not specifically affect the information store service on the Exchange server...

What is affected then?

The Ugly - Upon further investigation using the Health Explorer, we found that the Exchange mailbox store rolls up into the MOM 2005 rollup computer role object. (As if that is in any way, obvious...)  OK, so we tried targeting the MOM 2005 rollup Computer Role object and sure enough, the Exchange Mailbox store is a selectable object to be used in the distributed application designer. 

Job done, right?

Neigh, neigh...  We tested dismounting the mailbox store again and the health state does show in Health Explorer.  The problem, is that it will not rollup any further to affect the distributed application as desired.

The Solution - While John and I worked together on this particular issue, I must bow to his experience in creating the monitor and finding the script code that we used to get this resolved. 

In John Hann we trust!!!

So, there are a couple of steps here... 

First, we needed to find a separate way to get the mailbox status.  We used a powershell script for that to check on the mailbox store mount status and write the resulting health state to a log file.  We used the get-mailboxdatabase -status script and parameter to get this done. 

Then, we created a 2 state monitor targeted to the Exchange 2007 Mailbox Servers Computer Role object.  That, would allow the rollup to work correctly.

An interesting note here, is that targeting this Group actually affects the health state of the Exchange Server Computer Object which needed to be added into the distributed application designer.

Here is the BLOCKED SCRIPT

On Error Resume Next

Public WshShell, StrApp1, strHosts, strPreCheck, oBag, oAPI

Set oAPI = CreateObject("MOM.ScriptAPI")

Set WshShell = Wscript.CreateObject("WScript.Shell")

Set objFileSystem = CreateObject("Scripting.FileSystemObject")

OutFile = "c:\mbx.ps1"

objFileSystem.DeleteFile OutFile

Set OutputFile = objFileSystem.OpenTextFile(OutFile, 2, True)

OutputFile.WriteLine "get-mailboxdatabase -status | select-object name,mounted | export-csv " & chr(34) & "c:\mb.out" & Chr(34)

OutputFile.close

Set OutputFile = Nothing

InFile = "c:\mb.out"

objFileSystem.DeleteFile InFile

strPSCmd = "PowerShell.exe -PSConsoleFile " & chr(34) & "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1" & Chr(34) & " -Command c:\mbx.ps1"

WshShell.Run strPSCmd, 0, True

strDisMounted = ""

strStatus = "All Mounted"

Set InputFile = objFileSystem.OpenTextFile(InFile, 1, False)

InLine = InputFile.ReadLine

InLine = InputFile.ReadLine

Do While InputFile.AtEndOfStream <> True

InLine = InputFile.ReadLine

Items = Split(InLine,",")

If Items(1) = "False" Then

strDisMounted = strDisMounted & Items(0) & VbCrLf

strStatus = "DisMounted"

End If

Loop

InputFile.Close

Set InputFile = Nothing

objFileSystem.DeleteFile InFile

objFileSystem.DeleteFile OutFile

If strDisMounted = "" Then

strDisMounted = "All Mailstores Mounted"

End If

Set oBag = oAPI.CreatePropertyBag()

Call oBag.AddValue("Status",strStatus)

Call oBag.AddValue("Mounted",strDisMounted)

Call oAPI.Return(oBag)

Now for the monitor:

image

image

image

Important Syntax here is: Property(@Name='Status').  This needs to be associated with "dismounted" for a "Critical" state and "All Mounted" for a "Healthy" state.

Now the job is done!

For great, in-depth, technical training on System Center, check out www.infrontconsulting.com/events.htm.

Published Friday, October 03, 2008 9:40 AM by Brad Bird

Comments

No Comments
Anonymous comments are disabled
Powered by Community Server, by Telligent Systems