#!/bin/bash DOCKER_DM_USED=`docker info | grep 'Data Space Used' | awk '{print $4}' | sed 's/GB//g'` DOCKER_DM_TOTAL=`docker info | grep 'Data Space Total' | awk '{print $4}' | sed 's/GB//g'` DOCKER_DM_USED_PERCENT=`echo "$DOCKER_DM_USED *100 / $DOCKER_DM_TOTAL" | bc` echo "docker_devicemapper_used_percent $DOCKER_DM_USED_PERCENT" > /tmp/prom/docker.prom