NetMonitor is a lightweight and efficient network monitoring tool built using C and the ncurses library. This project provides a terminal-based interface for tracking network connections, bandwidth usage, and traffic rates in real-time.
-
Real-Time Monitoring:
- View active TCP, UDP, and ICMP connections.
- Monitor transmitted and received data for a selected network interface.
- Track live traffic rates (RX/TX) and total bandwidth usage.
-
Interactive UI:
- Terminal-based UI using
ncurses. - Dynamic resizing to adapt to your terminal size.
- Intuitive navigation through active network connections.
- Terminal-based UI using
-
Cross-Platform Compatibility:
- Designed to work on Linux systems using
/procand/sysdirectories.
- Designed to work on Linux systems using
Ensure your system meets the following requirements:
- GCC (GNU Compiler Collection)
makencursesdevelopment libraries- Linux-based OS with access to
/procand/sysdirectories
To install the necessary dependencies on Debian/Ubuntu, use:
sudo apt update
sudo apt install build-essential libncurses5-dev libncursesw5-dev-
Clone the repository:
git clone https://github.com/mariusel9911/SO2_PROIECT.git cd SO2_PROIECT -
Build the project using
make:make
-
Run the application:
./NetMonitor
-
Interface Selection:
- Use arrow keys to navigate the list of network interfaces.
- Press
Enterto select an interface. - Press
Qto quit the interface selection.
-
Connection Table:
- View detailed information about active connections, including:
- Local Address and Port
- Foreign Address and Port
- Protocol (TCP, UDP, ICMP)
- Bytes transferred
- Data rate (in Kbps)
- View detailed information about active connections, including:
-
Footer Stats:
- Monitor total RX (received), TX (transmitted), and combined traffic.
↑/↓: Navigate through the connection table.Q: Exit the application.
NetMonitor.c: The main program, handling initialization, signal handling, and the application loop.ui.c: Functions for drawing and updating the UI, including tables and footers.ipSearch_v1.c: Functions to parse/proc/netfor active connections and retrieve interface statistics from/sys/class/net.
ui.h: UI-related declarations.ipSearch_v1.h: Network-related declarations and data structures.
- Automates the build process.
- Supports
makeandmake clean.
all(default): Compiles the project.clean: Removes compiled binaries.
Below is an example of the application's interface:
+---------------------------+----------------------+-------+----------+--------+
| Local Address | Foreign Address | Bytes | Protocol | Rate |
+---------------------------+----------------------+-------+----------+--------+
| 127.0.0.1:631 | 0.0.0.0:0 | 0 B | TCP | 0.00 Kbps |
| 127.0.0.1:25 | 0.0.0.0:0 | 0 B | TCP | 0.00 Kbps |
| 10.0.2.15:59648 | 146.75.122.132:80 | 0 B | TCP | 0.00 Kbps |
| 10.0.2.15:59644 | 146.75.122.132:80 | 0 B | TCP | 0.00 Kbps |
| 10.0.2.15:43008 | 13.107.246.44:443 | 0 B | TCP | 0.00 Kbps |
| 10.0.2.15:68 | 10.0.2.2:67 | 0 B | UDP | 0.00 Kbps |
| 0.0.0.0:51771 | 0.0.0.0:0 | 0 B | UDP | 0.00 Kbps |
| 0.0.0.0:5353 | 0.0.0.0:0 | 0 B | UDP | 0.00 Kbps |
+---------------------------+----------------------+-------+----------+--------+
RX: 180.00 B 1.04 kbps Interface: enp0s3
TX: 198.00 B 1.15 kbps
Total: 378.00 B PRESS Q TO EXIT...
We welcome contributions! If you have ideas for improvements or find a bug, feel free to:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a clear description.
- NCurses Documentation
- Linux
/procand/sysdocumentation - Open-source contributors for their support and inspiration.
- mariusel9911
- paulescufilip
- GitHub: https://github.com/mariusel9911
Feel free to reach out for collaboration or any questions regarding the project!
Thank you for using NetMonitor! 🚀