Skip to content

OS

In this section you will learn how to get information about the installed operating system, versions of installed development specific software packages, shell and users online:

For function reference and examples we assume, that we imported systeminspector as follows:

const si = require('@ambicuity/systeminspector');

Operating System, Shell, Versions, Users

All functions in this section return a promise or can be called with a callback function (parameter cb in the function reference)

FunctionResult objectLinuxBSDMacWinSunComments
si.osInfo(cb)XXXXXOS information
platformXXXXX'linux', 'darwin', 'Windows', ...
distroXXXXX
releaseXXXXX
codenameXXX
kernelXXXXXkernel release - same as os.release()
archXXXXXsame as os.arch()
hostnameXXXXXsame as os.hostname()
fqdnXXXXXfully qualfied domain name
codepageXXXXOS build version
logofileXXXXXe.g. 'apple', 'debian', 'fedora', ...
serialXXXXOS/Host serial number
buildXXXOS build version
servicepackXservice pack version
uefiXXXXOS uses UEFI on startup
hypervizorXhyper-v detected (win only)
remoteSessionXruns in remote session (win only)
si.shell(cb): stringXXXXstandard shell
si.uuid(cb)XXXXXOS, hardware and MAC UUID values
osXXXXXoperating system UUID
hardwareXXXXXhardware UUID
macsXXXXXunique MAC addresses
si.versions(apps, cb)XXXXXversion information of
node and dev software packages
optional apps param (string,
comma or space seperated)
only those apps are detected
kernelXXXXXkernel version
apacheXXXXXapache version
bashXXXXXbash version
bunXXXXXbun version
denoXXXXXdeno version
dockerXXXXXdocker version
dotnetXXXXXdotnet version
fishXXXXXfish version
gccXXXXXgcc version
gitXXXXXgit version
gruntXXXXXgrunt version
gulpXXXXXgulp version
homebrewXXXXXhomebrew version
javaXXXXXjava version
mongodbXXXXXmongodb version
mysqlXXXXXmysql version
nginxXXXXXnginx version
nodeXXXXXnode version
npmXXXXXnpm version
opensslXXXXXopenssl version
perlXXXXXperl version
phpXXXXXphp version
pip3XXXXXpip3 version
pipXXXXXpip version
pm2XXXXXpm2 version
postfixXXXXXpostfix version
postgresqlXXXXXpostgresql version
powershellXXXXXpowershell version
python3XXXXXpython3 version
pythonXXXXXpython version
redisXXXXXredis version
systemOpensslXXXXXsystemOpenssl version
systemOpensslLibXXXXXsystemOpensslLib version
tscXXXXXtsc version
v8XXXXXv8 version
virtualboxXXXXXvirtualbox version
yarnXXXXXyarn version
zshXXXXXzsh version
si.users(cb)[{...}]XXXXXarray of users online
[0].userXXXXXuser name
[0].ttyXXXXXterminal
[0].dateXXXXXlogin date
[0].timeXXXXXlogin time
[0].ipXXXXip address (remote login)
[0].commandXXXXlast command or shell

Examples

Example
const si = require('@ambicuity/systeminspector');
si.osInfo().then(data => console.log(data));
json
{
  platform: 'darwin',
  distro: 'Mac OS X',
  release: '10.15.3',
  codename: 'macOS Catalina',
  kernel: '19.3.0',
  arch: 'x64',
  hostname: 'hostname.local',
  fqdn: 'hostname.local',
  codepage: 'UTF-8',
  logofile: 'apple',
  serial: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  build: '19D76',
  servicepack: '',
  uefi: true
}
Example
const si = require('@ambicuity/systeminspector');
si.uuid().then(data => console.log(data));
json
{
  os: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  hardware: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  macs: [ 'xx:xx:xx:xx:xx:xx' ]
}
Example
const si = require('@ambicuity/systeminspector');
si.versions().then(data => console.log(data));
json
{
  kernel: '23.6.0',
  apache: '2.4.62',
  bash: '3.2.57',
  bun: '1.1.21',
  deno: '2.1.4',
  docker: '26.1.1',
  dotnet: '',
  fish: '',
  gcc: '15.0.0',
  git: '2.39.3',
  grunt: '',
  gulp: '',
  homebrew: '4.4.14',
  java: '17.0.2',
  mongodb: '',
  mysql: '9.0.1',
  nginx: '',
  node: '22.12.0',
  npm: '10.9.0',
  openssl: '3.0.15+quic',
  perl: '5.34.1',
  php: '8.3.6',
  pip3: '24.2',
  pip: '20.3.4',
  pm2: '5.1.2',
  postfix: '3.2.2',
  postgresql: '16.4',
  powershell: '',
  python3: '3.12.5',
  python: '',
  redis: '',
  systemOpenssl: '3.3.1',
  systemOpensslLib: 'OpenSSL',
  tsc: '5.2.2',
  v8: '12.4.254.21-node.21',
  virtualbox: '',
  yarn: '1.22.17',
  zsh: '5.9''
}
Example 2
const si = require('@ambicuity/systeminspector');
si.versions('npm, php, postgresql').then(data => console.log(data));
json
{
  npm: '6.13.6',
  php: '7.3.11',
  postgresql: '12.1'
}
Example
const si = require('@ambicuity/systeminspector');
si.users().then(data => console.log(data));
json
[
  {
    user: 'yourname',
    tty: 'ttys006',
    date: '2020-02-01',
    time: '21:20',
    ip: '',
    command: 'w -ih'
  },
  {
    user: 'othername',
    tty: 'ttys008',
    date: '2020-02-01',
    time: '21:20',
    ip: '',
    command: '-bash'
  }
]
Inspector AI
SystemInspector AI initialized. How can I help you query your hardware?