StatsMonit is a lightweight server monitoring tool built with Node.js and Socket.io. It provides real-time system statistics, including CPU usage, RAM usage, disk space, network activity, and uptime.
- Real-time Monitoring: Get live updates every 3 seconds.
- CPU Usage: Shows CPU load percentage and model details.
- Memory Usage: Displays RAM consumption with detailed usage statistics.
- Temperature: Displays CPU temperature in real-time
- Disk Statistics: Provides total, used, and available disk space.
- Network Traffic: Monitors incoming and outgoing network activity.
- Cross-platform: Works on Linux, Windows, and macOS.
- Node.js (v18 or higher)
- NPM (comes with Node.js)
- g++ (to compile some packages)
- cmake (to compile some packages)
-
Clone this repository:
git clone https://github.com/cabrata/statsmonit
-
Navigate into the project folder:
cd statsmonit
-
Install dependencies:
npm install
-
(Optional) Configure environment variables: Create a
.env
file and specify the port (default:8088
).PORT=8088
Run the following command to start the monitoring service:
npm start
or manually using:
node index.js
Once the server is running, open your browser and visit:
http://localhost:8088
The server will continuously send system statistics to the client using WebSockets (Socket.io).
-
Server Setup
- Uses Express.js to serve static files.
- Runs an HTTP server with Socket.io for real-time communication.
-
Data Collection
- Uses OS module to fetch CPU, RAM, and system details.
- Uses diskusage to check disk space.
- Uses systeminformation to get CPU temperature data
- Uses node-os-utils to fetch CPU and network statistics.
-
Real-time Updates
- The server collects system stats every 3 seconds.
- Data is sent to connected clients via WebSockets.
If you are using Tailwind CSS for styling, you can compile the CSS using:
npm run build
This will generate a minified CSS file for production.
Contributions are welcome! Feel free to open an issue or submit a pull request if you find any improvements or bugs.
This project is licensed under the MIT License.