Python script for get cpu and memory metric and show them
CPU Metrics
python3 metric cpu
Memory Metrics
python3 metric mem
Python 3 Script use psutil - cross-platform python library for retrieving information on running processes and system utilization
pip3 install psutil
How to install pip
Buil and run docker container to get basic CPU and memory metric
Base Docker Image ubuntu:latest Additional packages
- python3
- python3-pip
- python3-virtualenv
- psutil python library Copy metric script into docker image
docker build -t metric/osokin .
docker run --name metric -d -i metric/osokin:latest
docker exec metric /metric cpu
docker exec metric /metric mem