A distributed monitoring system where agents (users) connect to a central manager (admin) over TCP, REST API, or real-time Socket.IO connections. Agents monitor for events, send alerts, and execute commands received from the central manager.
The Socket.IO implementation provides instant bidirectional communication between agents (users) and the central manager (admin) through WebSocket connections with automatic fallback to HTTP long-polling.
- Room-based Organization: Agents are organized into separate monitoring rooms
- Room Isolation: Each room operates independently with its own set of users and administrator
- Scalable Architecture: Support for multiple concurrent rooms with isolated communication channels
(Simplified setup without user authentication barriers)
- Individual User Communication: Select and chat privately with specific users in the room
- Send messages to all users in the room simultaneously
- Real-time User Monitoring:
- View online/offline status of all room members
- Monitor live system metrics (CPU, RAM, disk usage)
- Receive automated alerts when user system resources exceed 70% threshold
- Direct Admin Communication: Send private messages to room administrator
- Room Broadcasting: Send messages visible to all room members
- Connects to the central manager over TCP.
- Monitors for events and sends alerts to the central manager.
- Executes commands received from the central manager and sends back the results.
- Handles chunked data and reconnects if the connection is lost.
- Listens for agent connections over TCP.
- Tracks active agents using their unique IDs.
- Sends commands to specific agents.
- Receives alerts and command execution results from agents.
- Handles chunked data.
- Node.js (v14 or higher)
- NPM (Node Package Manager)
Clone the project repository to your local machine or VMs.
git clone https://github.com/1mimhe/monitoring-app
cd monitoring-app/Realtime
Run the following command to install the required dependencies.
npm install
Set PORT
environment variable.
npm run dev
Open your web browser and navigate to:
localhost:PORT/
This opens the user panel where agents can join rooms and communicate with administrators.
Open your web browser and navigate to:
localhost:PORT/admin.html
This opens the administrative panel for room management and user monitoring.
Clone the project repository to your local machine or VMs.
git clone https://github.com/1mimhe/monitoring-app
cd monitoring-app/Socket
Run the following command in both the agent and central manager folders to install the required dependencies.
npm install
Set the following environment variables:
In Central-Manager:
- CENTRAL_MANAGER_UDP_ADDRESS
- CENTRAL_MANAGER_UDP_PORT
- AGENTS
In Agents:
- AGENT_TCP_ADDRESS
- AGENT_TCP_PORT
Good Luck