19 GHashTable *config_hash = crm_str_table_new();
21 const char *value = NULL;
24 config_hash, NULL, FALSE, now);
32 crm_trace(
"Alert %s uses default timeout of %dmsec",
35 crm_warn(
"Alert %s has invalid timeout value '%s', using default %dmsec",
40 crm_trace(
"Alert %s uses timeout of %dmsec",
43 if (entry->
timeout > *max_timeout) {
53 crm_trace(
"Alert %s uses timestamp format '%s'",
57 g_hash_table_destroy(config_hash);
65 if ((basenode == NULL) || (entry == NULL)) {
75 entry->
envvars = crm_str_table_new();
87 g_hash_table_insert(entry->
envvars, strdup(name), strdup(value));
88 crm_trace(
"Alert %s: added environment variable %s='%s'",
89 entry->
id, name, value);
97 xmlNode *event_type = NULL;
100 for (event_type = __xml_first_child(select); event_type != NULL;
101 event_type = __xml_next(event_type)) {
103 const char *tagname = crm_element_name(event_type);
105 if (tagname == NULL) {
119 const char *attr_name;
135 (nattrs + 1) *
sizeof(
char*));
145 crm_debug(
"Alert %s receives events: attributes:%s, fencing:%s, nodes:%s, resources:%s",
158 get_envvars_from_cib(alert, entry);
159 get_meta_attrs_from_cib(alert, entry, max_timeout);
160 unpack_alert_filter(alert, entry);
179 guint max_timeout = 0;
182 if (alerts == NULL) {
191 const char *alert_id =
ID(alert);
195 if ((alert_id == NULL) || (alert_path == NULL)) {
196 crm_warn(
"Ignoring invalid alert without id and path");
202 unpack_alert(alert, entry, &max_timeout);
208 crm_debug(
"Alert %s: path=%s timeout=%dms tstamp-format='%s' %u vars",
220 unpack_alert(recipient, recipient_entry, &max_timeout);
221 alert_list = g_list_prepend(alert_list, recipient_entry);
222 crm_debug(
"Alert %s has recipient %s with value %s and %d envvars",
225 g_hash_table_size(recipient_entry->
envvars) : 0));
228 if (recipients == 0) {
229 alert_list = g_list_prepend(alert_list, entry);