This automation covered:
- CPU Usage
- Memory utilization
- Disk utilization
- Log size
- System up time since the last reboot
- Packet sent
- Packet received
- Bytes sent
- Bytes received
Prerequisite to run this automation is pip
and psutil-library
packages installed on your host machine. Follow below steps for the installation of required packages and copy the stats.py
script to your BPO-host machine.
Pip is part of Extra Packages for Enterprise Linux (EPEL), which is a community repository of non-standard packages for the RHEL distribution.
$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
$ python get-pip.py
$ pip --help
$ pip -V
psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python. It is useful mainly for system monitoring, profiling, limiting process resources and the management of running processes. It implements many functionalities offered by command line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap.
The easiest way to install psutil is with pip
$ sudo yum install gcc python-devel python-pip -y
$ pip install psutil
$ sudo apt-get install gcc python-dev python-pip
$ pip install psutil