This Java application implements a client that communicates with PHP pages via HTTP to retrieve and display SNMP data. It was developed as part of the Computer Networks 2 (10636455) course assignment at An-Najah National University.
- Three-tabbed interface for displaying different types of SNMP data:
- System Group Tab: Displays system information and allows updating of sysContact, sysName, and sysLocation values
- TCP Table Tab: Shows TCP connection information
- ICMP Statistics Tab: Displays ICMP statistics in a single table
The System Group tab displays system information and allows updating of contact, name, and location values
The TCP Connections tab displays all active TCP connections on the system
The ICMP Statistics tab displays ICMP protocol statistics in a single table
- Java Development Kit (JDK) 8 or higher
- XAMPP (or WAMP) server for PHP backend
- SNMP service enabled on the local machine
- JSON library for Java (org.json)
- Java Client Application:
Main.java: Application entry pointHttpConnection.java: Handles HTTP communication with PHP API endpointsMainFrame.java: Main application window with tabbed interfaceSystemPanel.java: Panel for displaying and updating System Group dataTcpPanel.java: Panel for displaying TCP connection tableIcmpPanel.java: Panel for displaying ICMP statistics
- PHP Backend (place in XAMPP htdocs folder):
- API Folder:
get_system.php: Returns System Group data in JSON formatupdate_system.php: Handles updates to system valuesget_tcp.php: Returns TCP Table data in JSON formatget_icmp.php: Returns ICMP Statistics in JSON format
- Pages Folder:
- Web interface HTML/PHP pages for Part 1 of the assignment
config.php: Configuration settings for SNMP connections
- API Folder:
-
Set up XAMPP:
- Install XAMPP if not already installed
- Copy the project files to
C:\xampp\htdocs\snmp_manager\directory - Start Apache server in XAMPP Control Panel
-
Enable SNMP Service (Windows):
- Go to Control Panel > Programs > Turn Windows features on or off
- Check "Simple Network Management Protocol (SNMP)" and install
- Open Services (services.msc)
- Find SNMP Service and go to Properties > Security
- Add "public" community with READ permissions
- Add "private" community with READ/WRITE permissions
- Restart the SNMP service
-
Run the Java Application:
- Make sure the org.json library is in your classpath
- Compile and run the application using your preferred Java IDE
- The application will communicate with the PHP API endpoints to retrieve and display SNMP data
- System Group Tab:
- Click "Get System Data" to retrieve the system information
- Enter new values in the text fields and click the corresponding update buttons to modify system values
- TCP Table Tab:
- Click "Get TCP Table" to view the current TCP connections
- ICMP Statistics Tab:
- Click "Get ICMP Statistics" to view ICMP statistics
- Run commands like
ping www.google.comortracert www.amazon.comto see changes in ICMP statistics
- The Java client communicates with PHP API endpoints using HTTP requests
- The PHP API endpoints communicate with the SNMP agent using PHP's SNMP extension
- Data is exchanged in JSON format between the Java client and PHP API
- The application demonstrates both GET and SET operations using SNMP
- SNMP_Manager Web Interface - The web interface implementation (Part 1 of the assignment)
- The application requires a properly configured SNMP service on the local machine
- Community strings must be set correctly for read and write access
- Make sure XAMPP's Apache server is running before using the application
- For ICMP statistics, the Java client displays a single table as required by Part 2 of the assignment, while the PHP web interface displays two tables (Get and Walk methods)
- Yazan Al-Sedih
- Computer Engineering Department
- An-Najah National University
- Spring 2025


