Forum Discussion
mnagel
3 years agoProfessor
LinuxNewProcesses does not require the PID in the wildvalue, at least I see nowhere in the code it would be used as in input parameter (nor should that ever be needed -- that would be super fragile). It requires (in the current buggy version) the full process path AND the process arguments (the latter is the bug -- code should hopefully be fixed in the repo soon as I did receive confirmation from support they were able to see the problem). If you want to fix it locally in the meantime, the impacted code is in the run() method (changes highlighted with >>> prefixes.
static run(String hostname, String processName, out) { def startTime = new Date().getTime() def processArg = processName.tokenize( \"||\") >>> def processParam; def processPath = processArg[0] if(processArg.size() == 2) { processParam = processArg[1] } // Get all of the data at the same time to minimize def processPaths = Snmp.walkAsMap(hostname, OID_NAME, null, 20000) def processParams = Snmp.walkAsMap(hostname, OID_PARAM, null, 20000) List<String> cpuValues List<String> memValues List<String> statusValues List<String> pids = []; processPaths.each { pid, name -> >>> if((name == processPath) && (processParam == null || processParams[pid] == processParam)) { pids << pid } }
Related Content
- 11 months ago
- 8 months ago
- 7 months ago
- 11 months ago