How To Monitor Backup Status in Argent for Exchange
Introduction
Microsoft Exchange 2007 and 2010 now provides the ability to query when the Last full backup was completed on a particular mailbox database using powershell cmdlet.
Microsoft provides a cmdlet to show the status of Mailbox Database – the following article will show how to incorporate these as rules into Argent for Exchange.
First we will explain the cmdlets that we will use to collect the Backup Status Information
Backup Completion Cmdlets
$dbs = Get-MailboxDatabase -status | format-table name, lastfullbackup
Use the Get-MailboxDatabase cmdlet to view status information about mailbox databases.
This will show when the last full backup was completed.
Creating A Powershell Script Rule
First create a new Rule Group and then Rule
We will look at creating the Backup Completed Rule here – Paste the Code (see Appendix A) into the main window as shown below.
We must load the Powershell Snap-In for Exchange 2010 when we run this script as these cmdlets are only available in the Exchange Management Shell
Microsoft.Exchange.Management.PowerShell.E2010
We must load the Powershell Snap-In for Exchange 2007 when we run this script as these cmdlets are only available in the Exchange Management Shell
Microsoft.Exchange.Management.PowerShell.Admin
We can now TEST this rule against an Exchange Mailbox Server with the following result shown below.
Rule: PS_BACKUP_STATUS Server: MBXSERVER Test On: ARGENT Test By: argent Local Time: Wed, 11 Aug 2010 18:29:50 UTC Time: Wed, 11 Aug 2010 06:29:50 Rule Result: Not Broken ---------------------------------- Trace ------------------------------------------ 18:29:26.652 Start testing server MBSERVER1 using 64-bit Monitor Engine 18:00:00 DB2 09/23/2010 01:00:04 18:00:00 DB3 09/23/2010 01:00:04 18:00:00 DB4 09/23/2010 01:00:04 18:00:00 DB1 09/23/2010 01:00:04 18:00:00 DB5 09/23/2010 03:30:04 18:00:00 DB6 09/23/2010 03:30:04 18:00:00 DB7 09/23/2010 03:30:04 18:00:00 DB8 09/23/2010 03:30:04 18:00:00 SGJ 09/23/2010 04:20:04
In this case the rule is NOT BROKEN as all of the BackupTests Passed, if any of these Databases were not backed up in the last 7 days we would trigger a BROKEN Rule.
This RULE can now be added to a relator and run against a Monitoring Group that contains MAILBOX servers.
Appendix A – Backup Status Powershell Script
$dbs = Get-MailboxDatabase -status | where-object {$_.Server -eq $PSPlayer.TargetServer} foreach ($db in $dbs) { $status = $db.name + " " + $db.lastfullbackup $PSPlayer.WriteStatus($status) if ($db.LastFullBackup -lt ($(Get-Date).AddDays(-7))) { $message = [System.String]::Format("Last Full Backup for '{0}' was on '{1}' ", $db.name, $db.lastFullBackup) $summary = "Last Full Backup older than 8 Days" $PSPlayer.FireEvent($message, $summary, $result) } }