diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-05-08 17:22:33 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-05-08 17:22:33 +0000 |
commit | 2745fb363783239ad5f2f448f229c1896a5746ae (patch) | |
tree | c39c02cf3dc6d441d06bfa60c0e284e269a465ef /ldap/admin | |
parent | 53c8d0a8f6b1fd1a52bc08dda160b977ca606006 (diff) | |
download | ds-2745fb363783239ad5f2f448f229c1896a5746ae.tar.gz ds-2745fb363783239ad5f2f448f229c1896a5746ae.tar.xz ds-2745fb363783239ad5f2f448f229c1896a5746ae.zip |
Resolves: #239337
Summary: Change the name and location of template-cl-dump.pl and template-repl-monitor.pl
Description: 1) Removed "template-" from the script name
2) added shell script wrappers cl-dump and repl-monitor
3) moved them to bindir
Diffstat (limited to 'ldap/admin')
-rwxr-xr-x | ldap/admin/src/scripts/cl-dump.pl (renamed from ldap/admin/src/scripts/template-cl-dump.pl.in) | 51 | ||||
-rwxr-xr-x | ldap/admin/src/scripts/repl-monitor.pl (renamed from ldap/admin/src/scripts/template-repl-monitor.pl.in) | 147 |
2 files changed, 92 insertions, 106 deletions
diff --git a/ldap/admin/src/scripts/template-cl-dump.pl.in b/ldap/admin/src/scripts/cl-dump.pl index 3b2730ab..e71c96ce 100755 --- a/ldap/admin/src/scripts/template-cl-dump.pl.in +++ b/ldap/admin/src/scripts/cl-dump.pl @@ -1,4 +1,4 @@ -#{{PERL-EXEC}} +#!/usr/bin/env perl # BEGIN COPYRIGHT BLOCK # This Program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -33,7 +33,7 @@ # # # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. -# Copyright (C) 2005 Red Hat, Inc. +# Copyright (C) 2007 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK ################################################################################### @@ -41,70 +41,63 @@ # FILE: cl-dump.pl # # SYNOPSIS: +# cl-dump.pl [-h host] [-p port] [-D bind-dn] -w bind-password | -P bind-cert +# [-r replica-roots] [-o output-file] [-c] [-v] # -# cl-dump.pl [-h host] [-p port] [-D bind-dn] -w bind-password | -P bind-cert\ -# [-r replica-roots] [-o output-file] [-c] [-v]\n"; -# -# cl-dump.pl -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]\n"; +# cl-dump.pl -i changelog-ldif-file-with-base64encoding [-o output-file] [-c] # # DESCRIPTION: # Dump and decode Directory Server replication change log # # OPTIONS: -# # -c Dump and interpret CSN only. This option can be used with or -# without -i option. +# without -i option. # # -D bind-dn -# Directory server's bind DN. Default to "cn=Directory Manager" if -# the option is omitted. +# Directory server's bind DN. Default to "cn=Directory Manager" if +# the option is omitted. # # -h host -# Directory server's host. Default to the server where the script -# is running. +# Directory server's host. Default to the server where the script +# is running. # # -i changelog-ldif-file-with-base64encoding -# If you already have a ldif-like changelog, but the changes -# in that file are encoded, you may use this option to -# decode that ldif-like changelog. +# If you already have a ldif-like changelog, but the changes +# in that file are encoded, you may use this option to +# decode that ldif-like changelog. # # -o output-file -# Path name for the final result. Default to STDOUT if omitted. +# Path name for the final result. Default to STDOUT if omitted. # # -p port -# Directory server's port. Default to 389. +# Directory server's port. Default to 389. # # -P bind-cert -# Pathname of binding certificate DB +# Pathname of binding certificate DB # # -r replica-roots -# Specify replica roots whose changelog you want to dump. The replica -# roots may be seperated by comma. All the replica roots would be -# dumped if the option is omitted. +# Specify replica roots whose changelog you want to dump. The replica +# roots may be seperated by comma. All the replica roots would be +# dumped if the option is omitted. # # -v Print the version of this script. # # -w bind-password -# Password for the bind DN +# Password for the bind DN # # RESTRICTION: # If you are not using -i option, the script should be run when the server # is running, and from where the server's changelog directory is accessible. # # DIAGNOSIS: -# For environment variable issues, see script template-repl-monitor.pl under -# DSHOME/bin/slapd/admin/scripts +# For environment variable issues, see script repl-monitor.pl under bindir # ################################################################################ # enable the use of our bundled perldap with our bundled ldapsdk libraries # all of this nonsense can be omitted if the mozldapsdk and perldap are # installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5) -$prefix = "{{DS-ROOT}}"; - -$ENV{'LD_LIBRARY_PATH'} = "$prefix@nss_libdir@:$prefix/usr/lib:@nss_libdir@:/usr/lib"; -$ENV{'SHLIB_PATH'} = "$prefix@nss_libdir@:$prefix/usr/lib:@nss_libdir@:/usr/lib"; -$usage="Usage: $0 [-h host] [-p port] [-D bind-dn] [-w bind-password | -P bind-cert] [-r replica-roots] [-o output-file] [-c] [-v]\n\n $0 -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]"; +$usage="Usage: $0 [-h host] [-p port] [-D bind-dn] [-w bind-password | -P bind-cert] [-r replica-roots] [-o output-file] [-c] [-v]\n\n $0 -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]\n"; use Getopt::Std; # Parse command line arguments use Mozilla::LDAP::Conn; # LDAP module for Perl diff --git a/ldap/admin/src/scripts/template-repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl index d1ec4bb6..33696507 100755 --- a/ldap/admin/src/scripts/template-repl-monitor.pl.in +++ b/ldap/admin/src/scripts/repl-monitor.pl @@ -1,4 +1,4 @@ -#{{PERL-EXEC}} +#!/usr/bin/env perl # BEGIN COPYRIGHT BLOCK # This Program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -33,7 +33,7 @@ # # # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. -# Copyright (C) 2005 Red Hat, Inc. +# Copyright (C) 2007 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK ############################################################################## @@ -41,7 +41,7 @@ # FILE: repl-monitor.pl # # SYNOPSIS: -# repl-monitor.pl -f configuration-file [-h host] [-p port] [-r] \ +# repl-monitor.pl -f configuration-file [-h host] [-p port] [-r] # [-u refresh-url] [-t refresh-interval] # # repl-monitor.pl -v @@ -54,83 +54,83 @@ # All output is in HTML. # # OPTIONS: -# # -f configuration-file -# The configuration file contains the sections for the connection -# parameters, the server alias, and the thresholds for different colors -# when display the time lags between consumers and master. -# If the Admin Server is running on Windows, the configuration-file -# name may have format "D:/opt/replmon.conf". +# The configuration file contains the sections for the connection +# parameters, the server alias, and the thresholds for different colors +# when display the time lags between consumers and master. +# If the Admin Server is running on Windows, the configuration-file +# name may have format "D:/opt/replmon.conf". # -# The connection parameter section consists of the section name -# followed by one of more connection parameter entries: +# The connection parameter section consists of the section name +# followed by one of more connection parameter entries: # -# [connection] -# host:port:binddn:bindpwd:bindcert -# host:port=shadowport:binddn:bindpwd:bindcert -# ... +# [connection] +# host:port:binddn:bindpwd:bindcert +# host:port=shadowport:binddn:bindpwd:bindcert +# ... # # where host:port default (*:*) to that in a replication agreement, # binddn default (*) to "cn=Directory Manager", and bindcert is the -# pathname of cert db if you want the script to connect to the server -# via SSL. If bindcert is omitted, the connection will be simple -# bind. +# pathname of cert db if you want the script to connect to the server +# via SSL. If bindcert is omitted, the connection will be simple +# bind. # "port=shadowport" means to use shadowport instead of port if port -# is specified in the replication agreement. This is useful when -# for example, ssl port is specified in a replication agreement, -# but you can't access the cert db from the machine where this -# script is running. So you could let the script to map the ssl -# port to a non-ssl port and use the simple bind. -# -# A server may have a dedicated or a share entry in the connection -# section. The script will find out the most matched entry for a given -# server. For example, if all the ldap servers except host1 share the -# same binddn and bindpassword, the connection section then just need -# two entries: -# -# [connection] -# *:*:binddn:bindpassword: -# host1:*:binddn:bindpassword: -# -# If a host:port is assigned an alias, then the alias instead of -# host:port will be displayed in The output file. Each host:port -# can have only one alias. But each alias may be used by more than -# one host:port. -# -# [alias] -# alias = host:port -# ... -# -# CSN time lags between masters and consumers might be displayed in -# different colors based on their range. The thresholds for different -# colors may be specified in color section: -# -# [color] -# lowmark (in minutes) = color -# ... -# If the color section or color entry is missing, the default color -# set is: green for [0-5) minutes lag, yellow [5-60), and red 60 and more. +# is specified in the replication agreement. This is useful when +# for example, ssl port is specified in a replication agreement, +# but you can't access the cert db from the machine where this +# script is running. So you could let the script to map the ssl +# port to a non-ssl port and use the simple bind. +# +# A server may have a dedicated or a share entry in the connection +# section. The script will find out the most matched entry for a given +# server. For example, if all the ldap servers except host1 share the +# same binddn and bindpassword, the connection section then just need +# two entries: +# +# [connection] +# *:*:binddn:bindpassword: +# host1:*:binddn:bindpassword: +# +# If a host:port is assigned an alias, then the alias instead of +# host:port will be displayed in The output file. Each host:port +# can have only one alias. But each alias may be used by more than +# one host:port. +# +# [alias] +# alias = host:port +# ... +# +# CSN time lags between masters and consumers might be displayed in +# different colors based on their range. The thresholds for different +# colors may be specified in color section: +# +# [color] +# lowmark (in minutes) = color +# ... +# +# If the color section or color entry is missing, the default color +# set is: green for [0-5) minutes lag, yellow [5-60), and red 60 and more. # # -h host -# Initial replication supplier's host. Default to the current host. +# Initial replication supplier's host. Default to the current host. # # -p port -# Initial replication supplier's port. Default to 389. +# Initial replication supplier's port. Default to 389. # # -r If specified, -r causes the routine to be entered without printing -# HTML header information. This is suitable when making multiple calls -# to this routine (e.g. when specifying multiple, different, "unrelated" -# supplier servers) and expecting a single HTML output. +# HTML header information. This is suitable when making multiple calls +# to this routine (e.g. when specifying multiple, different, "unrelated" +# supplier servers) and expecting a single HTML output. # # -t refresh-interval -# Specify the refresh interval in seconds. This option has to be -# jointly used with option -u. +# Specify the refresh interval in seconds. This option has to be +# jointly used with option -u. # # -u refresh-url -# The output HTML file may invoke a CGI program periodically. If -# this CGI program in turn calls this script, the effect is that -# the output HTML file would automatically refresh itself. This -# is useful for continuing monitoring. See also option -t. +# The output HTML file may invoke a CGI program periodically. If +# this CGI program in turn calls this script, the effect is that +# the output HTML file would automatically refresh itself. This +# is useful for continuing monitoring. See also option -t. # # -v Print out the version of this script # @@ -139,22 +139,14 @@ # "Can't locate Mozilla/LDAP/Conn.pm in @INC", or # "usage: Undefined variable": # -# 1. Set the first line of the script to #!<DSHOME>/bin/slapd/admin/bin/perl -# and run this script directly. -# -# 2. Run -# <DSHOME>/bin/slapd/admin/bin/perl repl-monitor.pl +# 0. Prerequisite: NSPR, NSS, Mozilla LDAP C SDK, PerLDAP # -# 3. Set environment variable PERL5LIB to your Perl lib dirs where -# Mozilla::LDAP module can be located. This should be under serverroot/lib/perl -# e.g. PERL5LIB="serverroot/lib/perl/arch:serverroot/lib/perl" +# 1. Run this perl script via repl-monitor, which sets up LD_LIBRARY_PATH +# $ repl-monitor # -# 4. Set LD_LIBRARY_PATH (or SHLIB_PATH) to point to the location of our -# bundled shared libraries e.g. LD_LIBRARY_PATH="serverroot/lib" -# -# 5. Invoke the script as follows if <MYPERLDIR> (serverroot/lib/perl) contains -# Mozilla/LDAP: -# <MYPERLDIR>/bin/perl -I <MYPERLDIR>/arch -I <MYPERLDIR> repl-monitor.pl +# 2. If 1 does not work, try invoking this script as follows. +# Assuming <MYPERLDIR> contains Mozilla/LDAP: +# perl -I <MYPERLDIR> repl-monitor.pl # ############################################################################# # enable the use of our bundled perldap with our bundled ldapsdk libraries @@ -163,6 +155,7 @@ # this script is always invoked by repl-monitor-cgi.pl, which sets all of these # If using this script standalone, be sure to set the shared lib path and # the path to the perldap modules. + $usage = "\nusage: $0 -f configuration-file [-h host] [-p port] [-r] [-u refresh-url] [-t refresh-interval]\n\nor : $0 -v\n"; use Getopt::Std; # parse command line arguments |