6

With Active Directory, what is a good way to monitor replication?

I have multiple sites and multiple locations, so ideally both replication between sites and within sites would be monitored. I'm not really sure if each DC needs to be monitored, each NTDS connection, or each DC * Each NTDS connection.

For the purposes of fitting into a standard alerting methodology, perfmon counters that would allow me to alert if replication was behind X minutes seems like it might be ideal.

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444

2 Answers2

5

Looking through the Directory Services Perfmon counters I don't see anything that seems to be exactly what I want.

I happen to use a monitoring system that supports powershell (Orion), so I wrote this up really quick and am going to see how it works for my needs:

#PS Script to Monitor Seconds since Last Successful AD Sync (By taking the longest (max) of any partition 
#KMB 11/22/2011 

#http://archive.msdn.microsoft.com/RepPSAdmin/Release/ProjectReleases.aspx?ReleaseId=5267
import-module -name RepPSAdmin

$hostname = $env:COMPUTERNAME

#PS C:\Windows\system32> Get-ADServerReplicationStatus -ServerName $hostname -SourceServer | Get-Member -memberType *property

$now = Get-Date
$latest = New-Timespan -start $now -end $now
Get-ADServerReplicationStatus -ServerName $hostname -SourceServer | foreach-object { 
    #Write-Host $_.LastSuccessfulSync}
    $temp = $now - $_.LastSuccessfulSync
    #Write-Host $_.LastSuccessfulSync :: $temp :: $temp.TotalSeconds
    if ($temp.TotalSeconds -gt $latest.TotalSeconds) {
        $latest = $temp
    }
}
Write-Host $latest.TotalSeconds

Disclaimer -- this script is still a work and progress and I don't really know powershell :-P

Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
  • You could run repadmin and dcdiag daily and parse/record the results? – mfinni Nov 22 '11 at 17:08
  • Off the top of my head/bookmarks. You could check [repadmin /replsummary](http://technet.microsoft.com/en-us/library/cc770963%28WS.10%29.aspx) and IIRC one DC per site if you have a forest should be more than ok, otherwise there is a very long document on [replication topologies](http://technet.microsoft.com/en-us/library/cc755994%28WS.10%29.aspx) – user Nov 22 '11 at 17:41
  • 1
    Where you're going should work fine, though you'll need to consider that inter-site and intra-site replication connections have different minimum replication intervals (5 minutes and 15 minutes, respectively). – Evan Anderson Nov 22 '11 at 18:43
0

Could you set aside a monitoring namespace in ad ? Then you could periodically write some timestamps to the primary and poll the replicates to see how long it takes for the latest to be replicated.

Nicholas
  • 207
  • 1
  • 7