pacemaker
1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
crm
common
alerts_internal.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Andrew Beekhof <andrew@beekhof.net>
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
8
*
9
* This software is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
#ifndef ALERT_INTERNAL_H
20
#define ALERT_INTERNAL_H
21
22
#include <glib.h>
23
#include <stdbool.h>
24
25
/* Default-Timeout to use before killing a alerts script (in milliseconds) */
26
# define CRM_ALERT_DEFAULT_TIMEOUT_MS (30000)
27
28
/* Default-Format-String used to pass timestamps to the alerts scripts */
29
# define CRM_ALERT_DEFAULT_TSTAMP_FORMAT "%H:%M:%S.%06N"
30
31
typedef
struct
{
32
char
*
name
;
33
char
*
value
;
34
}
crm_alert_envvar_t
;
35
36
enum
crm_alert_flags
{
37
crm_alert_none
= 0x0000,
38
crm_alert_node
= 0x0001,
39
crm_alert_fencing
= 0x0002,
40
crm_alert_resource
= 0x0004,
41
crm_alert_attribute
= 0x0008,
42
crm_alert_default
=
crm_alert_node
|
crm_alert_fencing
|
crm_alert_resource
43
};
44
45
typedef
struct
{
46
char
*
id
;
47
char
*
path
;
48
char
*
tstamp_format
;
49
char
*
recipient
;
50
char
**
select_attribute_name
;
51
GHashTable *
envvars
;
52
int
timeout
;
53
uint32_t
flags
;
54
}
crm_alert_entry_t
;
55
56
enum
crm_alert_keys_e
{
57
CRM_alert_recipient
= 0,
58
CRM_alert_node
,
59
CRM_alert_nodeid
,
60
CRM_alert_rsc
,
61
CRM_alert_task
,
62
CRM_alert_interval
,
63
CRM_alert_desc
,
64
CRM_alert_status
,
65
CRM_alert_target_rc
,
66
CRM_alert_rc
,
67
CRM_alert_kind
,
68
CRM_alert_version
,
69
CRM_alert_node_sequence
,
70
CRM_alert_timestamp
,
71
CRM_alert_attribute_name
,
72
CRM_alert_attribute_value
,
73
CRM_alert_select_kind
,
74
CRM_alert_select_attribute_name
75
};
76
77
#define CRM_ALERT_INTERNAL_KEY_MAX 16
78
#define CRM_ALERT_NODE_SEQUENCE "CRM_alert_node_sequence"
79
80
extern
const
char
*
crm_alert_keys
[
CRM_ALERT_INTERNAL_KEY_MAX
][3];
81
82
crm_alert_entry_t
*
crm_dup_alert_entry
(
crm_alert_entry_t
*entry);
83
crm_alert_envvar_t
*
crm_dup_alert_envvar
(
crm_alert_envvar_t
*src);
84
crm_alert_entry_t
*
crm_alert_entry_new
(
const
char
*
id
,
const
char
*path);
85
void
crm_free_alert_entry
(
crm_alert_entry_t
*entry);
86
void
crm_free_alert_envvar
(
crm_alert_envvar_t
*entry);
87
void
crm_insert_alert_key
(GHashTable *table,
enum
crm_alert_keys_e
name,
88
const
char
*value);
89
void
crm_insert_alert_key_int
(GHashTable *table,
enum
crm_alert_keys_e
name,
90
int
value);
91
void
crm_unset_alert_keys
(
void
);
92
void
crm_set_envvar_list
(
crm_alert_entry_t
*entry);
93
void
crm_unset_envvar_list
(
crm_alert_entry_t
*entry);
94
bool
crm_patchset_contains_alert
(xmlNode *msg,
bool
config);
95
96
static
inline
const
char
*
97
crm_alert_flag2text(
enum
crm_alert_flags
flag)
98
{
99
switch
(flag) {
100
case
crm_alert_node
:
101
return
"node"
;
102
case
crm_alert_fencing
:
103
return
"fencing"
;
104
case
crm_alert_resource
:
105
return
"resource"
;
106
case
crm_alert_attribute
:
107
return
"attribute"
;
108
default
:
109
return
"unknown"
;
110
}
111
}
112
#endif
crm_alert_attribute
Definition:
alerts_internal.h:41
crm_alert_envvar_t
Definition:
alerts_internal.h:31
CRM_alert_target_rc
Definition:
alerts_internal.h:65
crm_alert_keys
const char * crm_alert_keys[CRM_ALERT_INTERNAL_KEY_MAX][3]
Definition:
alerts.c:30
CRM_alert_nodeid
Definition:
alerts_internal.h:59
crm_alert_envvar_t::value
char * value
Definition:
alerts_internal.h:33
crm_alert_entry_t::envvars
GHashTable * envvars
Definition:
alerts_internal.h:51
crm_dup_alert_envvar
crm_alert_envvar_t * crm_dup_alert_envvar(crm_alert_envvar_t *src)
Definition:
alerts.c:100
CRM_alert_task
Definition:
alerts_internal.h:61
crm_alert_node
Definition:
alerts_internal.h:38
CRM_alert_select_attribute_name
Definition:
alerts_internal.h:74
crm_alert_entry_t::recipient
char * recipient
Definition:
alerts_internal.h:49
crm_alert_entry_t
Definition:
alerts_internal.h:45
CRM_alert_kind
Definition:
alerts_internal.h:67
crm_unset_envvar_list
void crm_unset_envvar_list(crm_alert_entry_t *entry)
Definition:
alerts.c:203
crm_set_envvar_list
void crm_set_envvar_list(crm_alert_entry_t *entry)
Definition:
alerts.c:192
crm_dup_alert_entry
crm_alert_entry_t * crm_dup_alert_entry(crm_alert_entry_t *entry)
Definition:
alerts.c:119
crm_alert_entry_t::flags
uint32_t flags
Definition:
alerts_internal.h:53
crm_alert_entry_t::tstamp_format
char * tstamp_format
Definition:
alerts_internal.h:48
crm_alert_entry_t::id
char * id
Definition:
alerts_internal.h:46
CRM_alert_attribute_name
Definition:
alerts_internal.h:71
crm_unset_alert_keys
void crm_unset_alert_keys(void)
Definition:
alerts.c:139
CRM_alert_status
Definition:
alerts_internal.h:64
CRM_alert_attribute_value
Definition:
alerts_internal.h:72
CRM_alert_select_kind
Definition:
alerts_internal.h:73
crm_alert_default
Definition:
alerts_internal.h:42
CRM_alert_node
Definition:
alerts_internal.h:58
crm_alert_envvar_t::name
char * name
Definition:
alerts_internal.h:32
CRM_alert_timestamp
Definition:
alerts_internal.h:70
CRM_alert_version
Definition:
alerts_internal.h:68
crm_alert_fencing
Definition:
alerts_internal.h:39
crm_insert_alert_key_int
void crm_insert_alert_key_int(GHashTable *table, enum crm_alert_keys_e name, int value)
Definition:
alerts.c:167
CRM_alert_desc
Definition:
alerts_internal.h:63
CRM_alert_interval
Definition:
alerts_internal.h:62
CRM_alert_recipient
Definition:
alerts_internal.h:57
crm_patchset_contains_alert
bool crm_patchset_contains_alert(xmlNode *msg, bool config)
Definition:
alerts.c:233
crm_alert_entry_new
crm_alert_entry_t * crm_alert_entry_new(const char *id, const char *path)
Create a new alert entry structure.
Definition:
alerts.c:70
crm_alert_none
Definition:
alerts_internal.h:37
CRM_alert_rc
Definition:
alerts_internal.h:66
crm_alert_entry_t::select_attribute_name
char ** select_attribute_name
Definition:
alerts_internal.h:50
crm_alert_entry_t::timeout
int timeout
Definition:
alerts_internal.h:52
crm_free_alert_envvar
void crm_free_alert_envvar(crm_alert_envvar_t *entry)
Definition:
alerts.c:51
crm_alert_keys_e
crm_alert_keys_e
Definition:
alerts_internal.h:56
uint32_t
#define uint32_t
Definition:
stdint.in.h:158
crm_alert_entry_t::path
char * path
Definition:
alerts_internal.h:47
CRM_alert_node_sequence
Definition:
alerts_internal.h:69
crm_insert_alert_key
void crm_insert_alert_key(GHashTable *table, enum crm_alert_keys_e name, const char *value)
Definition:
alerts.c:153
crm_alert_resource
Definition:
alerts_internal.h:40
CRM_alert_rsc
Definition:
alerts_internal.h:60
crm_free_alert_entry
void crm_free_alert_entry(crm_alert_entry_t *entry)
Definition:
alerts.c:83
crm_alert_flags
crm_alert_flags
Definition:
alerts_internal.h:36
CRM_ALERT_INTERNAL_KEY_MAX
#define CRM_ALERT_INTERNAL_KEY_MAX
Definition:
alerts_internal.h:77
Generated on Tue Nov 14 2017 16:40:16 for pacemaker by
1.8.5