First tests.

This commit is contained in:
Markus Makela
2015-03-31 17:27:25 +03:00
parent c3cb8df8a0
commit 341c04aa48
6 changed files with 72 additions and 8 deletions

View File

@ -64,6 +64,7 @@
#include <dcb.h>
#include <modinfo.h>
#include <maxconfig.h>
#include <mon_exec.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
@ -184,6 +185,7 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt;
handle->connect_timeout=DEFAULT_CONNECT_TIMEOUT;
handle->read_timeout=DEFAULT_READ_TIMEOUT;
handle->write_timeout=DEFAULT_WRITE_TIMEOUT;
handle->script = NULL;
spinlock_init(&handle->lock);
}
@ -193,6 +195,8 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt;
handle->detectStaleMaster = config_truth_value(params->value);
else if(!strcmp(params->name,"detect_replication_lag"))
handle->replicationHeartbeat = config_truth_value(params->value);
else if(!strcmp(params->name,"script"))
handle->script = strdup(params->value);
params = params->next;
}
@ -696,7 +700,15 @@ int log_no_master = 1;
!(SERVER_IS_IN_CLUSTER(ptr->server)))
{
dcb_call_foreach(ptr->server,DCB_REASON_NOT_RESPONDING);
}
}
/*
if(handle->script)
{
if(monitor_exec_cmd(handle->script))
skygw_log_write(LOGFILE_ERROR,"Error: Failed to execute command '%s' on server state change.",handle->script);
}
*/
}
if (mon_status_changed(ptr))