2017-08-31 20:04:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#############################################################
|
|
|
|
# Name: Supportconfig Plugin for QEMU/KVM
|
|
|
|
# Description: Gathers important troubleshooting information
|
|
|
|
# about QEMU
|
|
|
|
# Author: Jim Fehlig <jfehlig@suse.com>
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
RCFILE="/usr/lib/supportconfig/resources/scplugin.rc"
|
|
|
|
|
|
|
|
if [ -s $RCFILE ]; then
|
|
|
|
if ! source $RCFILE; then
|
|
|
|
echo "ERROR: Initializing resource file: $RCFILE" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rpm_verify() {
|
|
|
|
thisrpm="$1"
|
|
|
|
local ret=0
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "#==[ Validating RPM ]=================================#"
|
|
|
|
if rpm -q "$thisrpm" >/dev/null 2>&1; then
|
|
|
|
echo "# rpm -V $thisrpm"
|
|
|
|
|
|
|
|
if rpm -V "$thisrpm"; then
|
|
|
|
echo "Status: Passed"
|
|
|
|
else
|
|
|
|
echo "Status: WARNING"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "package $thisrpm is not installed"
|
2021-07-02 14:49:06 +02:00
|
|
|
ret=1
|
2017-08-31 20:04:33 +02:00
|
|
|
fi
|
|
|
|
echo
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
if ! rpm_verify qemu; then
|
|
|
|
echo "Skipped"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# skip if the host is xen
|
|
|
|
echo "#==[ Checking if booted Xen ]=================================#"
|
|
|
|
if [ -d /proc/xen ] && [ -e /proc/xen/capabilities ] && [ `cat /proc/xen/capabilities` = "control_d" ]; then
|
|
|
|
echo "Yes"
|
|
|
|
echo "Skipped"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "No"
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
|
|
|
# basic system information
|
|
|
|
plugin_command "uname -r"
|
|
|
|
plugin_command "lscpu"
|
2021-07-02 14:49:06 +02:00
|
|
|
plugin_command "lspci -v"
|
|
|
|
plugin_command "lsscsi"
|
2017-08-31 20:04:33 +02:00
|
|
|
plugin_command "kvm_stat -1"
|
|
|
|
plugin_command "lsmod | grep ^kvm"
|
|
|
|
for MODULE in `lsmod | grep ^kvm | cut -d ' ' -f 1`; do
|
|
|
|
plugin_command "modinfo $MODULE"
|
|
|
|
done
|
|
|
|
plugin_command "ps -ef | grep qemu"
|
|
|
|
|
|
|
|
# list contents of common config and image directories
|
2021-07-02 14:49:06 +02:00
|
|
|
plugin_command "ls -alR /var/lib/libvirt/images/"
|
2017-08-31 20:04:33 +02:00
|
|
|
|
|
|
|
# network-related info often useful for debugging
|
2021-07-03 04:10:16 +02:00
|
|
|
nm_enabled=$(systemctl is-enabled NetworkManager.service > /dev/null 2>&1; echo $?)
|
|
|
|
if [ $nm_enabled -eq 0 ]; then
|
2017-08-31 20:04:33 +02:00
|
|
|
echo "NOTE: NetworkManager should not be enabled on a KVM host"
|
|
|
|
fi
|
2021-07-02 14:49:06 +02:00
|
|
|
plugin_command "ip route list"
|
|
|
|
plugin_command "ip neigh list"
|
2017-08-31 20:04:33 +02:00
|
|
|
plugin_command "ip link show type bridge"
|
|
|
|
plugin_command "bridge link show"
|
|
|
|
|
|
|
|
echo "Done"
|