47 crm_trace(
"Setting alert key %s = '%s'", *key, value);
59 head = alert_key2param(head, name, value_s);
65 set_ev_kv(gpointer key, gpointer value, gpointer user_data)
70 crm_trace(
"Setting environment variable %s='%s'",
71 (
char*)key, (
char*)value);
80 g_hash_table_foreach(entry->
envvars, set_ev_kv, &head);
90 is_target_alert(
char **list,
const char *value)
92 int target_list_num = 0;
101 target_list_num = g_strv_length(list);
103 for (
int cnt = 0; cnt < target_list_num; cnt++) {
104 if (strcmp(list[cnt], value) == 0) {
130 bool any_success = FALSE, any_failure = FALSE;
131 const char *kind_s = crm_alert_flag2text(kind);
137 for (GList *iter = g_list_first(alert_list); iter; iter = g_list_next(iter)) {
143 if (is_not_set(entry->
flags, kind)) {
144 crm_trace(
"Filtering unwanted %s alert to %s via %s",
152 crm_trace(
"Filtering unwanted attribute '%s' alert to %s via %s",
160 crm_info(
"Sending %s alert via %s to %s",
164 for (head = params; head != NULL; head = head->
next) {
181 copy_params = alert_envvar2params(copy_params, entry);
199 return (any_success? -1 : -2);
222 const char *attr_name,
const char *attr_value)
258 const char *node,
uint32_t nodeid,
const char *state)
271 rc = exec_alert_list(lrmd, alert_list,
crm_alert_node, NULL, params);
293 const char *target,
const char *task,
const char *desc,
306 params = alert_key2param_int(params,
CRM_alert_rc, op_rc);
339 if ((op->
interval == 0) && (target_rc == op->
rc)
359 params = alert_key2param(params,
CRM_alert_desc, services_ocf_exitcode_str(op->
rc));
#define CRM_CHECK(expr, failure_action)
const char * crm_alert_keys[CRM_ALERT_INTERNAL_KEY_MAX][3]
int lrmd_send_resource_alert(lrmd_t *lrmd, GList *alert_list, const char *node, lrmd_event_data_t *op)
const char * pcmk_strerror(int rc)
int rsc_op_expected_rc(lrmd_event_data_t *event)
char * crm_time_format_hr(const char *format, crm_time_hr_t *hr_dt)
Wrappers for and extensions to glib mainloop.
int(* exec_alert)(lrmd_t *lrmd, const char *alert_id, const char *alert_path, int timeout, lrmd_key_value_t *params)
Execute an alert agent.
crm_time_hr_t * crm_time_hr_new(const char *date_time)
int lrmd_send_node_alert(lrmd_t *lrmd, GList *alert_list, const char *node, uint32_t nodeid, const char *state)
#define crm_trace(fmt, args...)
lrmd_key_value_t * lrmd_key_value_add(lrmd_key_value_t *kvp, const char *key, const char *value)
struct lrmd_key_value_s * next
void lrmd_key_value_freeall(lrmd_key_value_t *head)
lrmd_api_operations_t * cmds
int lrmd_send_fencing_alert(lrmd_t *lrmd, GList *alert_list, const char *target, const char *task, const char *desc, int op_rc)
#define crm_err(fmt, args...)
char ** select_attribute_name
char * crm_itoa(int an_int)
#define safe_str_eq(a, b)
int lrmd_send_attribute_alert(lrmd_t *lrmd, GList *alert_list, const char *node, uint32_t nodeid, const char *attr_name, const char *attr_value)
#define crm_info(fmt, args...)