DevOps / Scripts
bash
Intermediate
Container Resource Usage Reporter
Print CPU and memory usage for all running containers sorted by memory consumption.
bash
#!/bin/bash
docker stats --no-stream --format \
"table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" \
| sort -k3 -h -r
Prerequisites
- Docker >= 20
Pro Tips
- → Add to a cron job and alert if any container exceeds 80%.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Intermediate
- Read time
- 1 min
- Published
- Jul 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Postgres S3 Backup
Dump a Postgres database, gzip it, push to S3 with AES256 encryption.
bash
·
Intermediate
Disk Usage Alert
Send an alert when any mounted filesystem exceeds a usage threshold.
bash
·
Beginner
Docker Image Cleanup Script
Remove dangling images, stopped containers and unused volumes in one pass.
bash
·
Intermediate