MXS-1441 Expose monitor_launch_script
So that it can be called directly from a monitor.
This commit is contained in:
@ -92,4 +92,16 @@ bool monitor_serialize(const MXS_MONITOR *monitor);
|
|||||||
*/
|
*/
|
||||||
MXS_MONITOR* monitor_server_in_use(const SERVER *server);
|
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
|
MXS_END_DECLS
|
||||||
|
@ -1235,16 +1235,6 @@ static std::string child_nodes(MXS_MONITORED_SERVER* servers,
|
|||||||
return ss.str();
|
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)
|
int monitor_launch_script(MXS_MONITOR* mon, MXS_MONITORED_SERVER* ptr, const char* script, uint32_t timeout)
|
||||||
{
|
{
|
||||||
char arg[strlen(script) + 1];
|
char arg[strlen(script) + 1];
|
||||||
|
Reference in New Issue
Block a user