MXS-2271 Move script-related settings to the settings-container

Also moves related functions to class methods.
This commit is contained in:
Esa Korhonen
2019-01-28 17:47:48 +02:00
parent 0903648542
commit ce9b49d8d5
6 changed files with 64 additions and 69 deletions

View File

@ -19,14 +19,14 @@
MXS_BEGIN_DECLS
typedef struct extern_cmd_t
struct EXTERNCMD
{
char** argv; /**< Argument vector for the command, first being the
* actual command being executed */
int n_exec; /**< Number of times executed */
pid_t child; /**< PID of the child process */
uint32_t timeout; /**< Command timeout in seconds */
} EXTERNCMD;
};
char* externcmd_extract_command(const char* argstr);

View File

@ -139,7 +139,6 @@ bool monitor_remove_parameter(Monitor* monitor, const char* key);
void monitor_set_parameter(Monitor* monitor, const char* key, const char* value);
void monitor_set_journal_max_age(Monitor* mon, time_t value);
void monitor_set_script_timeout(Monitor* mon, uint32_t value);
/**
* @brief Serialize a monitor to a file
@ -157,28 +156,3 @@ bool monitor_serialize(const Monitor* monitor);
* @return The monitor watching this server, or NULL if not monitored
*/
Monitor* monitor_server_in_use(const SERVER* server);
/**
* Launch a script
*
* @param mon Owning monitor
* @param ptr The server which has changed state
* @param script Script to execute
* @param timeout Timeout in seconds for the script
*
* @return Return value of the executed script or -1 on error
*/
int monitor_launch_script(Monitor* mon, MXS_MONITORED_SERVER* ptr, const char* script, uint32_t timeout);
/**
* Launch a command
*
* @param mon Owning monitor
* @param ptr The server which has changed state
* @param cmd The command to execute.
*
* @note All default script variables will be replaced.
*
* @return Return value of the executed script or -1 on error.
*/
int monitor_launch_command(Monitor* mon, MXS_MONITORED_SERVER* ptr, EXTERNCMD* cmd);