New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure
New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure
Hi all,
I managed to wrote a Prometheus exporter for the Omada app. For those who don't know, Prometheus (https://prometheus.io/) is a software used for event monitoring and alerting.
Basically with the omada-exporter, I've scraped the metrics regarding the access points that you already can find on the Omada web interface.
What's the advantage on that? Well, you can define your own rule of alerting with the Prometheus Alertmanager, for example:
- If an Access Point is down for more than X minutes, send me an email and a Telegram/Slack/SMS message
- If the radio interference on an Access point is too high in the last hour, send me an email
The second big advantage is that you can keep some historical statistics, and build your fancy graphs with Grafana (https://grafana.com/), see screenshot at the bottom.
If do you think that it is interesting and you would like to use it or improve it, I'm going to put the source code on a public repository in the next few days. The exporter can be further improved by adding other metrics regarding the guests, voucher, etc (every stat that you see on the omada controller).
IMHO, I would like to see tplink providing a minimum of support (like sharing their internal API documentation) on this, as with this component you can really add value on top of the whole Omada ecosistem.
Cheers
Screenshots (the graph can be improved of course, this is a first version):
Global status of the site:
Statistics on the Server running omada
Statistic on a single access point
- Copy Link
- Subscribe
- Bookmark
- Report Inappropriate Content
@ab12 Happy to test on the new version!
- Copy Link
- Report Inappropriate Content
@ab12 This looks great! So Prometheus monitors Omada and sends that data to Influx? I already have a Grafana and Influx DB containers, but I'm not entirely clear on what this container needs - does it need Prometheus already setup? If so, do you happen to have a guide? Sorry to pull the newb card. Thanks for putting this together! I really want to be alerted on interference as I debug some wireless issues. Also be glad to help test on the new Omada controller version
- Copy Link
- Report Inappropriate Content
Hi @BubbaW ,
Prometheus is a bit different from Influxdb, as it follows a pull-approach: In Influxdb you have to push the metrics to the InfluxDB instance. In Prometheus instead, you configure a scraping rule on the Prometheus server, and the Prometheus server will scrape the metrics from the services at regular intervals. This approach brings some advantages, you can read more on that here: https://giedrius.blog/2019/05/11/push-vs-pull-in-monitoring-systems/
At the time, I'd chosen to use Prometheus because I already had a Prometheus instance running, so it was faster to implement a little exporter and have a working solution. Given that now I have to adapt the software to work with the new omada version, it may be worthwhile to add InfluxDB support to the exporter, so you can directly push the metrics on InfluxDB. As it seems that this software is useful to someone other than me, I think that I will soon start to develop the new feature.. :)
For the time being, you can spin-up a prometheus container and configure Grafana to retrieve the metrics from Prometheus. Are you using Docker-compose? If yes, you can add this service:
prometheus:
image: prom/prometheus:v2.15.2
container_name: prometheus
hostname: prometheus
restart: unless-stopped
user: root
ports:
- 9090:9090
networks:
- monitoring
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.external-url=http://localhost:9090/prometheus'
- '--web.route-prefix=/prometheus'
- '--storage.tsdb.retention.size=20GB'
- '--storage.tsdb.retention.time=10y'
volumes:
- ./config/prometheus:/etc/prometheus
- ./data/prometheus:/prometheus
My configuration for Prometheus with omada-scapring is the following (substitute ADDRESS_OF_THE_OMADA_EXPORTER with the address of my exporter):
global:
scrape_interval: 30s
scrape_timeout: 10s
evaluation_interval: 15s
# external label useful for identification during federation
external_labels:
whoami: central
rule_files:
- alerts/*.rules.yml
- recording/*.rules.yml
scrape_configs:
- job_name: 'omada'
static_configs:
- targets:
- $$$$$$ADDRESS_OF_THE_OMADA_EXPORTER$$$$$$:8000
labels:
service: omada
Let me know if you need further help. (You can find a lot of useful information on Prometheus here: https://prometheus.io/docs/introduction/overview/
- Copy Link
- Report Inappropriate Content
Information
Helpful: 4
Views: 10866
Replies: 13