MXS-1441 Expose monitor_launch_script

So that it can be called directly from a monitor.
This commit is contained in:
Johan Wikman 2017-10-03 09:19:23 +03:00
parent f29d8209cc
commit e295d438d4
2 changed files with 12 additions and 10 deletions

View File

@ -92,4 +92,16 @@ bool monitor_serialize(const MXS_MONITOR *monitor);
*/
MXS_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(MXS_MONITOR* mon, MXS_MONITORED_SERVER* ptr, const char* script, uint32_t timeout);
MXS_END_DECLS

View File

@ -1235,16 +1235,6 @@ static std::string child_nodes(MXS_MONITORED_SERVER* servers,
return ss.str();
}
/**
* 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(MXS_MONITOR* mon, MXS_MONITORED_SERVER* ptr, const char* script, uint32_t timeout)
{
char arg[strlen(script) + 1];