This project is a server monitoring dashboard that collects and displays various system metrics. It is built using Go for the backend and React with TypeScript for the frontend. The project includes the following key components:
- Agent: Collects system metrics and sends them to the central server through Apache Kafka.
- Backend: Collects system metrics such as CPU usage, memory usage, disk usage, network statistics, and system information.
- Frontend: Displays the collected metrics in a user-friendly dashboard.
- CPU Metrics: Collects context switches, interrupts, and load averages.
- Disk Usage: Displays total, free, used space, and used percentage.
- Network Info: Shows network interface statistics including bytes sent/received, packets sent/received, errors, and drops.
- System Info: Provides details about the host such as hostname, OS, platform version, kernel version, uptime, and boot time.
- Process Monitoring: Lists top processes by CPU and memory usage.
- Temperature Monitoring: Reads system temperatures from thermal zones.
- goServerAgent/CollectMetrics.go: This file contains the logic for collecting various system metrics using the gopsutil library. It gathers CPU times, context switches, interrupts, load averages, disk usage, network information, and system information.
- go.mod: The Go module file that defines the module path and lists the dependencies required for the project.
- backend/: This directory contains the backend code responsible for receiving metrics from the agent, storing them in the database, and serving them to the frontend
- go.mod: The Go module file that defines the module path and lists the dependencies required for the project.
- server-monitor-dashboard/: This directory contains the frontend code for the server monitoring dashboard.
- package.json: Defines the dependencies and scripts for the frontend project.
- src/: Contains the source code for the React application.
- components/: Contains React components used in the application.
- App.tsx: The main application component.
- index.tsx: The entry point for the React application.
- Go 1.16 or later
- Node.js and npm
- lm-sensors (for temperature monitoring on Linux)
-
Clone the repository:
git clone https://github.com/Niladri2003/server-monitor.git cd server-monitor-dashboard -
Backend Setup:
- Navigate to the
goServerAgentdirectory:cd goServerAgent - Install dependencies:
go mod tidy
- Run the server:
go run main.go
- Navigate to the
-
Frontend Setup:
- Navigate to the
clientdirectory:cd ../client - Install dependencies:
npm install
- Start the development server:
npm start
- Navigate to the
- The backend server will start collecting metrics and expose them via an API.
- The frontend React application will display the collected metrics in a user-friendly dashboard.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License.