Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #255 from DataDog/db/fix_process_name
Browse files Browse the repository at this point in the history
[windows] fix process name.  On some system processes, WMI doesn't
  • Loading branch information
shang-wang committed Feb 22, 2019
2 parents e03b502 + 75c115b commit 61436b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion checks/allprocesses_windows.go
Expand Up @@ -398,9 +398,15 @@ func (cp *cachedProcess) fill(proc *Win32_Process) (err error) {
cp.userName, err = getUsernameForProcess(cp.procHandle)
if err != nil {
log.Infof("Couldn't get process username %v %v", proc.ProcessID, err)
return err
}
cp.executablePath = *proc.ExecutablePath
if len(cp.executablePath) == 0 {
// some system processes don't give us the executable path variable. Just
// give the executable name

cp.executablePath = proc.Name
log.Debugf("Setting alternate executable path (name) %d %s", proc.ProcessID, cp.executablePath)
}
cp.commandLine = *proc.CommandLine
var parsedargs []string
if len(cp.commandLine) == 0 {
Expand Down

0 comments on commit 61436b0

Please sign in to comment.