Monitoring Exchange 2016 with SCOM – Custom MP bug

As you may, or may not, know there is a huge difference in how Exchange 2016 (and 2013) is monitored by SCOM. Exchange Server 2013 introduces a new feature called Managed Availability, which is a built-in monitoring system with self-recovery capabilities. Basically, Exchange monitors it self and writes down an event which SCOM then reads and creates an alert. There are no overrides or thresholds that can be configured in SCOM – everything is done on the Exchange server. You can read more here.

While working with one of my clients we have discovered that some of the information is missing from monitoring – like queues, DB replicas health and etc. To compensate that, there’s a custom MP that gives you monitoring for all, or some, of the components and its called Microsoft.Exchange.15.Custom.Extension, you can read more about the MP and download it in this link.

From my experience this is a pretty good MP and it works very good – except one bug I found and wanted to share with how to fix it.

On my Exchange servers, I’ve noticied some erros in the ‘Operations Manager’ log on the Exchange 2016 server:

The Microsoft Operations Manager Expression Filter Module could not convert the received value to the requested type.

Property Expression: Property[@Name=’LastBackupDays’]

Property Value: -736,635

The problem is with the monitoring script. I’ve opened the Management Pack for authoring (I use Notepadd++) and found the script under:


<ProbeActionModuleType ID="Custom.Exchange.2013.Mailbox.LastAnyBAckup.Check" Accessibility="Internal" Batching="false" PassThrough="false">

and


<ProbeActionModuleType ID="Custom.Exchange.2013.Mailbox.LastBAckup.Check" Accessibility="Internal" Batching="false" PassThrough="false">

The script it self begins with a few declarations:


$MBdbs = Get-Mailboxdatabase -server $Server -status

$MBdbs = Get-Mailboxdatabase -server $Server -status

$PFdbs = Get-PublicFolderDatabase -server $Server -status

$Today = Get-Date

$api = new-object -comObject 'MOM.ScriptAPI

Notice the $Today which basically holds the curernt date/time and is used for comparing the difference between the last backup.

During the comparison, the scripts performs the following:


$fullago = $now - $lastfull

$fullago = $fullago.TotalDays

$fullago = "{0:N0}" -f $fullago

As you can see in the first row, it compares the last full backup (exported property on the DB) to a $Now variable/object – but this object is newer declared and never used anywhere…

This should actually be $Today – the variable/object declared previously:


$fullago = $Today - $lastfull

$fullago = $fullago.TotalDays

$fullago = "{0:N0}" -f $fullago

The MP is unsealed so you can simply export it, edit the mentioned script and re-import it. This should resolve the issue and you shouldn’t see anymore issues in the log.

Let me know how that works out for you.

What do you think about this post?