fixed agent id not being passed

This commit is contained in:
redanthrax 2022-06-24 13:26:40 -07:00
parent 3ad15a68e2
commit b21bd64663

View file

@ -159,6 +159,7 @@ func (a *Agent) RunChecks(force bool) error {
type ScriptCheckResult struct { type ScriptCheckResult struct {
ID int `json:"id"` ID int `json:"id"`
AgentID string `json:"agent_id"`
Stdout string `json:"stdout"` Stdout string `json:"stdout"`
Stderr string `json:"stderr"` Stderr string `json:"stderr"`
Retcode int `json:"retcode"` Retcode int `json:"retcode"`
@ -176,6 +177,7 @@ func (a *Agent) ScriptCheck(data rmm.Check, r *resty.Client) {
Stderr: stderr, Stderr: stderr,
Retcode: retcode, Retcode: retcode,
Runtime: time.Since(start).Seconds(), Runtime: time.Since(start).Seconds(),
AgentID: a.AgentID,
} }
_, err := r.R().SetBody(payload).Patch("/api/v3/checkrunner/") _, err := r.R().SetBody(payload).Patch("/api/v3/checkrunner/")