diff --git a/lib/network.js b/lib/network.js index 1cb1465..ea0cf50 100644 --- a/lib/network.js +++ b/lib/network.js @@ -1679,12 +1679,22 @@ function networkConnections(callback) { let pid = null; let process = ''; if (line.length >= 7 && line[6].indexOf('users:') > -1) { - const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); + const proc = line[6].replace('users:(("', '').replace(/"/g, '').replace('pid=', '').split(','); if (proc.length > 2) { - process = proc[0].split(' ')[0].split(':')[0]; - pid = parseInt(proc[1], 10); + process = proc[0]; + const pidValue = parseInt(proc[1], 10); + if (pidValue > 0) { + pid = pidValue; + } } } + // if (line.length >= 7 && line[6].indexOf('users:') > -1) { + // const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); + // if (proc.length > 2) { + // process = proc[0].split(' ')[0].split(':')[0]; + // pid = parseInt(proc[1], 10); + // } + // } if (connstate) { result.push({ protocol: line[0],