|
|
@ -37,13 +37,13 @@ public class ScriptSender { |
|
|
|
|
|
|
|
|
|
|
|
private String userParams; |
|
|
|
private String userParams; |
|
|
|
|
|
|
|
|
|
|
|
public ScriptSender(Map<String, String> config) { |
|
|
|
ScriptSender(Map<String, String> config) { |
|
|
|
scriptPath = config.get(ScriptParamsConstants.NAME_SCRIPT_PATH); |
|
|
|
scriptPath = config.get(ScriptParamsConstants.NAME_SCRIPT_PATH); |
|
|
|
scriptType = Integer.parseInt(config.get(ScriptParamsConstants.NAME_SCRIPT_TYPE)); |
|
|
|
scriptType = Integer.parseInt(config.get(ScriptParamsConstants.NAME_SCRIPT_TYPE)); |
|
|
|
userParams = config.get(ScriptParamsConstants.NAME_SCRIPT_USER_PARAMS); |
|
|
|
userParams = config.get(ScriptParamsConstants.NAME_SCRIPT_USER_PARAMS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public AlertResult sendScriptAlert(String msg) { |
|
|
|
AlertResult sendScriptAlert(String msg) { |
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
if (ScriptType.of(scriptType).equals(ScriptType.SHELL)) { |
|
|
|
if (ScriptType.of(scriptType).equals(ScriptType.SHELL)) { |
|
|
|
return executeShellScript(msg); |
|
|
|
return executeShellScript(msg); |
|
|
@ -54,7 +54,7 @@ public class ScriptSender { |
|
|
|
private AlertResult executeShellScript(String msg) { |
|
|
|
private AlertResult executeShellScript(String msg) { |
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
AlertResult alertResult = new AlertResult(); |
|
|
|
alertResult.setStatus("false"); |
|
|
|
alertResult.setStatus("false"); |
|
|
|
if (OSUtils.isWindows()) { |
|
|
|
if (Boolean.TRUE.equals(OSUtils.isWindows())) { |
|
|
|
alertResult.setMessage("shell script not support windows os"); |
|
|
|
alertResult.setMessage("shell script not support windows os"); |
|
|
|
return alertResult; |
|
|
|
return alertResult; |
|
|
|
} |
|
|
|
} |
|
|
|