Monitor Active Directory Replication

Collier, Tirus tpcollier at liberty.edu
Tue May 10 16:54:33 CEST 2005


Here's a script to check synchronization between DCs, more perl scripts are available at
http:/rallenhome.com
 
# This Perl code prints the up-to-dateness vector for the DCs defined in
# the  arrDCList for the naming context defined by $strNCDN

# ---------------------------------------------------------------
# Adapted from VBScript code contained in the book:
#      "Active Directory Cookbook" by Robbie Allen
# Publisher: O'Reilly and Associates
# ISBN: 0-596-00466-4
# Book web site: http://rallenhome.com/books/adcookbook/code.html
# ---------------------------------------------------------------

# ------ SCRIPT CONFIGURATION ------
# Set to the DN of the naming context you want to check the DCs against
my $strNCDN = "<NamingContextDN>";
# Enter 2 or more DCs to compare
my @arrDCList = ("<DC1Name>","<DC2Name>");
# ------ END CONFIGURATION ---------
use Win32::OLE 'in';
$Win32::OLE::Warn = 3;
my $objIadsTools = Win32::OLE->CreateObject("IADsTools.DCFunctions");

foreach my $strDC (@arrDCList) {
   print "Replication partner USNs for $strDC:\n";
   $intUSN = $objIadsTools->GetHighestCommittedUSN( $strDC,0);
   if ($intUSN == -1) {
      print "Error retrieving USN: ", $objIadsTools->LastErrorText,"\n";
      exit;
   }
   print "\t$strDC = $intUSN\n";

   my $intRes = $objIadsTools->GetReplicationUSNState( $strDC, $strNCDN,0,0);
   if ($intRes == -1) {
      print "Error retrieving USNs: ", $objIadsTools->LastErrorText,"\n";
      exit;
   }
   foreach my $count (1 .. $intRes) {
      print "\t", $objIadsTools->ReplPartnerName($count),
                " = ", $objIadsTools->ReplPartnerUSN($count),"\n";
   }
   print "\n";
}


________________________________

From: nagios-users-admin at lists.sourceforge.net on behalf of Don Alfredo
Sent: Mon 5/9/2005 5:24 PM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Monitor Active Directory Replication



On Friday 06 May 2005 15:06, David Jacobson wrote:
> Hi Nagios Users,
>
> Does anyone have a script to monitor if Active Directory Replication was
> successful?  Our goal for 2005 is not to reinvent the wheel, if someone
> has a script like this it would be great.  Sorry I cannot provide more
> info as I do not like and/or use Microsoft products.
>
> Thanks a mil.

get nagios eventlog agent here :
http://www.steveshipway.org/software/f_nagios.html

figure out the event source and eventID for the directory replication
success / failure , create a filter for nagios eventlog, create a new nagios
check-command and you're done.
Do read the manuals, though... (specially the nsca stuff)



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050510/2d506394/attachment.html>


More information about the Users mailing list