Added detection of connection timeout when monitors connect to backend servers.

This commit is contained in:
Markus Makela
2015-10-26 14:25:43 +02:00
parent ddcfe03c15
commit 2b958bad94
3 changed files with 105 additions and 44 deletions

View File

@ -23,6 +23,7 @@
#include <monitor.h>
#include <log_manager.h>
#include <externcmd.h>
#include <secrets.h>
/**
* @file monitor_common.h - The generic monitor structures all monitors use
*
@ -63,6 +64,14 @@ typedef enum {
NEW_NDB_EVENT,
MAX_MONITOR_EVENT
}monitor_event_t;
typedef enum
{
MONITOR_CONN_OK,
MONITOR_CONN_REFUSED,
MONITOR_CONN_TIMEOUT
} connect_result_t;
void mon_append_node_names(MONITOR_SERVERS* start,char* str, int len);
monitor_event_t mon_get_event_type(MONITOR_SERVERS* node);
char* mon_get_event_name(MONITOR_SERVERS* node);
@ -72,4 +81,6 @@ bool mon_status_changed(MONITOR_SERVERS* mon_srv);
bool mon_print_fail_status(MONITOR_SERVERS* mon_srv);
void monitor_launch_script(MONITOR* mon,MONITOR_SERVERS* ptr, char* script);
int mon_parse_event_string(bool* events, size_t count,char* string);
connect_result_t mon_connect_to_db(MONITOR* mon, MONITOR_SERVERS *database);
void mon_log_connect_error(MONITOR_SERVERS* database, connect_result_t rval);
#endif