Skip to content

Instantly share code, notes, and snippets.

@jovemfelix
Last active November 10, 2021 01:17
Show Gist options
  • Save jovemfelix/0ecfd8205f8df5da68a70f53a8c21ec5 to your computer and use it in GitHub Desktop.
Save jovemfelix/0ecfd8205f8df5da68a70f53a8c21ec5 to your computer and use it in GitHub Desktop.
Usefull for JBOSS EAP (wildly) or RHSSO (Keycloak)

SO

What is an sosreport and how to create one in Red Hat Enterprise Linux? https://access.redhat.com/solutions/3592

# get sos-report, save the generated files
sos-report
# this gona be the health file
HOST_HEALTH_CHECK_FILE=$(hostname)_$(date +"%d-%m-%Y")

# create a folder and go inside to keep the contents
mkdir -p ${HOST_HEALTH_CHECK_FILE} && cd $_

# get limits
ulimit -a >& ${HOST_HEALTH_CHECK_FILE}.ulimit

# get configurations of sysctl
sysctl -a >& ${HOST_HEALTH_CHECK_FILE}.sysctl

# ifconfig
ifconfig > ${HOST_HEALTH_CHECK_FILE}.ifconfig

# get ethtool info for each network (except for loop back interface)
for e in $(netstat -i | awk 'FNR > 2  {print $1}' | sort -u); do if [[ ! $e =~ 'lo' ]]; then ethtool -g $e >& ${HOST_HEALTH_CHECK_FILE}.${e}; fi; done

# get hugepage
cat /proc/meminfo | grep -i hugepage > ${HOST_HEALTH_CHECK_FILE}.hugepage

# get timedatectl
timedatectl >& ${HOST_HEALTH_CHECK_FILE}.timedatectl

# get java info from pid
for j in $(ps -ef | grep -v grep |  grep java | awk '{print $2}'); do jinfo ${j} >& ${HOST_HEALTH_CHECK_FILE}.${j}; done

# get firewall info
systemctl status firewalld >& ${HOST_HEALTH_CHECK_FILE}.firewalld-status
firewall-cmd --list-ports  >& ${HOST_HEALTH_CHECK_FILE}.firewalld-ports

EAP or RHSSO

ADJUST THE VARIABLE SERVER_HOME to the EAP or RHSSO home folder

Here, we assume you are still in the previous folder!

# get server structure files
find ${SERVER_HOME} -type f > ${HOST_HEALTH_CHECK_FILE}.server

# get configuration folder
mkdir standalone-${HOST_HEALTH_CHECK_FILE}
mkdir domain-${HOST_HEALTH_CHECK_FILE}
cp -r ${SERVER_HOME}/standalone/configuration/*.xml ./standalone-${HOST_HEALTH_CHECK_FILE}/
cp -r ${SERVER_HOME}/domain/configuration/*.xml ./domain-${HOST_HEALTH_CHECK_FILE}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment