Skip to content

in-famous-raccoon/Docker-Stats-4-PRTG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Configuration on Docker Host

Install jq (example for debian/Ubuntu)

apt install jq

Configure Script

Paste content from DockerStats4PRTG.sh to your host or clone this repo

nano ./DockerStats4PRTG.sh

Customize CONTAINERS and OUTPUT_File variable fpr example:

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

Add script to crontab

crontab -e

Add following line for check every 5minutes

*/5 * * * * $HOME/DockerStats4PRTG.sh > /dev/null

Simple Nginx Server

Paste content from default.conf to your host or clone this repo

nano /PATH/TO/DOCKERDATA/default.conf

Create and start Docker

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

Configuration on PRTG WebUI

image.png

Useful links

PRTG custom sensors
PRTG HTTP Data Advanced
Linuxserver Docker Nginx

About

Scripts to monitor Docker Containers with PRTG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages