<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Re: [Nagios-users] Monitor Active Directory Replication</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText46294 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=3><PRE>Here's a script to check synchronization between DCs, more perl scripts are available at</PRE><PRE>http:/rallenhome.com</PRE><PRE> </PRE><PRE># 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";
}
</PRE></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> nagios-users-admin@lists.sourceforge.net
on behalf of Don Alfredo<BR><B>Sent:</B> Mon 5/9/2005 5:24 PM<BR><B>To:</B>
nagios-users@lists.sourceforge.net<BR><B>Subject:</B> Re: [Nagios-users] Monitor
Active Directory Replication<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>On Friday 06 May 2005 15:06, David Jacobson wrote:<BR>> Hi
Nagios Users,<BR>><BR>> Does anyone have a script to monitor if Active
Directory Replication was<BR>> successful? Our goal for 2005 is not to
reinvent the wheel, if someone<BR>> has a script like this it would be
great. Sorry I cannot provide more<BR>> info as I do not like and/or
use Microsoft products.<BR>><BR>> Thanks a mil.<BR><BR>get nagios eventlog
agent here :<BR><A
href="http://www.steveshipway.org/software/f_nagios.html">http://www.steveshipway.org/software/f_nagios.html</A><BR><BR>figure
out the event source and eventID for the directory replication<BR>success /
failure , create a filter for nagios eventlog, create a new
nagios<BR>check-command and you're done.<BR>Do read the manuals, though...
(specially the nsca
stuff)<BR><BR><BR><BR>-------------------------------------------------------<BR>This
SF.Net email is sponsored by: NEC IT Guy Games.<BR>Get your fingers limbered up
and give it your best shot. 4 great events, 4<BR>opportunities to win big!
Highest score wins.NEC IT Guy Games. Play to<BR>win an NEC 61 plasma display.
Visit <A
href="http://www.necitguy.com/?r=20">http://www.necitguy.com/?r=20</A><BR>_______________________________________________<BR>Nagios-users
mailing list<BR>Nagios-users@lists.sourceforge.net<BR><A
href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</A><BR>:::
Please include Nagios version, plugin version (-v) and OS when reporting any
issue.<BR>::: Messages without supporting info will risk being sent to
/dev/null<BR></FONT></P></DIV>
</BODY>
</HTML>