Sending metrics from a pp-code
sensor to InfluxDB to be visualized by Grafana
- See repo
compose-monitor
if you use it for InfluxDB and Grafana. CONFIG_FILE
: this must be set to your config settings, seesample_settings.yml
for example.
# From get_metrics.py
uri = protocol + host + ':' + str(port) + '/' + key + endpoint
{
"API": {
"Version": "200"
},
"Stats": {
"Temp": "74.34F",
"Humi": "55.29%",
"Press (inHg)": "29.63"
}
}
make docker
# or,
docker-compose build
First, we need to have InfluxDB
and Grafana
run from this compose-monitor
docker-compose.
1.Running from commandline
nohup ./run_get_metrics.sh my_settings.yml 2>&1 > /dev/null &
2.Running as a docker service
Switch to virtual env with docker-compose
installed. All settings are in my_settings.yml
file.
workon metrics
docker-compose up -d
author: tuan t. pham
Note: The work of generalizing the endpoint, key, and Transformation is sponsored by Greenfly SAU LLC.