From 265d0f208bcf3691b5fd3ad2d1c3637bcb1849f5 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 1 Jul 2019 16:57:50 +0200 Subject: [PATCH] networkConnections() added PID, process --- CHANGELOG.md | 1 + README.md | 10 +++------- docs/history.html | 5 +++++ docs/index.html | 4 ++-- docs/network.html | 20 ++++++++++++++++++++ lib/network.js | 2 +- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ba48c..9589fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.13.0 | 2019-07-01 | `networkConnections()` added PID and process | | 4.12.2 | 2019-06-24 | `system()` added Raspberry PI 4 detection | | 4.12.1 | 2019-06-24 | `networkInterface()` virtual interfaces macos, `networkInterfaceDefault()` | | 4.12.0 | 2019-06-21 | `networkInterface()` added property virtual | diff --git a/README.md b/README.md index bf15a53..68ab79b 100644 --- a/README.md +++ b/README.md @@ -84,19 +84,13 @@ si.cpu() (last 7 major and minor version releases) +- Version 4.13.0: `networkConnections()` added PID, process - Version 4.12.0: `networkInterfaces()` added property virtual - Version 4.11.0: `wifiNetworks()` added available wifi networks - Version 4.10.0: `graphics()` added windows multiple display support, added display size, connection, ... - Version 4.9.0: `graphics()` added vendor, refresh rate, current resolution - Version 4.8.0: added `vboxInfo()` detailed virtual box info - Version 4.7.0: partial NetBSD support -- Version 4.6.0: added `dockerInfo()` -- Version 4.5.0: `fsOpenFiles()` added open file descriptor count -- Version 4.4.0: `dockerContainers()` added started, finished time -- Version 4.3.0: `dockerContainers()` `dockerStats()` added restartCount -- Version 4.2.0: `networkInterfaceDefault()` time delay fix (linux) -- Version 4.1.0: `versions()` added python3, pip, pip3, java -- Version 4.0.0: new version ... read the [detailed changelog][changelog-url] to see all breaking changes - ... You can find all changes here: [detailed changelog][changelog-url] @@ -453,6 +447,8 @@ I also created a nice little command line tool called [mmon][mmon-github-url] ( | | [0].peeraddress | X | X | X | X | | peer address | | | [0].peerport | X | X | X | X | | peer port | | | [0].state | X | X | X | X | | like ESTABLISHED, TIME_WAIT, ... | +| | [0].pid | X | X | X | X | | process ID | +| | [0].process | X | X | | | | process name | | si.inetChecksite(url, cb) | {...} | X | X | X | X | X | response-time (ms) to fetch given URL | | | url | X | X | X | X | X | given url | | | ok | X | X | X | X | X | status code OK (2xx, 3xx) | diff --git a/docs/history.html b/docs/history.html index 8f3744f..95facc0 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.13.0 + 2019-07-01 + networkConnections() added PID, process + 4.12.2 2019-06-24 diff --git a/docs/index.html b/docs/index.html index a87eb8c..d36a225 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.12.2
+
Current Version: 4.13.0
@@ -199,7 +199,7 @@
Downloads last month
-
164
+
167
Dependends
diff --git a/docs/network.html b/docs/network.html index c6a34e5..a55f65c 100644 --- a/docs/network.html +++ b/docs/network.html @@ -405,6 +405,26 @@ like ESTABLISHED, TIME_WAIT, ... + + + [0].pid + X + X + X + X + + process ID + + + + [0].process + X + X + + + + process name +

Site availability, Internet Latency

diff --git a/lib/network.js b/lib/network.js index e673fa9..7357edd 100644 --- a/lib/network.js +++ b/lib/network.js @@ -855,7 +855,7 @@ function networkConnections(callback) { let pid = -1; let process = ''; if (line.length >= 7 && line[6].indexOf('users:') > -1) { - let proc = line[6].replace('users:(("', '').replace('"', '').split(','); + let proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); if (proc.length > 2) { process = proc[0].split(' ')[0]; pid = parseInt(proc[1], 10);