apt install jq
nano ./DockerStats4PRTG.sh
CONTAINERS="nginx-docker-prtg container1"
OUTPUT_FILE="/PATH/TO/DOCKERDATA/DockerStats4PRTG.json"
Run the script (on the first run, an error message is displayed because the file size cannot be measured)
./DockerStats4PRTG.sh
crontab -e
*/5 * * * * $HOME/DockerStats4PRTG.sh > /dev/null
nano /PATH/TO/DOCKERDATA/default.conf
docker run -d \
--name nginx-docker-prtg \
--restart=unless-stopped \
-p 80:80 \
-e USER_UID=1000 \
-e USER_GID=1000 \
-e TZ="Europe/Berlin" \
-v /PATH/TO/DOCKERDATA/default.conf:/config/nginx/site-confs/default.conf:ro \
-v /PATH/TO/DOCKERDATA/DockerStats4PRTG.json:/config/www/DockerStats4PRTG.json:ro \
linuxserver/nginx:latest
- Add sensor
- HTTP Data Advanced
- Name = Docker Stats
- URL = http://YOURNGINXSERVER/DockerStats4PRTG.json
PRTG custom sensors
PRTG HTTP Data Advanced
Linuxserver Docker Nginx