mirror of
https://github.com/M0r13n/mikrotik_monitoring.git
synced 2025-12-06 01:59:30 +00:00
Initial commit with mikrotik-exporter
This commit is contained in:
commit
ddbb23ea60
6 changed files with 61 additions and 0 deletions
1
.env
Normal file
1
.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FILE=/config/config.yml
|
||||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"grafana",
|
||||||
|
"mikrotik"
|
||||||
|
]
|
||||||
|
}
|
||||||
37
README.md
Normal file
37
README.md
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
# Monitor your Mikrotik router with Prometheus and Grafana
|
||||||
|
|
||||||
|
Over the past years I replaced all my networking gear with Mikrotik devices. Nothing compares to Mikrotik in terms of price, features, performance and reliability. I absolutely love WinBox for management, but sometimes I miss some fancy charts and graphs. Luckily, RouterOS comes with a REST-API that can be used to query arbitrary data from the device.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
- Router running RouterOS 7.x.x
|
||||||
|
- Raspberry Pi 4 with 2 gb RAM
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
## Mikrotik Router
|
||||||
|
At first you need to prepare your router.
|
||||||
|
|
||||||
|
Create a group on the device that has API and read-only access:
|
||||||
|
|
||||||
|
`/user group add name=prometheus policy=api,read,winbox,test`
|
||||||
|
|
||||||
|
Create a user that is part of the group:
|
||||||
|
|
||||||
|
`/user add name=prometheus group=prometheus password=TOP_SECRET`
|
||||||
|
|
||||||
|
|
||||||
|
## Prepare Raspi
|
||||||
|
|
||||||
|
Install Python and pip:
|
||||||
|
|
||||||
|
`sudo apt install python3-dev python3 python3-pip -y`
|
||||||
|
|
||||||
|
Install Docker + Docker-compose
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sSL https://get.docker.com | sh
|
||||||
|
sudo usermod -aG docker ubuntu
|
||||||
|
sudo pip3 install docker-compose
|
||||||
|
sudo systemctl enable docker
|
||||||
|
```
|
||||||
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mikrotik_exporter:
|
||||||
|
image: nshttpd/mikrotik-exporter-linux-arm64:1.0.12-DEVEL # Change this depending on your version and/or if you built the image locally
|
||||||
|
volumes:
|
||||||
|
- './mikrotik_exporter:/config'
|
||||||
|
env_file: .env
|
||||||
|
ports:
|
||||||
|
- 9436:9436
|
||||||
|
restart: unless-stopped
|
||||||
6
mikrotik_exporter/config.yml
Normal file
6
mikrotik_exporter/config.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
devices:
|
||||||
|
- name: Chateau
|
||||||
|
address: 192.168.0.1
|
||||||
|
user: prometheus
|
||||||
|
password: TOP_SECRET
|
||||||
|
|
||||||
0
prometheus/prometheus.yml
Normal file
0
prometheus/prometheus.yml
Normal file
Loading…
Add table
Add a link
Reference in a new issue