Add configuration option 'event_notification_command'

Command to be executed each time an event is logged.

Following formatting sequences will be interpolated:

      %e - event type
      %d - description
      %s - success (1 or 0)
      %t - timestamp
This commit is contained in:
Ian Barwick
2015-03-16 13:41:13 +09:00
parent b41235b896
commit 922dfd88e5
6 changed files with 160 additions and 19 deletions

View File

@@ -20,9 +20,11 @@
#ifndef _REPMGR_CONFIG_H_
#define _REPMGR_CONFIG_H_
#include "repmgr.h"
#include "postgres_fe.h"
#include "strutil.h"
typedef struct TablespaceListCell
{
struct TablespaceListCell *next;
@@ -62,10 +64,11 @@ typedef struct
int retry_promote_interval_secs;
int use_replication_slots;
int ignore_external_config_files;
char event_notification_command[MAXLEN];
TablespaceList tablespace_mapping;
} t_configuration_options;
#define T_CONFIGURATION_OPTIONS_INITIALIZER { "", -1, NO_UPSTREAM_NODE, "", MANUAL_FAILOVER, -1, "", "", "", "", "", "", "", -1, -1, -1, "", "", "", "", 0, 0, 0, 0, {NULL, NULL} }
#define T_CONFIGURATION_OPTIONS_INITIALIZER { "", -1, NO_UPSTREAM_NODE, "", MANUAL_FAILOVER, -1, "", "", "", "", "", "", "", -1, -1, -1, "", "", "", "", 0, 0, 0, 0, "", {NULL, NULL} }
bool parse_config(const char *config_file, t_configuration_options *options);