Replace top with vmstat

When top is run on centos-8 it creates .config/procps/ However, when
top is run in containers it creates .config/procps/ in every mount. That
creates a problem for mysql/mariadb as it tries to treat .config as
database

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| #mysql50#.config   |

When something tries to restart mysql_bundle it returns non zero return
code as it reports the issue that #mysql50#.config which fails
standalone upgrade process. This patch replaces top with vmstat -s and
ps axfo equivalent.

Change-Id: I331e17d6b95b021647c9f2c36ad104da75626fa1
This commit is contained in:
Sergii Golovatiuk 2020-09-22 16:25:30 +02:00 committed by Sagi Shnaidman
parent c127900458
commit a8c67af17c
2 changed files with 6 additions and 3 deletions

View File

@ -197,8 +197,10 @@ artcl_commands:
swaps:
cmd: cat /proc/swaps
capture_file: /var/log/extra/swaps.txt
top:
cmd: top -b -n 1
vmstat:
cmd: vmstat -s
ps:
cmd: ps axfo %mem,size,rss,vsz,pid,args
rpm-list:
cmd: rpm -qa | sort -f
package-list-installed:

View File

@ -63,7 +63,8 @@ for cont in $(${engine} ps | awk {'print $NF'} | grep -v NAMES); do
elif [ ${engine} = 'podman' ]; then
${engine} top $cont;
fi
${engine} exec $cont top -bwn1;
${engine} exec $cont vmstat -s
${engine} exec $cont ps axfo %mem,size,rss,vsz,pid,args
${engine} exec $cont bash -c "\$(command -v dnf || command -v yum) list installed";
) &>> $INFO_DIR/${engine}_info.log;