A multi-component system for monitoring CPU activity over TCP/UDP sockets, built as a college networking project. Includes:
- A Java TCP server
- A Java CPU info sender (UDP)
- A PHP bridge layer executing JARs
- A JavaScript web interface for visualization
This project demonstrates socket programming, multi-process communication, and basic system information retrieval.
This project was developed as part of a university networking assignment. The architecture reflects the requirements and constraints of the course (Java for sockets, PHP for web integration). The focus is on network protocols, process coordination, and CPU usage retrieval, not on modern frameworks.
-
Java TCP Server Handles commands from clients and returns system information.
-
Java CPU Data Sender (UDP) Sends continuous CPU usage packets over UDP to a specified IP. Triggered by TCP command
"PRINTCORE". -
PHP Backend Executes Java JAR files and forwards results to the JS frontend.
-
JavaScript Frontend Displays CPU usage and system information in a web-based UI.
- Print CPU info
- Monitor cores
- Request system information
- Stream CPU core metrics via UDP
| Command | Description |
|---|---|
CHK |
Health-check → returns ACK |
SYSINFO |
Returns system info |
CPUINFO |
Returns CPU specs |
PRINTCORES |
Returns logical core list |
PRINTCORE |
Starts UDP sender thread |
STOP |
Stops the data sender |
- TCP for control messages
- UDP for high-frequency CPU usage streaming
- PHP bridging execution
- JS frontend visualizing metrics
(You can add a PNG later)
+------------+ http +-----------------+
| Web (JS) | <---------------> | PHP Backend |
+------------+ +-------+----------+
|
| exec()
v
+-----------+
| Java JAR |
| (Client) |
+-----+-----+
|
TCP/UDP |
v
+-----------+
| Java TCP |
| Server |
+-----------+
This project includes precompiled binaries in the Releases tab, so users do not need to compile Java or install dependencies manually.
Below is the correct way to run each component of the monitoring system.
This is the application that runs on the machine being monitored. It collects CPU information and communicates with the server.
- Download the release ZIP.
- Extract it.
- Inside the extracted folder, locate:
MonitoringSystem.bat
MonitoringSystem.jar
MonitoringSystem_lib/
- Double–click
MonitoringSystem.batOR run:
MonitoringSystem.bat
- The client will connect to the monitoring server and start reporting CPU metrics.
MonitoringSystem.jar— Java application that retrieves system infoMonitoringSystem_lib/— contains Sigar dependencies for CPU/OS statsMonitoringSystem.bat— convenience launcher that sets up classpath automatically
Place the executables inside the web-client/executables/ directory:
web-client/
├── index.php
├── home.php
├── functions.php
├── CPU/
├── Assets/
└── executables/
├── PacketReceiver.jar
└── TCPClient.jar
PacketReceiver.jar # receives UDP CPU packets
TCPClient.jar # sends TCP commands to target machine
- Load the php and open index.php
- The JS frontend will call the PHP backend
- PHP will execute the JAR files to request data from the server
-
Start the Monitoring System on the machine to be monitored
-
Place PacketReceiver.jar and TCPClient.jar into
web-client/executables/ -
Set up the PHP Server and open index.php
-
Put the IP address and Press
Start Monitoring. The system will display the system information -
Click the
📊 CPUIcon to see all the cores CPU usage in real time
cpu-monitoring-system/
│
├── server-java/
│ └── source of TCP server
├── client-java/
│ └── UDP CPU sender
├── web-client/
│ └── PHP bridge layer and Web interface
├── docs/
└── README.md
- Replace PHP exec() with a proper API
- Merge TCP + UDP into a unified protocol




