add env for script checks
This commit is contained in:
parent
3cb6b92a80
commit
524837627f
@ -169,7 +169,7 @@ type ScriptCheckResult struct {
|
|||||||
// ScriptCheck runs either bat, powershell or python script
|
// ScriptCheck runs either bat, powershell or python script
|
||||||
func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) {
|
func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.Script.EnvVars)
|
stdout, stderr, retcode, _ := a.RunScript(data.Script.Code, data.Script.Shell, data.ScriptArgs, data.Timeout, data.Script.RunAsUser, data.EnvVars)
|
||||||
|
|
||||||
payload := ScriptCheckResult{
|
payload := ScriptCheckResult{
|
||||||
ID: data.CheckPK,
|
ID: data.CheckPK,
|
||||||
|
@ -163,6 +163,7 @@ type Check struct {
|
|||||||
Disk string `json:"disk"`
|
Disk string `json:"disk"`
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
ScriptArgs []string `json:"script_args"`
|
ScriptArgs []string `json:"script_args"`
|
||||||
|
EnvVars []string `json:"env_vars"`
|
||||||
Timeout int `json:"timeout"`
|
Timeout int `json:"timeout"`
|
||||||
ServiceName string `json:"svc_name"`
|
ServiceName string `json:"svc_name"`
|
||||||
PassStartPending bool `json:"pass_if_start_pending"`
|
PassStartPending bool `json:"pass_if_start_pending"`
|
||||||
|
Loading…
Reference in New Issue
Block a user