Monitor json diagnostics printing cleanup

The 'events' and 'script' config values were defined for every monitor.
Removed the extra definitions and moved the variables to MXS_MONITOR.

MariaDBMonitor was printing config values a second time, they are
already printed by the caller.

Moved the events enum definition to the internal header since it's no longer
required by modules.

Added a default config setting "all" to 'events' to clarify that it enables
all events.
This commit is contained in:
Esa Korhonen
2018-08-08 17:14:03 +03:00
parent 6661680c4e
commit b9ec3f5130
12 changed files with 57 additions and 192 deletions

View File

@ -47,6 +47,37 @@ typedef enum
MONITOR_CONNECT_ATTEMPTS = 3
} monitor_timeouts_t;
/* Is not really an event as the other values, but is a valid config setting and also the default.
* Bitmask value matches all events. */
static const MXS_ENUM_VALUE mxs_monitor_event_default_enum = {"all", ~0ULL};
static const MXS_ENUM_VALUE mxs_monitor_event_enum_values[] =
{
mxs_monitor_event_default_enum,
{"master_down", MASTER_DOWN_EVENT},
{"master_up", MASTER_UP_EVENT},
{"slave_down", SLAVE_DOWN_EVENT},
{"slave_up", SLAVE_UP_EVENT},
{"server_down", SERVER_DOWN_EVENT},
{"server_up", SERVER_UP_EVENT},
{"synced_down", SYNCED_DOWN_EVENT},
{"synced_up", SYNCED_UP_EVENT},
{"donor_down", DONOR_DOWN_EVENT},
{"donor_up", DONOR_UP_EVENT},
{"ndb_down", NDB_DOWN_EVENT},
{"ndb_up", NDB_UP_EVENT},
{"lost_master", LOST_MASTER_EVENT},
{"lost_slave", LOST_SLAVE_EVENT},
{"lost_synced", LOST_SYNCED_EVENT},
{"lost_donor", LOST_DONOR_EVENT},
{"lost_ndb", LOST_NDB_EVENT},
{"new_master", NEW_MASTER_EVENT},
{"new_slave", NEW_SLAVE_EVENT},
{"new_synced", NEW_SYNCED_EVENT},
{"new_donor", NEW_DONOR_EVENT},
{"new_ndb", NEW_NDB_EVENT},
{NULL}
};
MXS_MONITOR *monitor_create(const char *, const char *, MXS_CONFIG_PARAMETER* params);
void monitor_destroy(MXS_MONITOR *);