36 crm_trace(
"Setting alert key %s = '%s'", *key, value);
46 char *value_s = pcmk__itoa(value);
48 head = alert_key2param(head,
name, value_s);
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) {
127 exec_alert_list(
lrmd_t *lrmd,
const GList *alert_list,
131 bool any_success = FALSE, any_failure = FALSE;
132 const char *kind_s = pcmk__alert_flag2text(kind);
134 char timestamp_epoch[20];
135 char timestamp_usec[7];
142 for (
const GList *iter = alert_list;
143 iter != NULL; iter = g_list_next(iter)) {
150 crm_trace(
"Filtering unwanted %s alert to %s via %s",
158 crm_trace(
"Filtering unwanted attribute '%s' alert to %s via %s",
166 crm_info(
"Sending %s alert via %s to %s",
170 for (head = params; head != NULL; head = head->
next) {
181 copy_params = alert_key2param(copy_params,
187 snprintf(timestamp_epoch,
sizeof(timestamp_epoch),
"%lld",
189 copy_params = alert_key2param(copy_params,
192 snprintf(timestamp_usec,
sizeof(timestamp_usec),
"%06d", now->
useconds);
193 copy_params = alert_key2param(copy_params,
198 copy_params = alert_envvar2params(copy_params, entry);
216 return (any_success? -1 : -2);
238 const char *node, uint32_t nodeid,
239 const char *attr_name,
const char *attr_value)
276 const char *node, uint32_t nodeid,
const char *state)
311 const char *
target,
const char *task,
const char *desc,
390 services_ocf_exitcode_str(op->
rc));
#define CRM_CHECK(expr, failure_action)
const char * pcmk_strerror(int rc)
char ** select_attribute_name
#define PCMK_ACTION_MONITOR
Action did not complete in time.
#define PACEMAKER_VERSION
Wrappers for and extensions to glib mainloop.
const char * pcmk__alert_keys[PCMK__ALERT_INTERNAL_KEY_MAX][3]
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.
int rsc_op_expected_rc(const lrmd_event_data_t *event)
#define crm_trace(fmt, args...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
int lrmd_send_attribute_alert(lrmd_t *lrmd, const GList *alert_list, const char *node, uint32_t nodeid, const char *attr_name, const char *attr_value)
Action completed, result is known.
lrmd_key_value_t * lrmd_key_value_add(lrmd_key_value_t *kvp, const char *key, const char *value)
pcmk__time_hr_t * pcmk__time_hr_now(time_t *epoch)
struct lrmd_key_value_s * next
int lrmd_send_node_alert(lrmd_t *lrmd, const GList *alert_list, const char *node, uint32_t nodeid, const char *state)
void lrmd_key_value_freeall(lrmd_key_value_t *head)
char * pcmk__time_format_hr(const char *format, const pcmk__time_hr_t *hr_dt)
Cluster status and scheduling.
int lrmd_send_fencing_alert(lrmd_t *lrmd, const GList *alert_list, const char *target, const char *task, const char *desc, int op_rc)
lrmd_api_operations_t * cmds
#define crm_err(fmt, args...)
int lrmd_send_resource_alert(lrmd_t *lrmd, const GList *alert_list, const char *node, const lrmd_event_data_t *op)
#define crm_info(fmt, args...)