HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Example 3-1 Extended operation plug-in
dn: cn=Test ExtendedOp,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Test ExtendedOp
nsslapd-pluginPath: /opt/dirsrv/devel/example/libtest-plugin.so
nsslapd-pluginInitfunc: testexop_init
nsslapd-pluginType: extendedop
nsslapd-pluginEnabled: on
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: test-extendedop
nsslapd-pluginarg0: 1.2.3.4
Example 3-2 Advanced example plug-in
dn: cn=Advanced Example Auth,cn=plugins,cn=config
objectclass: top
objectclass: nsSlapdPlugin
objectclass: extensibleObject
objectclass: exampleConfig
cn: Advanced Example
nsslapd-pluginpath: /opt/dirsrv/lib/plugins/advanced-plugin.so
nsslapd-plugininitfunc: advanced_example_init
nsslapd-plugintype: preoperation
nsslapd-pluginenabled: on
nsslapd-pluginLoadGlobal: true
nsslapd-plugin-depends-on-type: database
advancedExampleSuffix: dc=example,dc=com
advancedExampleLogLevel: 1
This method allows for a much more descriptive configuration, which is easier to maintain. The
attributes beginning with advancedExample are specific to the plug-in and used for its
configuration. The plug-in entry is provided to the plug-in start function as a Slapi_Entry *
in the SLAPI_ADD_TARGET pblock parameter. Use the slapi_entry_attr_* family of
functions to get the configuration values from that entry.
For additional information, see the code samples in the /opt/dirsrv/devel/example
directory.
3.4 Setting the log level of the server
If your functions call the “slapi_log_error()” function to write messages to the error log, you
need to make sure that the Directory Server is configured to log messages with the severity level
that you have specified. The available severity levels are fully documented in Part IV “Function
reference”.
For example, suppose you call this function in your plug-in:
slapi_log_error( SLAPI_LOG_PLUGIN, "searchdn_preop_init", \
Plug-in successfully registered.\n );
You need to make sure that the Directory Server is configured to log messages with the severity
level SLAPI_LOG_PLUGIN. Error logging is controlled with the nsslapd-errorlog-level
attribute in cn=config.
3.4 Setting the log level of the server 41