Changeset 1579
- Timestamp:
- Jun 24, 2010, 1:21:33 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/fedora/config/etc/nagios/check_ldap_mmr.real
r1342 r1579 13 13 my $user = 'cn=Directory Manager'; 14 14 my $passwdfile = '/etc/signup-ldap-pw'; 15 my $base = "cn=config"; 15 my $configBase = "cn=config"; 16 my $replicatedBase = "dc=scripts,dc=mit,dc=edu"; 16 17 my $server="nsDS5ReplicaHost"; 17 18 my $status="nsds5replicaLastUpdateStatus"; … … 20 21 21 22 my $ldap=ConnectLdap(); 22 my $result=LDAPSearch($ldap,"objectClass=nsDS5ReplicationAgreement","",$ base);23 my $result=LDAPSearch($ldap,"objectClass=nsDS5ReplicationAgreement","",$configBase); 23 24 my @entries = $result->entries; 24 my $errors = 0; 25 my $replicaErrors = 0; 26 my $conflictErrors = 0; 25 27 my $errorstring = "Replication error(s): "; 26 28 foreach my $entr ( @entries ) { … … 36 38 print "Status: $serverstatus. "; 37 39 if ($statuscode) { 38 $ errors++;40 $replicaErrors++; 39 41 $errorstring = $errorstring . $serverstatus . ", "; 40 42 } 41 43 } 42 if ($errors > 0) { 44 45 $result=LDAPSearch($ldap,"nsds5ReplConflict=*",["nsds5ReplConflict"],$replicatedBase); 46 @entries = $result->entries; 47 foreach my $entr ( @entries ) { 48 my $conflictingDN=$entr->dn(); 49 my $conflictDesc=$entr->get_value("nsds5ReplConflict"); 50 print "Conflict found for DN $conflictingDN "; 51 print "Reason: $conflictDesc. "; 52 $conflictErrors++; 53 $errorstring = $errorstring . $conflictDesc . ", "; 54 } 55 56 if ($conflictErrors > 0) { 57 &nagios_return("CRITICAL", $errorstring); 58 } elsif ($replicaErrors > 0) { 43 59 &nagios_return("WARNING", $errorstring); 44 60 } else { 45 &nagios_return("OK", "All replicas are OK ");61 &nagios_return("OK", "All replicas are OK and no conflicts are present"); 46 62 } 47 63
Note: See TracChangeset
for help on using the changeset viewer.