Your best source of information and news about BIOS, vista and hardware on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

Mail Store Targeting in a Distributed Application


We’d like to introduce another author on Thelazyadmin.com.

Brad Bird is an IT Professional of 12 years experience.  Currently working as an independent consultant associated with Infront Consulting.  Brad has more than 8 years under his belt specifically in Windows Networking Administration.  Among his specialties are: Windows security, forensics, intrusion prevention and detection, Active Directory implementation, System Center Operations Manager and Data Protection Manager implementation and consulting.  Brad has specifically been focusing his efforts in the non-Windows space with Operations Manager.  His certifications include MCT, MCITP, MCTS, MCSE, MCSA, A+ and Network+.

Most of Brad’s writing will focus on his specialty, System Center products, but you might see some other stuff here and there as well.  Please welcome Brad.

The TLA Team

---------------------------

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 as one would expect and 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. 

get-mailboxdatabase –status

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

   1:  On Error Resume Next
   2:   
   3:  Public WshShell, StrApp1, strHosts, strPreCheck, oBag, oAPI
   4:   
   5:  Set oAPI = CreateObject("MOM.ScriptAPI")
   6:   
   7:  Set WshShell = Wscript.CreateObject("WScript.Shell")
   8:   
   9:  Set objFileSystem = CreateObject("Scripting.FileSystemObject")
  10:   
  11:  OutFile = "c:\mbx.ps1"
  12:   
  13:  objFileSystem.DeleteFile OutFile
  14:   
  15:  Set OutputFile = objFileSystem.OpenTextFile(OutFile, 2, True)
  16:   
  17:  OutputFile.WriteLine "get-mailboxdatabase -status | select-object name,mounted | export-csv " & chr(34) & "c:\mb.out" & Chr(34)
  18:   
  19:  OutputFile.close
  20:   
  21:  Set OutputFile = Nothing
  22:   
  23:  InFile = "c:\mb.out"
  24:   
  25:  objFileSystem.DeleteFile InFile
  26:   
  27:  strPSCmd = "PowerShell.exe -PSConsoleFile " & chr(34) & "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.psc1" & Chr(34) & " -Command c:\mbx.ps1"
  28:   
  29:  WshShell.Run strPSCmd, 0, True
  30:   
  31:  strDisMounted = ""
  32:   
  33:  strStatus = "All Mounted"
  34:   
  35:  Set InputFile = objFileSystem.OpenTextFile(InFile, 1, False)
  36:   
  37:  InLine = InputFile.ReadLine
  38:   
  39:  InLine = InputFile.ReadLine
  40:   
  41:  Do While InputFile.AtEndOfStream <> True
  42:   
  43:  InLine = InputFile.ReadLine
  44:   
  45:  Items = Split(InLine,",")
  46:   
  47:  If Items(1) = "False" Then
  48:   
  49:  strDisMounted = strDisMounted & Items(0) & VbCrLf
  50:   
  51:  strStatus = "DisMounted"
  52:   
  53:  End If
  54:   
  55:  Loop
  56:   
  57:  InputFile.Close
  58:   
  59:  Set InputFile = Nothing
  60:   
  61:  objFileSystem.DeleteFile InFile
  62:   
  63:  objFileSystem.DeleteFile OutFile
  64:   
  65:  If strDisMounted = "" Then
  66:   
  67:  strDisMounted = "All Mailstores Mounted"
  68:   
  69:  End If
  70:   
  71:  Set oBag = oAPI.CreatePropertyBag() 
  72:   
  73:  Call oBag.AddValue("Status",strStatus)
  74:   
  75:  Call oBag.AddValue("Mounted",strDisMounted)
  76:   
  77:  Call oAPI.Return(oBag) 
  78:   
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

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!

Popularity: 1%


Written by rodney.buike. Read more great feeds at is source WEBSITE
no comments.
Read more articles on System Center and brad.bird and otherSoftware.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .