The "docker-monitoring" project provides docker scripts for deployment of the Prometheus monitoring platform, including Prometheus, Grafana, Consul, Nvidia_GPU_Exporter, Windows_Exporter, and Node_Exporter.
Prerequisites
- docker
- docker-compose
- nvidia_docker2
- nvidia_smi
git clone https://github.com/CheaterScript/docker-monitoring.gitThe basic version includes Prometheus and Grafana, utilizing file-based discovery to configure collection rules.
docker-compose up -dAdding Nginx as a reverse proxy.
docker-compose -f docker-compose.proxy.yml up -dAdding for service discovery of collection rules.
docker-compose -f docker-compose.consul.yml up -dUsing node_exporter to monitor host information and using nvidia_gpu_exporter to monitor NVIDIA GPU information.
docker-compose -f docker-compose.node.yml up -d curl -X PUT -d '{"id": "<ID>","name": "<service name>","address": "<IP address>","port": <Port>,"tags": [<tags>],"checks": [{"http": "<protocol>://<IP>:<Port>","interval": "30s","timeout":"30s"}]}' http://<Consul host>:8500/v1/agent/service/registerExample:
curl -X PUT -d '{"id": "Linux-1","name": "Linux","address": "192.168.225.1","port": 9182,"tags": ["service"],"checks": [{"http": "http://192.168.225.1:9182","interval": "30s","timeout":"30s"}]}' http://192.168.225.128:8500/v1/agent/service/register curl -X PUT http://<Consul host>:8500/v1/agent/service/deregister/<service ID>Example:
curl -X PUT http://192.168.225.128:8500/v1/agent/service/deregister/Linux-1Prerequisites
- version >= windows7
- nvidia_smi
If you are running a .ps1 script for the first time in PowerShell, you need to open PowerShell as an administrator and then execute the following:
set-ExecutionPolicy RemoteSigned git clone https://github.com/CheaterScript/docker-monitoring.gitThe basic version includes Prometheus and Grafana, and run the Install.ps1 script as an administrator.
Using windows_exporter to monitor host information and using nvidia_gpu_exporter to monitor NVIDIA GPU information.
Run the setup_exporters.bat file as an administrator.
Run the stop_exporters.bat file as an administrator.