This project monitors SNMP data and stores it in an SQLite database. The collected data is served via a Flask app and can be visualized using Prometheus and Grafana.
- Docker
- Docker Compose
- GitHub Personal Access Token (PAT) with the necessary permissions (
write:packages
,read:packages
,repo
)
vpn-snmp-monitoring/
├── .github/
│ ├── workflows/
│ │ ├── ci.yml
│ │ └── cd.yml
├── scripts/
│ ├── snmp_query.py
├── webapp/
│ ├── Dockerfile
│ └── ...
├── docker-compose.yml
└── README.md
Add the following secrets to your GitHub repository:
GHCR_PAT
: Your Personal Access Token for the GitHub Container Registry.
Ensure your docker-compose.yml
is properly configured to include services for your Flask app, Prometheus, Node Exporter, and Grafana.
I have set up two GitHub Actions workflows:
- Checks out the code.
- Sets up Python.
- Installs dependencies.
- Runs linting and tests using flake8 and pytest.
- Checks out the code.
- Sets up Docker Buildx.
- Logs in to GitHub Container Registry.
- Builds and pushes the Docker image to the registry.
- Deploys the services using Docker Compose.
- Clone the Repository:
git clone https://github.com/emacs45/vpn-snmp-monitoring.git
cd vpn-snmp-monitoring
- Set Up Docker Compose:
Ensure that your docker-compose.yml is configured correctly.
Run the Application:
docker-compose up -d
-
Available services:
- Grafana UI: http://localhost:3000 with default credentials
admin/admin
- Prometheus UI: http://localhost:9090
- Node Exporter Metrics: http://localhost:9100/metrics
- SNMP Walk: http://localhost:5001
- Grafana UI: http://localhost:3000 with default credentials
-
Additional Information
- Flask App: Flask on Github.com
- Prometheus: Prometheus on Github.com
- Node Exporter: Node Exporter on Github.com
- Grafana: Grafana on Github.com
For further details, refer to the individual files in the repository.
We welcome contributions to this project! If you are interested in contributing, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
For further details, refer to the individual files in the repository.