# module. You can have module-specific triggers, by placing a
# "trigger" subsection in the module configuration.
modules {
+ # The LDAP module
+ ldap {
+ # Common arguments
+ args = "radiusdModuleName s ldap' radiusdModuleInstance s ''"
+
+ # Failed to open a new connection to the DB
+ fail = "${snmptrap}::serverModuleConnectionFail ${args}"
+
+ # There are no "open", "close", or "none" setting.
+ # This is because the LDAP module re-connects and closes
+ # the connection for every "bind as user" query.
+ }
+
# The SQL module
sql {
# Common arguments
# home_server.zombie
# home_server_pool.fallback
# home_server_pool.normal
+# modules.ldap.fail
# modules.sql.close
# modules.sql.fail
# modules.sql.none
} LDAP_CONN;
typedef struct {
+ CONF_SECTION *cs;
char *server;
int port;
int timelimit;
memset(inst, 0, sizeof(*inst));
inst->chase_referrals = 2; /* use OpenLDAP defaults */
inst->rebind = 2;
+ inst->cs = conf;
if (cf_section_parse(conf, inst, module_config) < 0) {
free(inst);
#ifdef HAVE_LDAP_INITIALIZE
DEBUG(" [%s] (re)connect to %s, authentication %d", inst->xlat_name, inst->server, auth);
if (ldap_initialize(&ld, inst->server) != LDAP_SUCCESS) {
+ exec_trigger(NULL, inst->cs, "modules.ldap.fail");
radlog(L_ERR, " [%s] ldap_initialize() failed", inst->xlat_name);
*result = RLM_MODULE_FAIL;
return (NULL);
} else {
DEBUG(" [%s] (re)connect to %s:%d, authentication %d", inst->xlat_name, inst->server, inst->port, auth);
if ((ld = ldap_init(inst->server, inst->port)) == NULL) {
+ exec_trigger(NULL, inst->cs, "modules.ldap.fail");
radlog(L_ERR, " [%s] ldap_init() failed", inst->xlat_name);
*result = RLM_MODULE_FAIL;
return (NULL);
}
}
+
tv.tv_sec = inst->net_timeout;
tv.tv_usec = 0;
if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT,
ldap_err2string(ldap_errno));
*result = RLM_MODULE_FAIL;
ldap_unbind_s(ld);
+ exec_trigger(NULL, inst->cs, "modules.ldap.fail");
return (NULL);
}
}