This script which you can use to collect metrics from linux server.
This is not a complete version because it was created for the purpose of learning.
If you want to run script you may use next command:
python ex.py
Also this script you can run with one of the parameter with information what you want: cpu or ram
python ex.py cpu
python ex.py mem
If you type wrong parameter you will see information about mistakes and information cpu and ram