# Grafana exporter for ZTE 5G modems ## Getting started One can just run the provided python script by `python3 zte_exporter.py ` The script accepts following options - `--port ` port whereupon the HTTP service serves the metrics - `--username ` username used for MULTI login (username/password login instead of just password) - `--device ` device type, valid choices are mc7010, dictates the RD key hash and login method (MULTI vs SINGLE) - `--reset yes/anything` TR069 reset, see below ## TR069 reset? You can safely ignore everything else, and just use the script with --reset to clear out TR069 configuration. Just run `python3 --reset yes` and follow the output. If it quietly fails, take a look at the code and check --device options. ## Docker? A docker file is provided to compile this and example compose.yml to use in compose tools. To use with docker run, just create .env with the correct values. A compose.yml file is provided as example. There's no current version image available on docker hub as I'm lazy and use systemd jobbie instead. ## Prometheus configuration A simple scrape config will suffice. Scrape interval will dicatete how often data is fetch. The path to metrics is root /. ``` - job_name: 'zte' static_configs: - targets: ['localhost:port'] labels: instance: '5g' ``` ## Dashboard Is provided with the dashboard.json. It should just work. ## Running via systemd Create a systemd unit file to `/etc/systemd/system/zte-exporter.service` with following ``` [Unit] Description=ZTE exporter service [Service] Type=simple ExecStart=/bin/python3 /opt/zte.py --port 8082 192.168.8.1 1234 [Install] WantedBy=network-online.target ``` ## Tested devices Devices currently supported / tested are only MC889A and it should just work with passing IP and password, default username is admin. ## Thanks Largely based on https://github.com/Kajkac/ZTE-MC-Home-assistant