diff --git a/mdiag/mdiag.sh b/mdiag/mdiag.sh index 5e822767..de529e8a 100755 --- a/mdiag/mdiag.sh +++ b/mdiag/mdiag.sh @@ -289,6 +289,42 @@ smartctl --scan | sed -e "s/#.*$//" | while read i; do smartctl --all \$i; done EOF msection scsidevices getfiles /sys/bus/scsi/devices/*/model + +#check cgroups capabilities and alignment +#list the mounted controllers: +cgroupcontrollers="`grep -e \"^cgroup\" /proc/mounts | xargs -l | cut -f2 -d' '`" + +#collect the groups defined in the moutned controllers: +for cgcontoroller in $cgroupcontrollers; do + cgrouphierarchy="$cgrouphierarchy "$'\n'"`find $cgcontoroller -type d 2> /dev/null`" +done + +#list the configuration files for the groups +for cgroup in $cgrouphierarchy; do + if [ ! -z "$cgroup" ] + then + cgroupfilelist="$cgroupfilelist `find $cgroup -type f 2> /dev/null`" + fi +done + +#wrap the content +for cgroupfile in $cgroupfilelist; do + if [ -r "$cgroupfile" ] + then + cgroupconfigcontent="$cgroupconfigcontent"$'\n'"--> FILE: $cgroupfile"$'\n'"`cat $cgroupfile 2> /dev/null`" + fi +done + +msection cgroups < /dev/null && echo "/cgroups found" || echo "NO /cgroups --> I think nothing to check here" +msubsection cgred service cgred status +msubsection cgconfig service cgconfig status +msubsection configfiles getfiles /etc/cg* /etc/cgconfig.d/*; +msubsection grouphierarchy echo "$cgrouphierarchy" +msubsection groupconfiguration echo "$cgroupconfigcontent" +EOF + + cat <