[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: About the information acquisition from slapd.d


 Thank you for comment.
 I change to a check method using slapcat.


2011/9/7 <masarati@aero.polimi.it>
> Hi
>  It is a question about the setting when I use slapd.d.
>  1.I acquire PID information in the following scripts, but will not have
> any
> problem?
>     $config_file appoints slapd.d directory.
> ----
>   pid_file=`sed -ne \
>            's/^olcPidFile:[[:space:]]\+\(.\+\)[[:space:]]*/\1/p' \
>            "$config_file"/'cn=config.ldif' 2>/dev/null`
> ----
>  2.I am going to acquire information to use in the following scripts in
> ldapsearch -b.
> ----
>     for suffix in `find "$config_file"/'cn=config' -type f -name
> olcDatabase* -exec \
>                    sed -ne
> 's/^[[:space:]]*olcSuffix:[[:space:]]\+\(.\+\)/\1/p' {} \;`
> ----
> The script mentioned above is a part of a script for slapd monitoring to
> use
> it in pacemaker.
> Because ldap is not an expert, I want to hear the opinion of the person of
> the expert.

No.  Use either ldapsearch(1) (or any client supporting LDAP search) or
slapcat(8), and check the resulting LDIF (or LDAP response).  Never muck
with files.