simple-ws-monitor is a monitoring app runs on Node
.
It is aimed to periodically send various information
about the system to the users such as CPU
and RAM
usage.
const Monitor = require("simple-ws-monitor");
const PORT = 8000;
const monitoringService = new Monitor({
port: 8000,
cpu: true,
ram: true,
});
const PORT = 8000;
const monitoringService = new WebSocket(`ws://localhost:${PORT}`);
monitoringService.onerror = (e) => console.log(e);
monitoringService.onmessage = (msg) => console.log(JSON.parse(msg));
{
Header: "Monitoring",
Payload: {
cpu: {
count: "4",
usage: "1.25",
},
ram: {
total: "16.4",
usage: "41.30",
}
}
}
npm i simple-ws-monitor
const Monitor = require("simple-ws-monitor");
const monitoringService = new Monitor({
port: 8000,
cpu: true,
ram: true,
});
simple-monitor is now ready and waiting for connections.
git clone https://github.com/yasinosman/simple-ws-monitor
cd simple-ws-monitor
npm install
npm run dev
Feel free to create issues or create pull requests.