Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments to shutdown event log #52

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (a *Agent) RunRPC() {
ret.Encode("ok")
msg.Respond(resp)
if runtime.GOOS == "windows" {
CMD("shutdown.exe", []string{"/s", "/t", "5", "/f"}, 15, false)
CMD("shutdown.exe", []string{"/s", "/t", "5", "/f", "/c", "Shutdown initiated by RMM agent.", "/d", "e:0:0" }, 15, false)
} else {
opts := a.NewCMDOpts()
opts.Command = "shutdown -h now"
Expand All @@ -365,7 +365,7 @@ func (a *Agent) RunRPC() {
ret.Encode("ok")
msg.Respond(resp)
if runtime.GOOS == "windows" {
CMD("shutdown.exe", []string{"/r", "/t", "5", "/f"}, 15, false)
CMD("shutdown.exe", []string{"/r", "/t", "5", "/f", "/c", "Reboot initiated by RMM agent.", "/d", "e:0:0" }, 15, false)
} else {
opts := a.NewCMDOpts()
opts.Command = "reboot"
Expand Down
2 changes: 1 addition & 1 deletion agent/tasks_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (a *Agent) CreateSchedTask(st SchedTask) (bool, error) {
case "schedreboot":
path = "shutdown.exe"
workdir = filepath.Join(os.Getenv("SYSTEMROOT"), "System32")
args = "/r /t 5 /f"
args = `/r /t 5 /f /c "Reboot scheduled by RMM agent." /d p:0:0`
case "custom":
path = st.Path
workdir = st.WorkDir
Expand Down