This bash script will display POD and containers details for a specific POD within a SOSREPORT
None
- pull the repository
git clone https://github.com/vlours/sos4ocp
- Create the alias
sos4ocp
forsos4ocp.sh
in your .bashrc profile (optional)
echo -e "\nalias sos4ocp=${PWD}/sos4ocp/sos4ocp.sh" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
To update to the latest version, you simply have to pull the script from the repository.
sos4ocp_dir=$(dirname $(alias sos4ocp | cut -d"'" -f2)); cd ${sos4ocp_dir}; git pull origin main; cd -
sos4ocp_dir=$(dirname $(alias mg_check | cut -d"'" -f2))
if [[ -d ${sos4ocp_dir} ]]; then rm ${sos4ocp_dir}; fi
sed -i -e "/alias sos4ocp/d" ${HOME}/.bashrc
Simply run the script with the desired option(s)
sos4ocp.sh [-s <SOSREPORT_PATH>] [-p <PODNAME>|-i <PODID>|-c <CONTAINER_NAME>|-n <NAMESPACE>|-g <CGROUP>|-S <name|cpu|mem|disk|inodes>] [-h]
If you provide the full PODID, the script will trunk it to 13 characters.
using the -h
option will display the help and provide the list of the available options, and the version of the script.
usage: sos4ocp.sh [-s <SOSREPORT_PATH>] [-p <PODNAME>|-i <PODID>|-I <containerID>|-c <CONTAINER_NAME>|-n <NAMESPACE>|-g <CGROUP>|-S <name|cpu|mem|disk|inodes>] [-h]
if none of the filtering parameters is used, the script will display a menu with a list of the available PODs from the sosreport.
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| Options | Description | [Default] |
|---------|-----------------------------------------------------------------|-------------------------------------------------------------------------------|
| -s | Path to access the SOSREPORT base folder | <Current folder> [.] |
| -p | Name of the POD | null |
| -i | UID of the POD | null |
| -I | UID of the container | null |
| -c | Name of a CONTAINER | null |
| -n | NAMESPACE related to PODs | null |
| -g | CGROUP attached to a POD | null |
| -S | Display all containers stats by [name,cpu,mem,disk,inodes] | null |
|---------|-----------------------------------------------------------------|-------------------------------------------------------------------------------|
| | Additional Options: | |
|---------|-----------------------------------------------------------------|-------------------------------------------------------------------------------|
| -h | display this help and check for updated version | |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
Current Version: X.Y.Z