ntimo / mailcow-prometheus-endpoint

A Prometheus endpoint for mailcow using the mailcow API
10 stars 2 forks source link

Keine Daten von Mailcow #1

Open johann8 opened 4 years ago

johann8 commented 4 years ago

Hallo ntimo,

ich habe das Problem, dass ich keine Daten über Mailcow in Prometheus DB bekomme.

Die Verbindung aus dem Prometheus Container zum Webserver, wo metrics.php liegt: wget https://prom.kabel.de/metrics.php Connecting to prom.kabel.de (192.168.18.9:443) wget: server returned error: HTTP/1.1 401 Unauthorized

Die Verbindung aus dem Prometheus Container zu Mailcow scheint zu funktionieren: wget https://mx01.kabel.de/api/v1/get/status/solr Connecting to mx01.kabel.de (192.168.18.9:443) saving to 'solr' 'solr' saved

Angaben zur Konfiguration:

  1. cat config/prometheus/prometheus.yml ------------------------------------------ global: scrape_interval: 15s # By default, scrape targets every 15 seconds.

    # Attach these labels to any time series or alerts when communicating with # external systems (federation, remote storage, Alertmanager). external_labels: monitor: 'Monitoring-Mailcow'

scrape_configs: - job_name: 'mailcow' scrape_interval: 15s metrics_path: /metrics.php scheme: https params: token: ['efiULO3QzH2EmNIwSjg11w16goCOPEhwOHowrnRcHHqQZW0Puy'] mailcow_api_key: ['VbWVTjttMN0e77mSMFjLdEo5ymScxxhdLWZ1JasD'] mailcow_hostname: ['mx01.baueinsatzkabel.de'] honor_labels: True static_configs: - targets: ['prom.baueinsatzkabel.de'] -------------------------------------------

  1. cat /var/www/html/mailcow-prometheus-endpoint/metrics.php ----------------------------------------------------------------- ... // token used to access the metrics $token = 'efiULO3QzH2EmNIwSjg11w16goCOPEhwOHowrnRcHHqQZW0Puy'; ... -------------------------------------------------------------------

  2. cat /opt/mailcow-dockerized/mailcow.conf -------------------------- ...... API_KEY=VbWVTjttMN0e77mSMFjLdEo5ymScxxhdLWZ1JasD

    API_KEY_READ_ONLY=

    API_ALLOW_FROM=172.22.1.1,127.0.0.1,172.20.0.2,172.20.0.3 ------------------------------------------------------------

  3. cat config/prometheus/prometheus.yml ---------------------------------------------- ...
    prometheus: image: prom/prometheus ports: - "127.0.0.1:9090:9090" volumes: - prometheusdata:/prometheus - ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro - ./config/ssl/private_key:/etc/prometheus/private_key:ro - ./config/ssl/public_key:/etc/prometheus/public_key:ro environment: \ - TZ=Europe/Berlin restart: always networks: mon-net: ipv4_address: 172.20.0.2 ... --------------------------------------

Hättest Du einen Ratschlag für mich? Vielen Dank im voraus Grüße Johann

johann8 commented 4 years ago

Mit der Version 2.20.1 von Prometheus funktioniert alles, Musste aber die Volumes löschen. Vielen Dank!