Wake up, shut down and monitor computers from STEM.
computer-management knows the computers in the network, checks every two seconds whether they are online and can wake them with Wake-on-LAN or shut them down via SSH, from the STEM console or through web-api.
- Online status (
ONLINE,OFFLINE,UNKNOWN) of every computer, checked every 2 seconds - Wake-on-LAN with
etherwake(the MAC address is validated before it is passed to the shell) - Shutdown via SSH for Windows (
shutdown -s -f -t 5) and Linux (shutdown -h now) - Console command and web endpoints
| Requirement | Version |
|---|---|
| STEM | 1.2.0 or newer (stem-api) |
| Plugins | web-api |
| Host | etherwake on the STEM host; SSH key login from STEM to every computer |
- Build the plugin with
mvn clean package(or take the build from Jenkins). - Copy
target/computer-management.jarinto thepluginsfolder of STEM. - Start STEM once. The plugin creates
plugins/computer-management/devices/example.yml. - Add one file per computer and restart STEM (plugins are only loaded at startup).
One file per computer in plugins/computer-management/devices/ (example.yml is ignored):
device:
name: workstation # name used in commands and web requests (case insensitive)
osType: WINDOWS # WINDOWS or LINUX
macAddress: "AA:BB:CC:DD:EE:FF"
staticIP: 10.0.0.50
staticSSHPort: 22
staticSSHUser: admin| Command | Description |
|---|---|
computer status <name> |
Shows the online status |
computer wakeup <name> |
Sends a Wake-on-LAN packet |
computer shutdown <name> |
Shuts the computer down via SSH |
All requests are POST with a JSON body.
| Path | Body | Result |
|---|---|---|
/computermanagement/status |
{"computerName": "workstation", "requestAction": "READ"} |
{"state": "ONLINE", ...} |
/computermanagement/wakeup |
{"computerName": "workstation", "requestAction": "WRITE"} |
sends Wake-on-LAN |
/computermanagement/shutdown |
{"computerName": "workstation", "requestAction": "WRITE"} |
shuts the computer down |
An unknown computer name returns apiError: true.
Copyright (c) MirraNET, Niklas Linz. Licensed under the GNU Lesser General Public License v3.0.
