This commit is contained in:
Sebastian Hildebrandt
2020-02-17 05:57:46 +01:00
18 changed files with 536 additions and 18 deletions
+2 -2
View File
@@ -1132,8 +1132,8 @@ function networkConnections(callback) {
let cmd = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
if (_freebsd || _openbsd || _netbsd) cmd = 'export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\n');
let lines = stdout.toString().split('\n');
if (!error && (lines.length > 1 || lines[0] != '')) {
lines.forEach(function (line) {
line = line.replace(/ +/g, ' ').split(' ');
if (line.length >= 7) {
+11 -3
View File
@@ -492,9 +492,17 @@ function versions(callback) {
exec('mysql -V', function (error, stdout) {
if (!error) {
let mysql = stdout.toString().split('\n')[0] || '';
mysql = (mysql.toLowerCase().split(',')[0] || '').trim();
const parts = mysql.split(' ');
result.mysql = (parts[parts.length - 1] || '').trim();
mysql = mysql.toLowerCase();
if (mysql.indexOf(',') > -1) {
mysql = (mysql.split(',')[0] || '').trim();
const parts = mysql.split(' ');
result.mysql = (parts[parts.length - 1] || '').trim();
} else {
if (mysql.indexOf(' ver ') > -1) {
mysql = mysql.split(' ver ')[1];
result.mysql = mysql.split(' ')[0];
}
}
}
functionProcessed();
});
+4 -1
View File
@@ -135,7 +135,10 @@ function services(srv, callback) {
let singleSrv = allSrv.filter(item => { return item.name === srv; });
const pids = [];
for (const p of ps) {
pids.push(p.trim().split(' ')[2]);
const pid = p.trim().split(' ')[2];
if (pid) {
pids.push(parseInt(pid, 10));
}
}
result.push({
name: srv,