pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
alerts.c File Reference
#include <crm_internal.h>
#include <crm/crm.h>
#include <crm/lrmd.h>
#include <crm/msg_xml.h>
#include <crm/common/alerts_internal.h>
#include <crm/cib/internal.h>
Include dependency graph for alerts.c:

Go to the source code of this file.

Macros

#define XPATH_PATCHSET1_DIFF   "//" F_CIB_UPDATE_RESULT "//" XML_TAG_DIFF_ADDED
 
#define XPATH_PATCHSET1_CRMCONFIG   XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_CRMCONFIG
 
#define XPATH_PATCHSET1_ALERTS   XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_ALERTS
 
#define XPATH_PATCHSET1_EITHER   XPATH_PATCHSET1_CRMCONFIG " | " XPATH_PATCHSET1_ALERTS
 
#define XPATH_CONFIG   "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION
 
#define XPATH_CRMCONFIG   XPATH_CONFIG "/" XML_CIB_TAG_CRMCONFIG "/"
 
#define XPATH_ALERTS   XPATH_CONFIG "/" XML_CIB_TAG_ALERTS
 

Functions

crm_alert_entry_tcrm_alert_entry_new (const char *id, const char *path)
 Create a new alert entry structure. More...
 
void crm_free_alert_entry (crm_alert_entry_t *entry)
 
crm_alert_entry_tcrm_dup_alert_entry (crm_alert_entry_t *entry)
 
void crm_unset_alert_keys ()
 
void crm_insert_alert_key (GHashTable *table, enum crm_alert_keys_e name, const char *value)
 
void crm_insert_alert_key_int (GHashTable *table, enum crm_alert_keys_e name, int value)
 
void crm_set_envvar_list (crm_alert_entry_t *entry)
 
void crm_unset_envvar_list (crm_alert_entry_t *entry)
 
bool crm_patchset_contains_alert (xmlNode *msg, bool config)
 

Variables

const char * crm_alert_keys [CRM_ALERT_INTERNAL_KEY_MAX][3]
 

Macro Definition Documentation

#define XPATH_ALERTS   XPATH_CONFIG "/" XML_CIB_TAG_ALERTS

Definition at line 194 of file alerts.c.

#define XPATH_CONFIG   "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION

Definition at line 191 of file alerts.c.

#define XPATH_CRMCONFIG   XPATH_CONFIG "/" XML_CIB_TAG_CRMCONFIG "/"

Definition at line 193 of file alerts.c.

#define XPATH_PATCHSET1_ALERTS   XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_ALERTS

Definition at line 186 of file alerts.c.

#define XPATH_PATCHSET1_CRMCONFIG   XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_CRMCONFIG

Definition at line 185 of file alerts.c.

#define XPATH_PATCHSET1_DIFF   "//" F_CIB_UPDATE_RESULT "//" XML_TAG_DIFF_ADDED

Definition at line 183 of file alerts.c.

#define XPATH_PATCHSET1_EITHER   XPATH_PATCHSET1_CRMCONFIG " | " XPATH_PATCHSET1_ALERTS

Definition at line 188 of file alerts.c.

Function Documentation

crm_alert_entry_t* crm_alert_entry_new ( const char *  id,
const char *  path 
)

Create a new alert entry structure.

Parameters
[in]idID to use
[in]pathPath to alert agent executable
Returns
Pointer to newly allocated alert entry
Note
Non-string fields will be filled in with defaults. It is the caller's responsibility to free the result, using crm_free_alert_entry().

Definition at line 54 of file alerts.c.

crm_alert_entry_t* crm_dup_alert_entry ( crm_alert_entry_t entry)

Definition at line 92 of file alerts.c.

void crm_free_alert_entry ( crm_alert_entry_t entry)

Definition at line 67 of file alerts.c.

void crm_insert_alert_key ( GHashTable *  table,
enum crm_alert_keys_e  name,
const char *  value 
)

Definition at line 126 of file alerts.c.

void crm_insert_alert_key_int ( GHashTable *  table,
enum crm_alert_keys_e  name,
int  value 
)

Definition at line 140 of file alerts.c.

bool crm_patchset_contains_alert ( xmlNode *  msg,
bool  config 
)

Definition at line 206 of file alerts.c.

void crm_set_envvar_list ( crm_alert_entry_t entry)

Definition at line 165 of file alerts.c.

void crm_unset_alert_keys ( void  )

Definition at line 112 of file alerts.c.

void crm_unset_envvar_list ( crm_alert_entry_t entry)

Definition at line 176 of file alerts.c.

Variable Documentation

const char* crm_alert_keys[CRM_ALERT_INTERNAL_KEY_MAX][3]
Initial value:
=
{
[CRM_alert_recipient] = {"CRM_notify_recipient", "CRM_alert_recipient", NULL},
[CRM_alert_node] = {"CRM_notify_node", "CRM_alert_node", NULL},
[CRM_alert_nodeid] = {"CRM_notify_nodeid", "CRM_alert_nodeid", NULL},
[CRM_alert_rsc] = {"CRM_notify_rsc", "CRM_alert_rsc", NULL},
[CRM_alert_task] = {"CRM_notify_task", "CRM_alert_task", NULL},
[CRM_alert_interval] = {"CRM_notify_interval", "CRM_alert_interval", NULL},
[CRM_alert_desc] = {"CRM_notify_desc", "CRM_alert_desc", NULL},
[CRM_alert_status] = {"CRM_notify_status", "CRM_alert_status", NULL},
[CRM_alert_target_rc] = {"CRM_notify_target_rc", "CRM_alert_target_rc", NULL},
[CRM_alert_rc] = {"CRM_notify_rc", "CRM_alert_rc", NULL},
[CRM_alert_kind] = {"CRM_notify_kind", "CRM_alert_kind", NULL},
[CRM_alert_version] = {"CRM_notify_version", "CRM_alert_version", NULL},
[CRM_alert_node_sequence] = {"CRM_notify_node_sequence", CRM_ALERT_NODE_SEQUENCE, NULL},
[CRM_alert_timestamp] = {"CRM_notify_timestamp", "CRM_alert_timestamp", NULL},
[CRM_alert_attribute_name] = {"CRM_notify_attribute_name", "CRM_alert_attribute_name", NULL},
[CRM_alert_attribute_value] = {"CRM_notify_attribute_value", "CRM_alert_attribute_value", NULL},
[CRM_alert_timestamp_epoch] = {"CRM_notify_timestamp_epoch", "CRM_alert_timestamp_epoch", NULL},
[CRM_alert_timestamp_usec] = {"CRM_notify_timestamp_usec", "CRM_alert_timestamp_usec", NULL},
[CRM_alert_exec_time] = {"CRM_notify_exec_time", "CRM_alert_exec_time", NULL}
}
#define CRM_ALERT_NODE_SEQUENCE

Definition at line 19 of file alerts.c.