adding docker
System information and monitoring for local and remote macOS and Ubuntu servers
Systemator is made of three separate components
NIO
SystemManager
SystemController
Systemator
brew tap einstore/homebrew-tap brew install systemator systemator
To define a custom port or host do
systemator --hostname 0.0.0.0 --port 12345
or …
http://127.0.0.1:8080/info
Integrate SystemController.Controller in your routes method
SystemController.Controller
import Vapor import SystemController /// Register your application's routes here. public func routes(_ r: Routes, _ c: Container) throws { try Controller().routes(r, c) }
SystemController will give you two endpoints
[GET] /info
[POST] /info
The output should look somehow like this:
{ "cpu": { "clock": 2900000000, "cores": 4, "logicalCpu": 8 }, "usage": { "hdd": [ { "size": 1000240963584, "use": 3, "filesystem": "/dev/disk1s1", "mounted": "/", "available": 442482974720, "used": 10488909824 }, ... { "size": 1000240963584, "use": 55, "filesystem": "/dev/disk1s5", "mounted": "/System/Volumes/Data", "available": 442482974720, "used": 540546445312 } ], "memory": { "total": 67108864, "free": 103, "used": 67108761 }, "cpu": { "system": 19.670000000000002, "user": 22.420000000000002, "idle": 57.890000000000001 }, "processes": [] } }
All data should be in units, bytes or percentages where it makes sense
For remote connection you will need to POST connection details in the body of the request and make sure the Content-Type is set to application/json
POST
Content-Type
application/json
{ "host": "172.16.217.131", "port": 22, "login": "pro", "password": "aaaaaa" }
Please don’t connect to the IP, it’s a real server!!!
Through SystemManager library you can access monitoring from any Swift server side app that can support Apple NIO version 2
The basic usage is:
let eventLoop = EmbeddedEventLoop() let manager = try SystemManager( .ssh( host: "ippppp", port: 22, username: "root", password: "sup3rS3cr3t" ), on: eventLoop ) let output = try manager.info().wait()
Ondrej Rafaj - @rafiki270 Did your try to connect to my server?!?! :D
MIT; Copyright 2019 - Einstore
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Systemator
System information and monitoring for local and remote macOS and Ubuntu servers
Overview
Systemator is made of three separate components
NIO
apps calledSystemManager
SystemController
which is built on the top of Vapor framework and gives you two ready to go endpointsSystemator
which will launch a full Vapor app and makes it’s API’s availableRun whole monitoring app on it’s own!
To define a custom port or host do
or …
Systemator
in Xcode and run!http://127.0.0.1:8080/info
Integrate endpoints in an Vapor 4 app
Integrate
SystemController.Controller
in your routes methodEndpoints
SystemController
will give you two endpoints[GET] /info
- for a local system monitoring[POST] /info
- for a remote system monitoringThe output should look somehow like this:
For remote connection you will need to
POST
connection details in the body of the request and make sure theContent-Type
is set toapplication/json
Swift level API
Through
SystemManager
library you can access monitoring from any Swift server side app that can support AppleNIO
version 2The basic usage is:
Author
Ondrej Rafaj - @rafiki270 Did your try to connect to my server?!?! :D
License
MIT; Copyright 2019 - Einstore