Skip to content

Get your current systemd services status

License

Notifications You must be signed in to change notification settings

ZimGil/systemd-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

systemd-status

Get your current systemd service status

Installation

npm install systemd-status

Note: as systemd only available on Linux, it can only be installed on Linux machines.
If still wish to install it (for development reasons) use --force

Usage

You can use the systemdStatus function to get the status of either a single or multiple services.

Getting a single service status

const systemdStatus = require('systemd-status');

const plexStatus = systemdStatus('plexmediaserver');
// {
//   name: 'plexmediaserver',
//   isActive: true,
//   state: 'running',
//   timestamp: '2020-06-02T13:21:51.716Z',
//   isDisabled: false
// }

Getting multiple services status

const systemdStatus = require('systemd-status');

const currentStatus = systemdStatus(['plexmediaserver', 'smbd', 'pihole-FTL']);
// [
//   {
//     name: 'plexmediaserver',
//     isActive: true,
//     state: 'running',
//     timestamp: '2020-06-02T13:21:51.716Z',
//     isDisabled: false
//   },
//   {
//     name: 'smbd',
//     isActive: false,
//     state: 'dead',
//     timestamp: null,
//     isDisabled: true
//   }
//   {
//     name: 'pihole-FTL',
//     isActive: true,
//     state: 'exited',
//     timestamp: '2020-06-02T13:21:51.716Z',
//     isDisabled: false
//   }
// ]

About

Get your current systemd services status

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published