New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
12

New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
13 Reply
Re:New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure
2020-12-17 10:57:33

@ab12 Happy to test on the new version!

  1  
  1  
#12
Options
Re:New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure
2020-12-24 02:09:36 - last edited 2020-12-24 02:20:20

@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 

  0  
  0  
#13
Options
Re:New Prometheus omada-exporter, or How to build a customizable alerting and monitoring infrastructure
2020-12-24 13:06:32

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/

 

 

  1  
  1  
#14
Options