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) {
130 bool any_success = FALSE, any_failure = FALSE;
131 const char *kind_s = pcmk__alert_flag2text(kind);
133 struct timeval tv_now;
134 char timestamp_epoch[20];
135 char timestamp_usec[7];
141 for (GList *iter = g_list_first(alert_list); iter; iter = g_list_next(iter)) {
148 crm_trace(
"Filtering unwanted %s alert to %s via %s",
156 crm_trace(
"Filtering unwanted attribute '%s' alert to %s via %s",
162 if (gettimeofday(&tv_now, NULL) == 0) {
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",
188 (
long long) tv_now.tv_sec);
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)
pcmk__time_hr_t * pcmk__time_timeval_hr_convert(pcmk__time_hr_t *target, struct timeval *tv)
int lrmd_send_node_alert(lrmd_t *lrmd, GList *alert_list, const char *node, uint32_t nodeid, const char *state)
int rsc_op_expected_rc(lrmd_event_data_t *event)
char ** select_attribute_name
int lrmd_send_fencing_alert(lrmd_t *lrmd, GList *alert_list, const char *target, const char *task, const char *desc, int op_rc)
Action did not complete in time.
#define PACEMAKER_VERSION
char * pcmk__time_format_hr(const char *format, pcmk__time_hr_t *hr_dt)
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.
#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.
Action completed, result is known.
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)
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
int lrmd_send_resource_alert(lrmd_t *lrmd, GList *alert_list, const char *node, lrmd_event_data_t *op)
void lrmd_key_value_freeall(lrmd_key_value_t *head)
Cluster status and scheduling.
lrmd_api_operations_t * cmds
#define crm_err(fmt, args...)
#define crm_info(fmt, args...)