#define BDB_MONITOR_SCHEMA_AD "1.3.6.1.4.1.4203.666.1.55.0.1.1"
#define BDB_MONITOR_SCHEMA_OC "1.3.6.1.4.1.4203.666.3.16.0.1.1"
+static struct {
+ char *name;
+ char *oid;
+} s_oid[] = {
+ { "olmBDBAttributes", "olmDatabaseAttributes:1" },
+ { "olmBDBObjectClasses", "olmDatabaseObjectClasses:1" },
+
+ { NULL }
+};
+
static struct {
char *name;
char *desc;
AttributeDescription **ad;
} s_at[] = {
- { "olmBDBEntryCache", "( " BDB_MONITOR_SCHEMA_AD ".1 "
+ { "olmBDBEntryCache", "( olmBDBAttributes:1 "
"NAME ( 'olmBDBEntryCache' ) "
"DESC 'Number of items in Entry Cache' "
"SUP monitorCounter "
"USAGE directoryOperation )",
&ad_olmBDBEntryCache },
- { "olmBDBEntryInfo", "( " BDB_MONITOR_SCHEMA_AD ".2 "
+ { "olmBDBEntryInfo", "( olmBDBAttributes:2 "
"NAME ( 'olmBDBEntryInfo' ) "
"DESC 'Number of items in EntryInfo Cache' "
"SUP monitorCounter "
"USAGE directoryOperation )",
&ad_olmBDBEntryInfo },
- { "olmBDBIDLCache", "( " BDB_MONITOR_SCHEMA_AD ".3 "
+ { "olmBDBIDLCache", "( olmBDBAttributes:3 "
"NAME ( 'olmBDBIDLCache' ) "
"DESC 'Number of items in IDL Cache' "
"SUP monitorCounter "
"USAGE directoryOperation )",
&ad_olmBDBIDLCache },
- { "olmDbDirectory", "( " BDB_MONITOR_SCHEMA_AD ".4 "
+ { "olmDbDirectory", "( olmBDBAttributes:4 "
"NAME ( 'olmDbDirectory' ) "
"DESC 'Path name of the directory "
"where the database environment resides' "
} s_oc[] = {
/* augments an existing object, so it must be AUXILIARY
* FIXME: derive from some ABSTRACT "monitoredEntity"? */
- { "olmBDBDatabase", "( " BDB_MONITOR_SCHEMA_OC ".1 "
+ { "olmBDBDatabase", "( olmBDBObjectClasses:1 "
"NAME ( 'olmBDBDatabase' ) "
"SUP top AUXILIARY "
"MAY ( "
return 0;
}
+ for ( i = 0; s_oid[ i ].name; i++ ) {
+ char *argv[ 3 ];
+
+ argv[ 0 ] = "back-bdb/back-hdb monitor";
+ argv[ 1 ] = s_oid[ i ].name;
+ argv[ 2 ] = s_oid[ i ].oid;
+
+ if ( parse_oidm( argv[ 0 ], i, 3, argv, 0, NULL ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "bdb_monitor_initialize: unable to add "
+ "objectIdentifier \"%s=%s\"\n",
+ s_oid[ i ].name, s_oid[ i ].oid, 0 );
+ return 1;
+ }
+ }
+
for ( i = 0; s_at[ i ].name != NULL; i++ ) {
LDAPAttributeType *at;
{ NULL, NULL, 0, -1 }
};
+ static struct {
+ char *name;
+ char *oid;
+ } s_oid[] = {
+ { "olmAttributes", "1.3.6.1.4.1.4203.666.1.55" },
+ { "olmSubSystemAttributes", "olmAttributes:0" },
+ { "olmGenericAttributes", "olmSubSystemAttributes:0" },
+ { "olmDatabaseAttributes", "olmSubSystemAttributes:1" },
+
+ /* for example, back-bdb specific attrs
+ * are in "olmDatabaseAttributes:1"
+ *
+ * NOTE: developers, please record here OID assignments
+ * for other modules */
+
+ { "olmObjectClasses", "1.3.6.1.4.1.4203.666.3.16" },
+ { "olmSubSystemObjectClasses", "olmObjectClasses:0" },
+ { "olmGenericObjectClasses", "olmSubSystemObjectClasses:0" },
+ { "olmDatabaseObjectClasses", "olmSubSystemObjectClasses:1" },
+
+ /* for example, back-bdb specific objectClasses
+ * are in "olmDatabaseObjectClasses:1"
+ *
+ * NOTE: developers, please record here OID assignments
+ * for other modules */
+
+ { NULL }
+ };
+
int i, rc;
const char *text;
monitor_info_t *mi = &monitor_info;
+ for ( i = 0; s_oid[ i ].name; i++ ) {
+ char *argv[ 3 ];
+
+ argv[ 0 ] = "monitor";
+ argv[ 1 ] = s_oid[ i ].name;
+ argv[ 2 ] = s_oid[ i ].oid;
+
+ if ( parse_oidm( argv[ 0 ], i, 3, argv, 0, NULL ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY,
+ "monitor_back_initialize: unable to add "
+ "objectIdentifier \"%s=%s\"\n",
+ s_oid[ i ].name, s_oid[ i ].oid, 0 );
+ return 1;
+ }
+ }
+
/* schema integration */
for ( i = 0; mat[ i ].name; i++ ) {
LDAPAttributeType *at;