1 /* monitor.c - monitor ldap backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2003-2012 The OpenLDAP Foundation.
6 * Portions Copyright 1999-2003 Howard Chu.
7 * Portions Copyright 2000-2003 Pierangelo Masarati.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted only as authorized by the OpenLDAP
14 * A copy of this license is available in the file LICENSE in the
15 * top-level directory of the distribution or, alternatively, at
16 * <http://www.OpenLDAP.org/license.html>.
19 * This work was initially developed by the Howard Chu for inclusion
20 * in OpenLDAP Software and subsequently enhanced by Pierangelo
27 #include <ac/string.h>
28 #include <ac/unistd.h>
29 #include <ac/stdlib.h>
33 #include "back-ldap.h"
37 static ObjectClass *oc_olmLDAPDatabase;
38 static ObjectClass *oc_olmLDAPConnection;
40 static AttributeDescription *ad_olmDbURIList;
41 static AttributeDescription *ad_olmDbOperations;
42 static AttributeDescription *ad_olmDbBoundDN;
45 * Stolen from back-monitor/operations.c
46 * We don't need the normalized rdn's though.
48 struct ldap_back_monitor_ops_t {
50 } ldap_back_monitor_op[] = {
51 { BER_BVC( "cn=Bind" ) },
52 { BER_BVC( "cn=Unbind" ) },
53 { BER_BVC( "cn=Search" ) },
54 { BER_BVC( "cn=Compare" ) },
55 { BER_BVC( "cn=Modify" ) },
56 { BER_BVC( "cn=Modrdn" ) },
57 { BER_BVC( "cn=Add" ) },
58 { BER_BVC( "cn=Delete" ) },
59 { BER_BVC( "cn=Abandon" ) },
60 { BER_BVC( "cn=Extended" ) },
67 * NOTE: there's some confusion in monitor OID arc;
68 * by now, let's consider:
70 * Subsystems monitor attributes 1.3.6.1.4.1.4203.666.1.55.0
71 * Databases monitor attributes 1.3.6.1.4.1.4203.666.1.55.0.1
72 * LDAP database monitor attributes 1.3.6.1.4.1.4203.666.1.55.0.1.2
74 * Subsystems monitor objectclasses 1.3.6.1.4.1.4203.666.3.16.0
75 * Databases monitor objectclasses 1.3.6.1.4.1.4203.666.3.16.0.1
76 * LDAP database monitor objectclasses 1.3.6.1.4.1.4203.666.3.16.0.1.2
83 { "olmLDAPAttributes", "olmDatabaseAttributes:2" },
84 { "olmLDAPObjectClasses", "olmDatabaseObjectClasses:2" },
91 AttributeDescription **ad;
93 { "( olmLDAPAttributes:1 "
94 "NAME ( 'olmDbURIList' ) "
95 "DESC 'List of URIs a proxy is serving; can be modified run-time' "
98 { "( olmLDAPAttributes:2 "
99 "NAME ( 'olmDbOperation' ) "
100 "DESC 'monitor operations performed' "
101 "SUP monitorCounter "
102 "NO-USER-MODIFICATION "
103 "USAGE dSAOperation )",
104 &ad_olmDbOperations },
105 { "( olmLDAPAttributes:3 "
106 "NAME ( 'olmDbBoundDN' ) "
107 "DESC 'monitor connection authorization DN' "
108 "SUP monitorConnectionAuthzDN "
109 "NO-USER-MODIFICATION "
110 "USAGE dSAOperation )",
120 /* augments an existing object, so it must be AUXILIARY
121 * FIXME: derive from some ABSTRACT "monitoredEntity"? */
122 { "( olmLDAPObjectClasses:1 "
123 "NAME ( 'olmLDAPDatabase' ) "
128 &oc_olmLDAPDatabase },
129 { "( olmLDAPObjectClasses:2 "
130 "NAME ( 'olmLDAPConnection' ) "
131 "SUP monitorConnection STRUCTURAL "
135 &oc_olmLDAPConnection },
141 ldap_back_monitor_update(
147 ldapinfo_t *li = (ldapinfo_t *)priv;
151 /* update olmDbURIList */
152 a = attr_find( e->e_attrs, ad_olmDbURIList );
156 assert( a->a_vals != NULL );
157 assert( !BER_BVISNULL( &a->a_vals[ 0 ] ) );
158 assert( BER_BVISNULL( &a->a_vals[ 1 ] ) );
160 ldap_pvt_thread_mutex_lock( &li->li_uri_mutex );
162 ber_str2bv( li->li_uri, 0, 0, &bv );
163 if ( !bvmatch( &a->a_vals[ 0 ], &bv ) ) {
164 ber_bvreplace( &a->a_vals[ 0 ], &bv );
167 ldap_pvt_thread_mutex_unlock( &li->li_uri_mutex );
170 return SLAP_CB_CONTINUE;
174 ldap_back_monitor_modify(
180 ldapinfo_t *li = (ldapinfo_t *) priv;
182 Attribute *save_attrs = NULL;
184 *ml_olmDbURIList = NULL;
185 struct berval ul = BER_BVNULL;
188 for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
189 if ( ml->sml_desc == ad_olmDbURIList ) {
190 if ( ml_olmDbURIList != NULL ) {
191 rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
192 rs->sr_text = "conflicting modifications";
196 if ( ml->sml_op != LDAP_MOD_REPLACE ) {
197 rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
198 rs->sr_text = "modification not allowed";
202 ml_olmDbURIList = ml;
209 return SLAP_CB_CONTINUE;
212 save_attrs = attrs_dup( e->e_attrs );
214 if ( ml_olmDbURIList != NULL ) {
216 LDAPURLDesc *ludlist = NULL;
219 ml = ml_olmDbURIList;
220 assert( ml->sml_nvalues != NULL );
222 if ( BER_BVISNULL( &ml->sml_nvalues[ 0 ] ) ) {
223 rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
224 rs->sr_text = "no value provided";
228 if ( !BER_BVISNULL( &ml->sml_nvalues[ 1 ] ) ) {
229 rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
230 rs->sr_text = "multiple values provided";
234 rc = ldap_url_parselist_ext( &ludlist,
235 ml->sml_nvalues[ 0 ].bv_val, NULL,
236 LDAP_PVT_URL_PARSE_NOEMPTY_HOST
237 | LDAP_PVT_URL_PARSE_DEF_PORT );
238 if ( rc != LDAP_URL_SUCCESS ) {
239 rs->sr_err = LDAP_INVALID_SYNTAX;
240 rs->sr_text = "unable to parse URI list";
244 ul.bv_val = ldap_url_list2urls( ludlist );
245 ldap_free_urllist( ludlist );
246 if ( ul.bv_val == NULL ) {
247 rs->sr_err = LDAP_OTHER;
250 ul.bv_len = strlen( ul.bv_val );
252 a = attr_find( e->e_attrs, ad_olmDbURIList );
254 if ( a->a_nvals == a->a_vals ) {
255 a->a_nvals = ch_calloc( sizeof( struct berval ), 2 );
258 ber_bvreplace( &a->a_vals[ 0 ], &ul );
259 ber_bvreplace( &a->a_nvals[ 0 ], &ul );
262 attr_merge_normalize_one( e, ad_olmDbURIList, &ul, NULL );
267 if ( !BER_BVISNULL( &ul ) ) {
268 ldap_pvt_thread_mutex_lock( &li->li_uri_mutex );
270 ch_free( li->li_uri );
272 li->li_uri = ul.bv_val;
273 ldap_pvt_thread_mutex_unlock( &li->li_uri_mutex );
279 if ( !BER_BVISNULL( &ul ) ) {
280 ldap_memfree( ul.bv_val );
283 if ( rs->sr_err == LDAP_SUCCESS ) {
284 attrs_free( save_attrs );
285 return SLAP_CB_CONTINUE;
288 attrs_free( e->e_attrs );
289 e->e_attrs = save_attrs;
295 ldap_back_monitor_free(
299 ldapinfo_t *li = (ldapinfo_t *)(*priv);
303 if ( !slapd_shutdown ) {
304 memset( &li->li_monitor_info, 0, sizeof( li->li_monitor_info ) );
307 return SLAP_CB_CONTINUE;
311 ldap_back_monitor_subsystem_destroy(
313 monitor_subsys_t *ms)
315 free(ms->mss_dn.bv_val);
316 BER_BVZERO(&ms->mss_dn);
318 free(ms->mss_ndn.bv_val);
319 BER_BVZERO(&ms->mss_ndn);
325 * Connection monitoring subsystem:
326 * Tries to mimick what the cn=connections,cn=monitor subsystem does
327 * by creating volatile entries for each connection and populating them
328 * according to the information attached to the connection.
329 * At this moment the only exposed information is the DN used to bind it.
330 * Also note that the connection IDs are not and probably never will be
334 struct ldap_back_monitor_conn_arg {
335 monitor_subsys_t *ms;
340 ldap_back_monitor_conn_entry(
342 struct ldap_back_monitor_conn_arg *arg )
346 char buf[SLAP_TEXT_BUFLEN];
347 struct berval bv, dn, ndn;
352 bv.bv_len = snprintf( bv.bv_val, SLAP_TEXT_BUFLEN,
353 "cn=Connection %lu", lc->lc_connid );
355 build_new_dn( &dn, &arg->ms->mss_dn, &bv, NULL );
356 build_new_dn( &ndn, &arg->ms->mss_ndn, &bv, NULL );
363 attr_merge_normalize_one( e, slap_schema.si_ad_cn, &bv, NULL );
365 BER_BVSTR( &bv, "monitorContainer" );
366 attr_merge_normalize_one( e, slap_schema.si_ad_objectClass, &bv, NULL );
368 attr_merge_normalize_one( e, ad_olmDbBoundDN, &lc->lc_bound_ndn, NULL );
370 mp = monitor_entrypriv_create();
372 mp->mp_info = arg->ms;
373 mp->mp_flags = MONITOR_F_SUB | MONITOR_F_VOLATILE;
376 arg->ep = &mp->mp_next;
382 ldap_back_monitor_conn_create(
389 monitor_entry_t *mp_parent;
390 monitor_subsys_t *ms;
394 struct ldap_back_monitor_conn_arg *arg;
397 assert( e_parent->e_private != NULL );
399 mp_parent = e_parent->e_private;
400 ms = (monitor_subsys_t *)mp_parent->mp_info;
401 li = (ldapinfo_t *)ms->mss_private;
403 arg = ch_calloc( 1, sizeof(struct ldap_back_monitor_conn_arg) );
407 for ( conn_type = LDAP_BACK_PCONN_FIRST;
408 conn_type < LDAP_BACK_PCONN_LAST;
411 LDAP_TAILQ_FOREACH( lc,
412 &li->li_conn_priv[ conn_type ].lic_priv,
415 ldap_back_monitor_conn_entry( lc, arg );
419 avl_apply( li->li_conninfo.lai_tree, ldap_back_monitor_conn_entry,
420 arg, -1, AVL_INORDER );
428 ldap_back_monitor_conn_init(
430 monitor_subsys_t *ms )
432 ldapinfo_t *li = (ldapinfo_t *) ms->mss_private;
434 monitor_extra_t *mbe;
439 assert( be != NULL );
440 mi = (monitor_info_t *) be->be_private;
441 mbe = (monitor_extra_t *) be->bd_info->bi_extra;
443 ms->mss_dn = ms->mss_ndn = li->li_monitor_info.lmi_ndn;
444 ms->mss_rdn = li->li_monitor_info.lmi_conn_rdn;
445 ms->mss_create = ldap_back_monitor_conn_create;
446 ms->mss_destroy = ldap_back_monitor_subsystem_destroy;
448 e = monitor_entry_stub( &ms->mss_dn, &ms->mss_ndn,
450 mi->mi_oc_monitorContainer, mi, NULL, NULL );
452 Debug( LDAP_DEBUG_ANY,
453 "ldap_back_monitor_conn_init: "
454 "unable to create entry \"%s,%s\"\n",
455 li->li_monitor_info.lmi_conn_rdn.bv_val,
456 ms->mss_ndn.bv_val, 0 );
460 ber_dupbv( &ms->mss_dn, &e->e_name );
461 ber_dupbv( &ms->mss_ndn, &e->e_nname );
463 rc = mbe->register_entry( e, NULL, ms, MONITOR_F_VOLATILE_CH );
465 /* add labeledURI and special, modifiable URI value */
466 if ( rc == LDAP_SUCCESS && li->li_uri != NULL ) {
469 LDAPURLDesc *ludlist = NULL;
470 monitor_callback_t *cb = NULL;
472 a = attr_alloc( ad_olmDbURIList );
474 ber_str2bv( li->li_uri, 0, 0, &bv );
475 attr_valadd( a, &bv, NULL, 1 );
476 attr_normalize( a->a_desc, a->a_vals, &a->a_nvals, NULL );
478 rc = ldap_url_parselist_ext( &ludlist,
480 LDAP_PVT_URL_PARSE_NOEMPTY_HOST
481 | LDAP_PVT_URL_PARSE_DEF_PORT );
482 if ( rc != LDAP_URL_SUCCESS ) {
483 Debug( LDAP_DEBUG_ANY,
484 "ldap_back_monitor_db_open: "
485 "unable to parse URI list (ignored)\n",
488 Attribute *a2 = attr_alloc( slap_schema.si_ad_labeledURI );
492 for ( ; ludlist != NULL; ) {
493 LDAPURLDesc *next = ludlist->lud_next;
495 bv.bv_val = ldap_url_desc2str( ludlist );
496 assert( bv.bv_val != NULL );
497 ldap_free_urldesc( ludlist );
498 bv.bv_len = strlen( bv.bv_val );
499 attr_valadd( a2, &bv, NULL, 1 );
500 ch_free( bv.bv_val );
505 attr_normalize( a2->a_desc, a2->a_vals, &a2->a_nvals, NULL );
508 cb = ch_calloc( sizeof( monitor_callback_t ), 1 );
509 cb->mc_update = ldap_back_monitor_update;
510 cb->mc_modify = ldap_back_monitor_modify;
511 cb->mc_free = ldap_back_monitor_free;
512 cb->mc_private = (void *)li;
514 rc = mbe->register_entry_attrs( &ms->mss_ndn, a, cb, NULL, 0, NULL );
516 attr_free( a->a_next );
519 if ( rc != LDAP_SUCCESS )
531 * Operation monitoring subsystem:
532 * Looks a lot like the cn=operations,cn=monitor subsystem except that at this
533 * moment, only completed operations are counted. Each entry has a separate
534 * callback with all the needed information linked there in the structure
535 * below so that the callback need not locate it over and over again.
538 struct ldap_back_monitor_op_counter {
540 ldap_pvt_thread_mutex_t *mutex;
544 ldap_back_monitor_ops_dispose(
547 struct ldap_back_monitor_op_counter *counter = *priv;
554 ldap_back_monitor_ops_free(
558 ldap_back_monitor_ops_dispose( priv );
563 ldap_back_monitor_ops_update(
569 struct ldap_back_monitor_op_counter *counter = priv;
573 * what about initiated/completed?
575 a = attr_find( e->e_attrs, ad_olmDbOperations );
578 ldap_pvt_thread_mutex_lock( counter->mutex );
579 UI2BV( &a->a_vals[ 0 ], *counter->data );
580 ldap_pvt_thread_mutex_unlock( counter->mutex );
582 return SLAP_CB_CONTINUE;
586 ldap_back_monitor_ops_init(
588 monitor_subsys_t *ms )
590 ldapinfo_t *li = (ldapinfo_t *) ms->mss_private;
593 monitor_extra_t *mbe;
597 struct berval value = BER_BVC( "0" );
599 assert( be != NULL );
601 mi = (monitor_info_t *) be->be_private;
602 mbe = (monitor_extra_t *) be->bd_info->bi_extra;
604 ms->mss_dn = ms->mss_ndn = li->li_monitor_info.lmi_ndn;
605 ms->mss_rdn = li->li_monitor_info.lmi_ops_rdn;
606 ms->mss_destroy = ldap_back_monitor_subsystem_destroy;
608 parent = monitor_entry_stub( &ms->mss_dn, &ms->mss_ndn,
610 mi->mi_oc_monitorContainer, mi, NULL, NULL );
611 if ( parent == NULL ) {
612 Debug( LDAP_DEBUG_ANY,
613 "ldap_back_monitor_ops_init: "
614 "unable to create entry \"%s,%s\"\n",
615 li->li_monitor_info.lmi_ops_rdn.bv_val,
616 ms->mss_ndn.bv_val, 0 );
620 ber_dupbv( &ms->mss_dn, &parent->e_name );
621 ber_dupbv( &ms->mss_ndn, &parent->e_nname );
623 rc = mbe->register_entry( parent, NULL, ms, MONITOR_F_PERSISTENT_CH );
624 if ( rc != LDAP_SUCCESS )
626 Debug( LDAP_DEBUG_ANY,
627 "ldap_back_monitor_ops_init: "
628 "unable to register entry \"%s\" for monitoring\n",
629 parent->e_name.bv_val, 0, 0 );
633 for ( op = 0; op < SLAP_OP_LAST; op++ )
635 monitor_callback_t *cb;
636 struct ldap_back_monitor_op_counter *counter;
638 e = monitor_entry_stub( &parent->e_name, &parent->e_nname,
639 &ldap_back_monitor_op[op].rdn,
640 mi->mi_oc_monitorCounterObject, mi, NULL, NULL );
642 Debug( LDAP_DEBUG_ANY,
643 "ldap_back_monitor_ops_init: "
644 "unable to create entry \"%s,%s\"\n",
645 ldap_back_monitor_op[op].rdn.bv_val,
646 parent->e_nname.bv_val, 0 );
650 attr_merge_normalize_one( e, ad_olmDbOperations, &value, NULL );
652 counter = ch_malloc( sizeof( struct ldap_back_monitor_op_counter ) );
653 counter->data = &li->li_ops_completed[ op ];
654 counter->mutex = &li->li_counter_mutex;
657 * We cannot share a single callback between entries.
659 * monitor_cache_destroy() tries to free all callbacks and it's called
660 * before mss_destroy() so we have no chance of handling it ourselves
662 cb = ch_calloc( sizeof( monitor_callback_t ), 1 );
663 cb->mc_update = ldap_back_monitor_ops_update;
664 cb->mc_free = ldap_back_monitor_ops_free;
665 cb->mc_dispose = ldap_back_monitor_ops_dispose;
666 cb->mc_private = (void *)counter;
668 rc = mbe->register_entry( e, cb, ms, 0 );
670 /* TODO: register_entry has stored a duplicate so we might actually reuse it
671 * instead of recreating it every time... */
674 if ( rc != LDAP_SUCCESS )
676 Debug( LDAP_DEBUG_ANY,
677 "ldap_back_monitor_ops_init: "
678 "unable to register entry \"%s\" for monitoring\n",
679 e->e_name.bv_val, 0, 0 );
686 entry_free( parent );
692 * call from within ldap_back_initialize()
695 ldap_back_monitor_initialize( void )
701 static int ldap_back_monitor_initialized = 0;
703 /* set to 0 when successfully initialized; otherwise, remember failure */
704 static int ldap_back_monitor_initialized_failure = 1;
706 /* register schema here; if compiled as dynamic object,
707 * must be loaded __after__ back_monitor.la */
709 if ( ldap_back_monitor_initialized++ ) {
710 return ldap_back_monitor_initialized_failure;
713 if ( backend_info( "monitor" ) == NULL ) {
717 argv[ 0 ] = "back-ldap monitor";
721 for ( i = 0; s_oid[ i ].name; i++ ) {
723 argv[ 1 ] = s_oid[ i ].name;
724 argv[ 2 ] = s_oid[ i ].oid;
726 if ( parse_oidm( &c, 0, NULL ) != 0 ) {
727 Debug( LDAP_DEBUG_ANY,
728 "ldap_back_monitor_initialize: unable to add "
729 "objectIdentifier \"%s=%s\"\n",
730 s_oid[ i ].name, s_oid[ i ].oid, 0 );
735 for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
736 code = register_at( s_at[ i ].desc, s_at[ i ].ad, 1 );
737 if ( code != LDAP_SUCCESS ) {
738 Debug( LDAP_DEBUG_ANY,
739 "ldap_back_monitor_initialize: register_at failed for attributeType (%s)\n",
740 s_at[ i ].desc, 0, 0 );
744 (*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
748 for ( i = 0; s_oc[ i ].desc != NULL; i++ ) {
749 code = register_oc( s_oc[ i ].desc, s_oc[ i ].oc, 1 );
750 if ( code != LDAP_SUCCESS ) {
751 Debug( LDAP_DEBUG_ANY,
752 "ldap_back_monitor_initialize: register_oc failed for objectClass (%s)\n",
753 s_oc[ i ].desc, 0, 0 );
757 (*s_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
761 return ( ldap_back_monitor_initialized_failure = LDAP_SUCCESS );
765 * call from within ldap_back_db_init()
768 ldap_back_monitor_db_init( BackendDB *be )
772 rc = ldap_back_monitor_initialize();
773 if ( rc != LDAP_SUCCESS ) {
777 #if 0 /* uncomment to turn monitoring on by default */
778 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_MONITORING;
785 * call from within ldap_back_db_open()
788 ldap_back_monitor_db_open( BackendDB *be )
790 ldapinfo_t *li = (ldapinfo_t *) be->be_private;
791 monitor_subsys_t *mss = li->li_monitor_info.lmi_mss;
794 monitor_extra_t *mbe;
796 if ( !SLAP_DBMONITORING( be ) ) {
800 /* check if monitor is configured and usable */
801 mi = backend_info( "monitor" );
802 if ( !mi || !mi->bi_extra ) {
803 SLAP_DBFLAGS( be ) ^= SLAP_DBFLAG_MONITORING;
808 /* don't bother if monitor is not configured */
809 if ( !mbe->is_configured() ) {
810 static int warning = 0;
812 if ( warning++ == 0 ) {
813 Debug( LDAP_DEBUG_ANY, "ldap_back_monitor_db_open: "
814 "monitoring disabled; "
815 "configure monitor database to enable\n",
822 /* caller (e.g. an overlay based on back-ldap) may want to use
823 * a different DN and RDNs... */
824 if ( BER_BVISNULL( &li->li_monitor_info.lmi_ndn ) ) {
825 rc = mbe->register_database( be, &li->li_monitor_info.lmi_ndn );
827 Debug( LDAP_DEBUG_ANY, "ldap_back_monitor_db_open: "
828 "failed to register the databse with back-monitor\n",
832 if ( BER_BVISNULL( &li->li_monitor_info.lmi_conn_rdn ) ) {
833 ber_str2bv( "cn=Connections", 0, 1,
834 &li->li_monitor_info.lmi_conn_rdn );
836 if ( BER_BVISNULL( &li->li_monitor_info.lmi_ops_rdn ) ) {
837 ber_str2bv( "cn=Operations", 0, 1,
838 &li->li_monitor_info.lmi_ops_rdn );
841 /* set up the subsystems used to create the operation and
842 * volatile connection entries */
844 mss->mss_name = "back-ldap connections";
845 mss->mss_flags = MONITOR_F_VOLATILE_CH;
846 mss->mss_open = ldap_back_monitor_conn_init;
847 mss->mss_private = li;
849 if ( mbe->register_subsys( mss ) )
851 Debug( LDAP_DEBUG_ANY,
852 "ldap_back_monitor_db_open: "
853 "failed to register connection subsystem", 0, 0, 0 );
859 mss->mss_name = "back-ldap operations";
860 mss->mss_flags = MONITOR_F_PERSISTENT_CH;
861 mss->mss_open = ldap_back_monitor_ops_init;
862 mss->mss_private = li;
864 if ( mbe->register_subsys( mss ) )
866 Debug( LDAP_DEBUG_ANY,
867 "ldap_back_monitor_db_open: "
868 "failed to register operation subsystem", 0, 0, 0 );
876 * call from within ldap_back_db_close()
879 ldap_back_monitor_db_close( BackendDB *be )
881 ldapinfo_t *li = (ldapinfo_t *) be->be_private;
883 if ( li && !BER_BVISNULL( &li->li_monitor_info.lmi_ndn ) ) {
885 monitor_extra_t *mbe;
887 /* check if monitor is configured and usable */
888 mi = backend_info( "monitor" );
889 if ( mi && mi->bi_extra ) {
893 * Unregister all entries our subsystems have created.
894 * Will only really be necessary when
895 * SLAPD_CONFIG_DELETE is enabled.
897 * Might need a way to unregister subsystems instead.
906 * call from within ldap_back_db_destroy()
909 ldap_back_monitor_db_destroy( BackendDB *be )
911 ldapinfo_t *li = (ldapinfo_t *) be->be_private;
914 memset( &li->li_monitor_info, 0, sizeof( li->li_monitor_info ) );