versions() added docker, postfix

This commit is contained in:
Sebastian Hildebrandt 2018-11-06 20:21:57 +01:00
parent 2531bcb1aa
commit 342c621fa1
3 changed files with 22 additions and 4 deletions

View File

@ -100,6 +100,7 @@ Other changes
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 3.47.0 | 2018-11-06 | `versions()` added docker, postfix |
| 3.46.0 | 2018-11-05 | fixed issue `versions()`, added system openssl version |
| 3.45.10 | 2018-11-03 | fixed issue `battery()`, modified `package.json` - files |
| 3.45.9 | 2018-10-22 | fixed node 4 incompatibility |

View File

@ -59,13 +59,13 @@ async function cpu() {
(last 7 major and minor version releases)
- Version 3.46.0: `version()` added system openssl version (besides the one insode node.js)
- Version 3.47.0: `version()` added docker, postfix)
- Version 3.46.0: `version()` added system openssl version (besides the one inside node.js)
- Version 3.45.0: `diskLayout()` added S.M.A.R.T. status
- Version 3.44.0: `battery()` added type, model, manufacturer, serial, timeremaining
- Version 3.43.0: added speed per CPU core `cpuCurrentspeed()`
- Version 3.42.0: added parent process PID `processes()`
- Version 3.41.0: first partial `SunOS` support
- Version 3.40.0: extended `versions()` (php, redis, mongodb)
- ...
You can find all changes here: [detailed changelog][changelog-url]

View File

@ -291,11 +291,13 @@ function versions(callback) {
redis: '',
mongodb: '',
nginx: '',
php: ''
php: '',
docker: '',
postfix: ''
};
let functionProcessed = (function () {
let totalFunctions = 14;
let totalFunctions = 16;
return function () {
if (--totalFunctions === 0) {
if (callback) {
@ -425,6 +427,21 @@ function versions(callback) {
}
functionProcessed();
});
exec('docker --version', function (error, stdout) {
if (!error) {
const docker = stdout.toString().split('\n')[0] || '';
const parts = docker.split(' ');
result.docker = parts.length > 2 && parts[2].endsWith(',') ? parts[2].slice(0, -1) : '';
}
functionProcessed();
});
exec('postconf -d | grep mail_version', function (error, stdout) {
if (!error) {
const postfix = stdout.toString().split('\n') || [];
result.postfix = util.getValue(postfix, 'mail_version', '=', true);
}
functionProcessed();
});
exec('mongod --version', function (error, stdout) {
if (!error) {
result.mongodb = stdout.toString().split('\n')[0] || '';