Commit 5fdba272 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

This is the skeleton of back-monitor, the slapd monitoring backend.

The old monitoring stuff has been removed; the new backend is
enabled by using --enable-monitor at configure time and requires

	database monitor

in slapd.conf to be activated.  At present it implements a subset
of the old monitoring options, and it should be extendable to
a number of different subsystems.  The search operation has been
implementd; it does not honor abandon or size/time limits, though.
The compare and the abandon operations are planned.

Copyright Pierangelo Masarati <ando@sys-net.it>; the code is provided
AS IS with NO GUARANTEE.  It can be used and distributed under the
conditions stated by the OpenLDAP Public License.
parent 4b22216d
This diff is collapsed.
......@@ -183,6 +183,9 @@ OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto,
OL_ARG_ENABLE(meta,[ --enable-meta enable metadirectory backend], no)dnl
OL_ARG_WITH(meta_module,[ --with-meta-module module type], static,
[static dynamic])
OL_ARG_ENABLE(monitor,[ --enable-monitor enable monitor backend], no)dnl
OL_ARG_WITH(monitor_module,[ --with-monitor-module module type], static,
[static dynamic])
OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl
OL_ARG_WITH(passwd_module,[ --with-passwd-module module type], static,
[static dynamic])
......@@ -231,6 +234,9 @@ if test $ol_enable_slapd = no ; then
if test $ol_enable_meta = yes ; then
AC_MSG_WARN([slapd disabled, ignoring --enable-meta argument])
fi
if test $ol_enable_module = yes ; then
AC_MSG_WARN([slapd disabled, ignoring --enable-monitor argument])
fi
if test $ol_enable_passwd = yes ; then
AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument])
fi
......@@ -285,6 +291,9 @@ dnl fi
if test $ol_with_meta_module != static ; then
AC_MSG_WARN([slapd disabled, ignoring --with-meta-module argument])
fi
if test $ol_with_monitor_module != static ; then
AC_MSG_WARN([slapd disabled, ignoring --with-monitor-module argument])
fi
if test $ol_with_passwd_module != static ; then
AC_MSG_WARN([slapd disabled, ignoring --with-passwd-module argument])
fi
......@@ -313,6 +322,7 @@ dnl fi
ol_enable_ldap=no
ol_enable_ldbm=no
ol_enable_meta=no
ol_enable_monitor=no
ol_enable_passwd=no
ol_enable_perl=no
ol_enable_shell=no
......@@ -335,6 +345,7 @@ dnl ol_enable_multimaster=no
ol_with_ldap_module=static
ol_with_ldbm_module=static
ol_with_meta_module=static
ol_with_monitor_module=static
ol_with_passwd_module=static
ol_with_perl_module=static
ol_with_shell_module=static
......@@ -365,6 +376,7 @@ elif test $ol_enable_ldbm = no ; then
$ol_enable_dnssrv = no -a \
$ol_enable_ldap = no -a \
$ol_enable_meta = no -a \
$ol_enable_monitor = no -a \
$ol_enable_passwd = no -a \
$ol_enable_perl = no -a \
$ol_enable_shell = no -a \
......@@ -448,6 +460,7 @@ BUILD_DNSSRV=no
BUILD_LDAP=no
BUILD_LDBM=no
BUILD_META=no
BUILD_MONITOR=no
BUILD_PASSWD=no
BUILD_PERL=no
BUILD_SHELL=no
......@@ -459,6 +472,7 @@ BUILD_DNSSRV_DYNAMIC=static
BUILD_LDAP_DYNAMIC=static
BUILD_LDBM_DYNAMIC=static
BUILD_META_DYNAMIC=static
BUILD_MONITOR_DYNAMIC=static
BUILD_PASSWD_DYNAMIC=static
BUILD_PERL_DYNAMIC=static
BUILD_SHELL_DYNAMIC=static
......@@ -673,6 +687,7 @@ else
ol_with_ldap_module=static
ol_with_ldbm_module=static
ol_with_meta_module=static
ol_with_monitor_module=static
ol_with_passwd_module=static
ol_with_perl_module=static
ol_with_shell_module=static
......@@ -2378,6 +2393,19 @@ if test "$ol_enable_meta" != no ; then
fi
fi
if test "$ol_enable_monitor" != no ; then
AC_DEFINE(SLAPD_MONITOR,1,[define to support cn=Monitor backend])
BUILD_SLAPD=yes
BUILD_MONITOR=yes
if test "$ol_with_monitor_module" != static ; then
AC_DEFINE(SLAPD_MONITOR_DYNAMIC,1,
[define to support dynamic cn=Monitor backend])
BUILD_MONITOR=mod
BUILD_MONITOR_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
fi
fi
if test "$ol_enable_passwd" != no ; then
AC_DEFINE(SLAPD_PASSWD,1,[define to support PASSWD backend])
BUILD_SLAPD=yes
......@@ -2485,6 +2513,7 @@ AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_LDAP)
AC_SUBST(BUILD_LDBM)
AC_SUBST(BUILD_META)
AC_SUBST(BUILD_MONITOR)
AC_SUBST(BUILD_PASSWD)
AC_SUBST(BUILD_PERL)
AC_SUBST(BUILD_SHELL)
......@@ -2495,6 +2524,7 @@ AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_LDAP_DYNAMIC)
AC_SUBST(BUILD_LDBM_DYNAMIC)
AC_SUBST(BUILD_META_DYNAMIC)
AC_SUBST(BUILD_MONITOR_DYNAMIC)
AC_SUBST(BUILD_PASSWD_DYNAMIC)
AC_SUBST(BUILD_PERL_DYNAMIC)
AC_SUBST(BUILD_SHELL_DYNAMIC)
......@@ -2572,6 +2602,7 @@ servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefi
servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
......
......@@ -222,9 +222,10 @@ Please try again later.\r\n"
/* the following DNs must be normalized! */
/* dn of the default subschema subentry */
#define SLAPD_SCHEMA_DN "cn=Subschema"
#if 0
/* dn of the default "monitor" subentry */
#define SLAPD_MONITOR_DN "cn=Monitor"
#define SLAPD_MONITOR_NDN "CN=MONITOR"
#if 0
/* dn of the default "config" subentry */
#define SLAPD_CONFIG_DN "cn=Config"
#endif
......
......@@ -928,6 +928,12 @@
/* define to support dynamic LDAP Metadirectory backend */
#undef SLAPD_META_DYNAMIC
/* define to support cn=Monitor backend */
#undef SLAPD_MONITOR
/* define to support dynamic cn=Monitor backend */
#undef SLAPD_MONITOR_DYNAMIC
/* define to support PASSWD backend */
#undef SLAPD_PASSWD
......
......@@ -17,7 +17,7 @@ SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
repl.c lock.c controls.c extended.c kerberos.c passwd.c \
schema.c schema_check.c schema_init.c schema_prep.c \
schemaparse.c ad.c at.c mr.c syntax.c oc.c saslauthz.c \
monitor.c configinfo.c starttls.c index.c sets.c \
configinfo.c starttls.c index.c sets.c \
root_dse.c sasl.c module.c suffixalias.c mra.c mods.c \
$(@PLAT@_SRCS)
......@@ -29,7 +29,7 @@ OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
repl.o lock.o controls.o extended.o kerberos.o passwd.o \
schema.o schema_check.o schema_init.o schema_prep.o \
schemaparse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o \
monitor.o configinfo.o starttls.o index.o sets.o \
configinfo.o starttls.o index.o sets.o \
root_dse.o sasl.o module.o suffixalias.o mra.o mods.o \
$(@PLAT@_OBJS)
......
Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
COPYING RESTRICTIONS APPLY, see COPYRIGHT file
Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
This work has beed deveolped for the OpenLDAP Foundation
in the hope that it may be useful to the Open Source community,
but WITHOUT ANY WARRANTY.
Permission is granted to anyone to use this software for any purpose
on any computer system, and to alter it and redistribute it, subject
to the following restrictions:
1. The author and SysNet s.n.c. are not responsible for the consequences
of use of this software, no matter how awful, even if they arise from
flaws in it.
2. The origin of this software must not be misrepresented, either by
explicit claim or by omission. Since few users ever read sources,
credits should appear in the documentation.
3. Altered versions must be plainly marked as such, and must not be
misrepresented as being the original software. Since few users
ever read sources, credits should appear in the documentation.
SysNet s.n.c. cannot be responsible for the consequences of the
alterations.
4. This notice may not be removed or altered.
# $OpenLDAP$
SRCS = init.c search.c compare.c abandon.c \
cache.c entry.c \
backend.c database.c thread.c conn.c rww.c \
dummy.c
OBJS = init.o search.o compare.o abandon.o \
cache.o entry.o \
backend.o database.o thread.o conn.o rww.o \
dummy.o
LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
BUILD_OPT = "--enable-monitor"
BUILD_MOD = @BUILD_MONITOR@
LINKAGE = @BUILD_MONITOR_DYNAMIC@
DYN_DEFS = -DLBER_DECL=dllimport -DLDAP_DECL=dllimport
# TODO
#NT_mod_DYN_MODDEFS =
#NT_mod_STAT_MODDEFS =
NT_yes_DYN_MODDEFS = $(DYN_DEFS)
NT_yes_STAT_MODDEFS =
MODDEFS = $(@PLAT@_@BUILD_MONITOR@_@LIB_LINKAGE@_MODDEFS)
LIBBASE = back_monitor
XINCPATH = -I.. -I$(srcdir)/..
XDEFS = $(MODULES_CPPFLAGS)
all-local-lib: ../.backend
../.backend: lib$(LIBBASE).a
@touch $@
back-monitor
Backend for monitoring the server's activity. It must be explicitly
enabled by configuring with `--enable-monitor' set; then it must be
activated by placing in slapd.conf the configure directive
database monitor
The suffix "cn=Monitor" is implicitly activated (it cannot be given
as a suffix of the database as usually done for conventional backends).
The backend root is "cn=Monitor"; the first level entries represent
the monitored subsystems. It is being implemented in a modular way,
to ease the addition of new subsystems.
All the subsystems get a default "cn" attribute, represented by the
subsystem's name, and they all have "top", "LDAPsubEntry" and
"monitorSubEntry" objectclasses (the latter has not been defined yet,
pending the design of the monitor schema and its registration under
OpenLDAP's OID).
Most of the sybsystems contain an additional depth level, represented
by detailed item monitoring.
All the entries undergo an update operation, if a related method is
defined, prior to being returned. Moreover, there's a mechanism to
allow volatile entries to be defined, and generated on the fly when
requested. As an instance, the connection statistics are updated
at each request, while each active connection data is created on the
fly.
This document is in a very early stage of maturity and will probably
be rewritten many times before the monitor backend is released.
Author: Pierangelo Masarati <ando@OpenLDAP.org>
/* abandon.c - monitor backend abandon routine */
/*
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
* Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
*
* This work has beed deveolped for the OpenLDAP Foundation
* in the hope that it may be useful to the Open Source community,
* but WITHOUT ANY WARRANTY.
*
* Permission is granted to anyone to use this software for any purpose
* on any computer system, and to alter it and redistribute it, subject
* to the following restrictions:
*
* 1. The author and SysNet s.n.c. are not responsible for the consequences
* of use of this software, no matter how awful, even if they arise from
* flaws in it.
*
* 2. The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits should appear in the documentation.
*
* 3. Altered versions must be plainly marked as such, and must not be
* misrepresented as being the original software. Since few users
* ever read sources, credits should appear in the documentation.
* SysNet s.n.c. cannot be responsible for the consequences of the
* alterations.
*
* 4. This notice may not be removed or altered.
*/
#include "portable.h"
#include <slap.h>
#include "back-monitor.h"
int
monitor_back_abandon(
BackendDB *be,
struct slap_conn *c,
struct slap_op *o,
ber_int_t msgid
)
{
return( 0 );
}
/* back-monitor.h - ldap monitor back-end header file */
/*
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
* Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
*
* This work has beed deveolped for the OpenLDAP Foundation
* in the hope that it may be useful to the Open Source community,
* but WITHOUT ANY WARRANTY.
*
* Permission is granted to anyone to use this software for any purpose
* on any computer system, and to alter it and redistribute it, subject
* to the following restrictions:
*
* 1. The author and SysNet s.n.c. are not responsible for the consequences
* of use of this software, no matter how awful, even if they arise from
* flaws in it.
*
* 2. The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits should appear in the documentation.
*
* 3. Altered versions must be plainly marked as such, and must not be
* misrepresented as being the original software. Since few users
* ever read sources, credits should appear in the documentation.
* SysNet s.n.c. cannot be responsible for the consequences of the
* alterations.
*
* 4. This notice may not be removed or altered.
*/
#ifndef _BACK_MONITOR_H_
#define _BACK_MONITOR_H_
#include <slap.h>
#include <avl.h>
#include <ldap_pvt.h>
#include <ldap_pvt_thread.h>
LDAP_BEGIN_DECL
/*
* The cache maps DNs to Entries.
* Each entry, on turn, holds the list of its children in the e_private field.
* This is used by search operation to perform onelevel and subtree candidate
* selection.
*/
struct monitorcache {
char *mc_ndn;
Entry *mc_e;
};
struct monitorentrypriv {
ldap_pvt_thread_mutex_t mp_mutex; /* entry mutex */
Entry *mp_next; /* pointer to next sibling */
Entry *mp_children; /* pointer to first child */
struct monitorsubsys *mp_info; /* subsystem info */
#define mp_type mp_info->mss_type
int mp_flags; /* flags */
#define MONITOR_F_NONE 0x00
#define MONITOR_F_SUB 0x01 /* subentry of subsystem */
#define MONITOR_F_PERSISTENT 0x10 /* persistent entry */
#define MONITOR_F_PERSISTENT_CH 0x20 /* subsystem generates
persistent entries */
#define MONITOR_F_VOLATILE 0x40 /* volatile entry */
#define MONITOR_F_VOLATILE_CH 0x80 /* subsystem generates
volatile entries */
};
struct monitorinfo {
Avlnode *mi_cache;
ldap_pvt_thread_mutex_t mi_cache_mutex;
};
/*
* DNs
*/
#define SLAPD_MONITOR_LISTENER 0
#define SLAPD_MONITOR_LISTENER_NAME "Listener"
#define SLAPD_MONITOR_LISTENER_RDN \
"cn=" SLAPD_MONITOR_LISTENER_NAME
#define SLAPD_MONITOR_LISTENER_DN \
SLAPD_MONITOR_LISTENER_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_DATABASE 1
#define SLAPD_MONITOR_DATABASE_NAME "Databases"
#define SLAPD_MONITOR_DATABASE_RDN \
"cn=" SLAPD_MONITOR_DATABASE_NAME
#define SLAPD_MONITOR_DATABASE_DN \
SLAPD_MONITOR_DATABASE_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_BACKEND 2
#define SLAPD_MONITOR_BACKEND_NAME "Backends"
#define SLAPD_MONITOR_BACKEND_RDN \
"cn=" SLAPD_MONITOR_BACKEND_NAME
#define SLAPD_MONITOR_BACKEND_DN \
SLAPD_MONITOR_BACKEND_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_THREAD 3
#define SLAPD_MONITOR_THREAD_NAME "Threads"
#define SLAPD_MONITOR_THREAD_RDN \
"cn=" SLAPD_MONITOR_THREAD_NAME
#define SLAPD_MONITOR_THREAD_DN \
SLAPD_MONITOR_THREAD_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_SASL 4
#define SLAPD_MONITOR_SASL_NAME "SASL"
#define SLAPD_MONITOR_SASL_RDN \
"cn=" SLAPD_MONITOR_SASL_NAME
#define SLAPD_MONITOR_SASL_DN \
SLAPD_MONITOR_SASL_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_TLS 5
#define SLAPD_MONITOR_TLS_NAME "TLS"
#define SLAPD_MONITOR_TLS_RDN \
"cn=" SLAPD_MONITOR_TLS_NAME
#define SLAPD_MONITOR_TLS_DN \
SLAPD_MONITOR_TLS_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_CONN 6
#define SLAPD_MONITOR_CONN_NAME "Connections"
#define SLAPD_MONITOR_CONN_RDN \
"cn=" SLAPD_MONITOR_CONN_NAME
#define SLAPD_MONITOR_CONN_DN \
SLAPD_MONITOR_CONN_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_READW 7
#define SLAPD_MONITOR_READW_NAME "Read Waiters"
#define SLAPD_MONITOR_READW_RDN \
"cn=" SLAPD_MONITOR_READW_NAME
#define SLAPD_MONITOR_READW_DN \
SLAPD_MONITOR_READW_RDN "," SLAPD_MONITOR_DN
#define SLAPD_MONITOR_WRITEW 8
#define SLAPD_MONITOR_WRITEW_NAME "Write Waiters"
#define SLAPD_MONITOR_WRITEW_RDN \
"cn=" SLAPD_MONITOR_WRITEW_NAME
#define SLAPD_MONITOR_WRITEW_DN \
SLAPD_MONITOR_WRITEW_RDN "," SLAPD_MONITOR_DN
struct monitorsubsys {
int mss_type;
char *mss_name;
char *mss_rdn;
char *mss_dn;
char *mss_ndn;
int mss_flags;
#define MONITOR_HAS_VOLATILE_CH( mp ) \
( ( mp )->mp_flags & MONITOR_F_VOLATILE_CH )
int ( *mss_init )( BackendDB * );
int ( *mss_update )( struct monitorinfo *, Entry * );
int ( *mss_create )( struct monitorinfo *, const char *ndn, Entry *, Entry ** );
};
extern struct monitorsubsys monitor_subsys[];
extern AttributeDescription *monitor_ad_desc;
/*
* cache
*/
extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
extern int monitor_cache_lock LDAP_P(( Entry *e ));
extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
/*
* update
*/
extern int monitor_entry_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry *e_parent, Entry **ep ));
LDAP_END_DECL
#include "proto-back-monitor.h"
#endif /* _back_monitor_h_ */
/* backend.c - deals with backend subsystem */
/*
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/*
* Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
*
* This work has beed deveolped for the OpenLDAP Foundation
* in the hope that it may be useful to the Open Source community,
* but WITHOUT ANY WARRANTY.
*
* Permission is granted to anyone to use this software for any purpose
* on any computer system, and to alter it and redistribute it, subject
* to the following restrictions:
*
* 1. The author and SysNet s.n.c. are not responsible for the consequences
* of use of this software, no matter how awful, even if they arise from
* flaws in it.
*
* 2. The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits should appear in the documentation.
*
* 3. Altered versions must be plainly marked as such, and must not be
* misrepresented as being the original software. Since few users
* ever read sources, credits should appear in the documentation.
* SysNet s.n.c. cannot be responsible for the consequences of the
* alterations.
*
* 4. This notice may not be removed or altered.
*/
#include "portable.h"
#include <stdio.h>
#include "slap.h"
#include "back-monitor.h"
/*
* initializes backend subentries
*/
int
monitor_subsys_backend_init(
BackendDB *be
)
{
struct monitorinfo *mi;
Entry *e, *e_backend, *e_tmp;
int i;
struct monitorentrypriv *mp;
struct berval *bv[2], val;
mi = ( struct monitorinfo * )be->be_private;
if ( monitor_cache_get( mi,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
&e_backend ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_backend_init: "
"unable to get entry '%s'\n",
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
"", "" );
#endif
return( -1 );
}
bv[0] = &val;
bv[1] = NULL;
e_tmp = NULL;
for ( i = nBackendInfo; i--; ) {
char buf[1024];
BackendInfo *bi;
bi = &backendInfo[i];
snprintf( buf, sizeof( buf ),
"dn: cn=%d,%s\n"
"objectClass: top\n"
"objectClass: LDAPsubEntry\n"
#ifdef SLAPD_MONITORSUBENTRY
"objectClass: monitorSubEntry\n"
#else /* !SLAPD_MONITORSUBENTRY */
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: %d\n",
i,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn,
i );
e = str2entry( buf );
if ( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_backend_init: "
"unable to create entry 'cn=%d,%s'\n",
i,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to create entry 'cn=%d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
"" );
#endif
return( -1 );