Move monitor script processing and launching into the core

This removes parts of the nearly identical code from all monitors.

The removal of monitor type specific event checking is done based on the
assumption that only the monitor that is monitoring the server can be the
cause for a state change. This removes the need to actually check that the
state change is relevant for each monitor and allows the event handling to
be moved into the core.
This commit is contained in:
Markus Mäkelä
2017-01-11 11:11:11 +02:00
parent 7ef5e4bfd9
commit a196420c2d
11 changed files with 206 additions and 680 deletions

View File

@ -73,7 +73,7 @@ typedef struct
bool mysql51_replication; /**< Use MySQL 5.1 replication */
MONITOR_SERVERS *master; /**< Master server for MySQL Master/Slave replication */
char* script; /*< Script to call when state changes occur on servers */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */
uint64_t events; /*< enabled events */
HASHTABLE *server_info; /**< Contains server specific information */
bool failover; /**< If simple failover is enabled */
int failcount; /**< How many monitoring cycles servers must be