check_ldap_repl.pl
changeset 6 29283ac86185
parent 4 fae19ea0292f
child 8 4b352cbad033
equal deleted inserted replaced
5:1018228e9a11 6:29283ac86185
    41 	DEPENDENT => 4
    41 	DEPENDENT => 4
    42 );
    42 );
    43 
    43 
    44 my $ME      = basename $0;
    44 my $ME      = basename $0;
    45 my $NAME    = "LDAPREPL";
    45 my $NAME    = "LDAPREPL";
    46 my $VERSION = "0.3";
    46 my $VERSION = "0.3.1";
    47 
    47 
    48 my $master_default = "ldap://ldap-master:389/";
    48 my $master_default = "ldap://ldap-master:389/";
    49 my $slave_default = "ldap://ldap-slave:389/";
    49 my $slave_default = "ldap://ldap-slave:389/";
    50 my $cn_default = "replcheck";
    50 my $cn_default = "replcheck";
    51 
    51 
   230 	) if ($type eq "init");
   230 	) if ($type eq "init");
   231 
   231 
   232 	# delete check object
   232 	# delete check object
   233 	$mesg = $ldap->delete("cn=$cn,$context") if ($type eq "delete");
   233 	$mesg = $ldap->delete("cn=$cn,$context") if ($type eq "delete");
   234 
   234 
   235 	if ($mesg->code && ($type eq "delete" || $type eq "init")) {
       
   236 		print "$NAME WARNING: [ldapt] " . $mesg->error . "\n";
       
   237 		exit $ERRORS{WARNING};
       
   238 	}
       
   239 
       
   240 	# refresh check object
   235 	# refresh check object
   241 	$mesg = $ldap->modify(
   236 	$mesg = $ldap->modify(
   242 		"cn=$cn,$context",
   237 		"cn=$cn,$context",
   243 		replace => {
   238 		replace => {
   244 			description => time()
   239 			description => time()
   245 		}
   240 		}
   246 	) if ($opt{refresh});
   241 	) if ($opt{refresh});
       
   242 
       
   243 	if ($mesg->code && ($type eq "delete" || $type eq "init" || $type eq "refresh")) {
       
   244 		print "$NAME WARNING: [ldapt] " . $mesg->error . "\n";
       
   245 		exit $ERRORS{WARNING};
       
   246 	}
   247 
   247 
   248 	$ldap->unbind() if ($ldap);
   248 	$ldap->unbind() if ($ldap);
   249 	return 0;
   249 	return 0;
   250 }
   250 }
   251 
   251 
   417 
   417 
   418 This plugin checks if the ldap replication works correctly.
   418 This plugin checks if the ldap replication works correctly.
   419 
   419 
   420 =head1 VERSION
   420 =head1 VERSION
   421 
   421 
   422 This man page is current for version 0.3 of B<check_ldap_repl>.
   422 This man page is current for version 0.3.1 of B<check_ldap_repl>.
   423 
   423 
   424 =head1 AUTHOR
   424 =head1 AUTHOR
   425 
   425 
   426 Written by Christian Arnold L<arnold@schlittermann.de>
   426 Written by Christian Arnold L<arnold@schlittermann.de>
   427 
   427