Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions mdiag/mdiag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
ls /cgroup &> /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 <<EOF

==============================================================
Expand Down