geerlingguy / airgradient-prometheus

AirGradient Prometheus exporter.
MIT License
176 stars 59 forks source link

Docker container not receiving messages #6

Closed NailStorm closed 3 years ago

NailStorm commented 3 years ago

Just set up my RaspberryPi 3 with Raspberry Pi OS Lite, installed Grafana, Prometheus, Docker, uploaded a sketch to the sensor (with WiFi enabled and my Pi's address "http://fenikspi:9925/"), AirGradient sensor works just fine, but i have an issue with Docker (i'm new to it)...

Runned:

docker run -d -p 9925:80 --name airgradient \
  -v "$PWD":/var/www/html \
  php:8-apache \
  /bin/bash -c 'chown -R 33:33 html; a2enmod rewrite; apache2-foreground'

It compiles:

$ docker ps -a
CONTAINER ID   IMAGE          COMMAND                  CREATED             STATUS                         PORTS                                   NAMES
71fdc4680f94   php:8-apache   "docker-php-entrypoi…"   39 minutes ago      Up 12 minutes                  0.0.0.0:9925->80/tcp, :::9925->80/tcp   airgradient

But when i try to read messages it says 404:

$ curl localhost:9925/metrics
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.48 (Debian) Server at localhost Port 9925</address>
</body></html>

What is my problem?

NailStorm commented 3 years ago

Managed to use sensor without docker