MXS-1441 Expose monitor_launch_command

So that a specific monitor may create the command and replace
monitor specific script variables before giving the command
for execution.
This commit is contained in:
Johan Wikman
2017-10-03 10:32:42 +03:00
parent 8d1c4bdd56
commit cf0a87e7f2
2 changed files with 36 additions and 15 deletions

View File

@ -17,6 +17,7 @@
*/
#include <maxscale/monitor.h>
#include "externcmd.h"
MXS_BEGIN_DECLS
@ -104,4 +105,17 @@ MXS_MONITOR* monitor_server_in_use(const SERVER *server);
*/
int monitor_launch_script(MXS_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(MXS_MONITOR* mon, MXS_MONITORED_SERVER* ptr, EXTERNCMD* cmd);
MXS_END_DECLS