* used by many functions to add description to entries
*/
AttributeDescription *monitor_ad_desc = NULL;
+BackendDB *be_monitor = NULL;
/*
* subsystem data
{
SLAPD_MONITOR_LISTENER, SLAPD_MONITOR_LISTENER_NAME,
{ 0L, NULL }, { 0L, NULL }, { 0L, NULL },
- MONITOR_F_NONE,
- NULL, /* init */
+ MONITOR_F_PERSISTENT_CH,
+ monitor_subsys_listener_init,
NULL, /* update */
NULL, /* create */
NULL /* modify */
}, {
SLAPD_MONITOR_OPS, SLAPD_MONITOR_OPS_NAME,
{ 0L, NULL }, { 0L, NULL }, { 0L, NULL },
- MONITOR_F_NONE,
+ MONITOR_F_PERSISTENT_CH,
monitor_subsys_ops_init,
monitor_subsys_ops_update,
NULL, /* create */
}, {
SLAPD_MONITOR_SENT, SLAPD_MONITOR_SENT_NAME,
{ 0L, NULL }, { 0L, NULL }, { 0L, NULL },
- MONITOR_F_NONE,
+ MONITOR_F_PERSISTENT_CH,
monitor_subsys_sent_init,
monitor_subsys_sent_update,
NULL, /* create */
NULL, /* modify */
+ }, {
+ SLAPD_MONITOR_TIME, SLAPD_MONITOR_TIME_NAME,
+ { 0L, NULL }, { 0L, NULL }, { 0L, NULL },
+ MONITOR_F_PERSISTENT_CH,
+ monitor_subsys_time_init,
+ monitor_subsys_time_update,
+ NULL, /* create */
+ NULL, /* modify */
}, { -1, NULL }
};
/*
* database monitor can be defined once only
*/
- static int monitor_defined = 0;
-
- if ( monitor_defined ) {
+ if ( be_monitor ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"only one monitor backend is allowed\n" ));
#endif
return( -1 );
}
- monitor_defined++;
+ be_monitor = be;
+
+ /* indicate system schema supported */
+ be->be_flags |= SLAP_BFLAG_MONITOR;
ndn = NULL;
dn.bv_val = SLAPD_MONITOR_DN;
return -1;
}
- ber_bvecadd( &be->be_suffix, ber_bvdup( &dn ) );
+ ber_bvecadd( &be->be_suffix, ber_dupbv( NULL, &dn ) );
ber_bvecadd( &be->be_nsuffix, ndn );
mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
snprintf( buf, sizeof( buf ),
"dn: %s\n"
- "objectClass: top\n"
- "objectClass: LDAPsubEntry\n"
-#ifdef SLAPD_MONITORSUBENTRY
- "objectClass: monitorSubEntry\n"
-#else /* !SLAPD_MONITORSUBENTRY */
- "objectClass: extensibleObject\n"
-#endif /* !SLAPD_MONITORSUBENTRY */
+ SLAPD_MONITOR_OBJECTCLASSES
"cn: %s\n",
monitor_subsys[ i ].mss_dn.bv_val,
monitor_subsys[ i ].mss_name );
snprintf( buf, sizeof( buf ),
"dn: " SLAPD_MONITOR_DN "\n"
"objectClass: top\n"
- "objectClass: LDAPsubEntry\n"
-#ifdef SLAPD_MONITORSUBENTRY
- "objectClass: monitorSubEntry\n"
-#else /* !SLAPD_MONITORSUBENTRY */
+ "objectClass: monitor\n"
"objectClass: extensibleObject\n"
-#endif /* !SLAPD_MONITORSUBENTRY */
+ "structuralObjectClass: monitor\n"
"cn: Monitor" );
e = str2entry( buf );