mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 19:49:35 -05:00
cleanup subsystems monitoring OID handling
This commit is contained in:
parent
df730d8538
commit
4d55aeb57c
2 changed files with 76 additions and 5 deletions
|
|
@ -47,12 +47,22 @@ static AttributeDescription *ad_olmBDBEntryCache,
|
|||
#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 "
|
||||
|
|
@ -60,7 +70,7 @@ static struct {
|
|||
"USAGE directoryOperation )",
|
||||
&ad_olmBDBEntryCache },
|
||||
|
||||
{ "olmBDBEntryInfo", "( " BDB_MONITOR_SCHEMA_AD ".2 "
|
||||
{ "olmBDBEntryInfo", "( olmBDBAttributes:2 "
|
||||
"NAME ( 'olmBDBEntryInfo' ) "
|
||||
"DESC 'Number of items in EntryInfo Cache' "
|
||||
"SUP monitorCounter "
|
||||
|
|
@ -68,7 +78,7 @@ static struct {
|
|||
"USAGE directoryOperation )",
|
||||
&ad_olmBDBEntryInfo },
|
||||
|
||||
{ "olmBDBIDLCache", "( " BDB_MONITOR_SCHEMA_AD ".3 "
|
||||
{ "olmBDBIDLCache", "( olmBDBAttributes:3 "
|
||||
"NAME ( 'olmBDBIDLCache' ) "
|
||||
"DESC 'Number of items in IDL Cache' "
|
||||
"SUP monitorCounter "
|
||||
|
|
@ -76,7 +86,7 @@ static struct {
|
|||
"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' "
|
||||
|
|
@ -95,7 +105,7 @@ static struct {
|
|||
} 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 ( "
|
||||
|
|
@ -211,6 +221,22 @@ bdb_monitor_initialize( void )
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1502,10 +1502,55 @@ monitor_back_initialize(
|
|||
{ 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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue