Skip to content
/ sos4ocp Public

script to display POD and containers details for a specific POD within a SOSREPORT

License

Notifications You must be signed in to change notification settings

vlours/sos4ocp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sos4ocp

This bash script will display POD and containers details for a specific POD within a SOSREPORT

Installation and updates

Requirements

None

Installation

  • pull the repository
git clone https://github.com/vlours/sos4ocp
  • Create the alias sos4ocp for sos4ocp.sh in your .bashrc profile (optional)
echo -e "\nalias sos4ocp=${PWD}/sos4ocp/sos4ocp.sh" >> ${HOME}/.bashrc
source ${HOME}/.bashrc

Update to latest version (based on the alias)

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 -

Remove the script (based on the alias)

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

Usage

Basic Usage

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.

Script Options

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>|-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                                                                          |
|      -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.X.X

About

script to display POD and containers details for a specific POD within a SOSREPORT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages