Remove Synology NAS config, as it is not of interest for most users

This commit is contained in:
Leon Morten Richter 2021-10-29 13:33:10 +02:00
parent 7c8b4dfac5
commit c2ec8c0c9b
No known key found for this signature in database
GPG key ID: 342FEEA0E70922F8
8 changed files with 17 additions and 10206 deletions

View file

@ -30,58 +30,24 @@ Create a user that is part of the group:
`/user add name=prometheus group=prometheus password=TOP_SECRET`
## Prepare Synology NAS
Firstly, activate SNMPv3 in your Synology NAS und set a username and password (md5).
In order to get stats from a Synology NAS into Prometheus an exporter is needed.
-> https://github.com/prometheus/snmp_exporter
This exporter comes with a pre-build docker image.
There is a pre-build `snmp.yml`, where you only need to update the username and password in the bottom `auth` section.
<details>
<summary>Optional: How to generate `snmp.yml`</summary>
The generator file can be found in `./synology/generator.yml`.
Create the `snmp.yml` exporter config:
1. Change `auth.username` and `auth.password` to match the Synology NAS
2. Make a temporary directory: `mkdir tmp && cd tmp`
3. Get the SNMP exporter repo: `git clone git@github.com:prometheus/snmp_exporter.git && cd snmp_exporter`
4. Copy the generator file: `cp ../../synology/generator.yml ./generator && cd generator` (yes override)
5. Prepare the MIB files: `make mibs`
6. Generate the `snmp.yml` file using Docker:
```bash
docker build -t snmp-generator .
sudo docker run -ti \
-v "${PWD}:/opt/" \
snmp-generator generate
```
7. If everything went well, a config file has been written to `./snmp.yml`
8. Copy this file into the Synology folder (next to the generator.yml): `cp ./snmp.yml ../../../synology/`
</details>
## Prepare Raspi
You need Ubuntu Server for ARM 64 bit in order to use this setup. You may also use Raspian, but then you are limited to 32bit ARM executables. This would mean, that you need to compile the `mikrotik-exporter` by hand, because there are no predefined 32-bit Docker images.
You need Ubuntu Server for ARM 64 bit in order to use this setup. You may also use Raspian, but then you are limited to 32bit ARM executables. This would mean, that you need to compile the `mikrotik-exporter` by hand, because there are no pre built 32-bit Docker images.
You need to execute the following steps on the target machine itself (e.g. Raspberry Pi).
Install Python and pip:
`sudo apt install python3-dev python3 python3-pip -y`
Install Docker + Docker-compose
Install Docker + Docker-compose (reboot required)
```bash
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker ubuntu
sudo pip3 install docker-compose
sudo systemctl enable docker
sudo reboot
```
Build the mktxp Docker image
@ -94,7 +60,7 @@ git clone https://github.com/akpw/mktxp.git
cd mktxp
# Build the docker image
docker build -t mktxp
docker build . -t mktxp
```
Now get this repo and install all services:
@ -108,7 +74,7 @@ git clone https://github.com/M0r13n/mikrotik_monitoring.git
cd mikrotik_monitoring
# Let docker-compose do it's job
sudo docker-compose up -d
docker-compose up -d
```
You may need to adjust the following configuration files and add your own credentials for your router:
@ -117,3 +83,7 @@ You may need to adjust the following configuration files and add your own creden
Done. You should now be able to open the Grafana dashboard on Port 3000 of your Raspberry Pi.
## Multiple Nodes
It is possible to monitor multiple (Mikrotik) devices. Just change add as many devices to `mktxp/mktxp.conf` as you want.