2 # a script to test the basic setup of a CTDB/Samba install
3 # tridge@samba.org September 2007
5 PATH="$PATH:/sbin:/usr/sbin:/usr/lpp/mmfs/bin"
7 CONFIG_FILES="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/sysconfig/ctdb /etc/ctdb/public_addresses /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/sysconfig/nfs /etc/exports /etc/vsftpd/vsftpd.conf"
12 --------------------------------------------------------------------
13 ctdb_diagnostics starting. This script will gather information about
14 your ctdb cluster. You should send the output of this script along
15 with any ctdb or clustered Samba bug reports.
16 --------------------------------------------------------------------
24 NUM_ERRORS=`expr $NUM_ERRORS + 1`
25 echo " ERROR[$NUM_ERRORS]: $msg" >> $ERRORS
30 echo " ================================"
32 echo " `ls -l $fname 2>&1`"
33 cat "$fname" 2>&1 | sed 's/^/ /'
34 echo " ================================"
38 echo "running $1 on all nodes"
39 onnode all "hostname; date; $1 2>&1 | sed 's/^/ /'"
42 ERRORS="/tmp/diag_err.$$"
43 NUM_NODES=`wc -l < /etc/ctdb/nodes`
44 MAX_NODE=`expr $NUM_NODES - 1`
47 Diagnosis started on a $NUM_NODES node cluster. The following node list will be used:
49 show_file /etc/ctdb/nodes
53 --------------------------------------------------------------------
54 Comping critical config files on all nodes
57 for f in $CONFIG_FILES; do
63 for i in `seq 0 $MAX_NODE`; do
64 echo "Testing for same config file $f on node $i"
65 tmpf=/tmp/`basename $f`.node$i
66 onnode $i cat $f > $tmpf 2>&1
67 cmp $f $tmpf 2>&1 || {
68 error "File $f is different on node $i"
76 --------------------------------------------------------------------
77 Checking for clock drift
80 for i in `seq 0 $MAX_NODE`; do
81 t2=`onnode $i date +%s`
83 if [ $d -gt 30 -o $d -lt -30 ]; then
84 error "time on node $i differs by $d seconds"
89 --------------------------------------------------------------------
90 Showing software versions
94 show_all "rpm -qa | egrep 'samba|ctdb|gpfs'"
99 --------------------------------------------------------------------
100 Showing ctdb status and recent log entries
102 show_all "ctdb status; ctdb ip"
103 show_all "ctdb statistics"
105 echo "Showing log.ctdb"
106 show_all "tail -100 /var/log/log.ctdb"
108 echo "Showing log.ctdb"
109 show_all "tail -100 /var/log/log.ctdb"
113 --------------------------------------------------------------------
114 Showing system and process status
122 show_all "/sbin/lspci"
123 show_all "cat /proc/partitions"
124 show_all "cat /proc/cpuinfo"
125 show_all "cat /proc/scsi/scsi"
126 show_all "/sbin/ifconfig -a"
127 show_all "/sbin/ip addr list"
128 show_all "/sbin/route -n"
129 show_all "netstat -s"
131 show_all "crontab -l"
133 show_all "/sbin/iptables -L -n"
134 show_all "/sbin/iptables -L -n -t nat"
135 show_all "/usr/sbin/rpcinfo -p"
136 show_all "/usr/sbin/showmount -a"
137 show_all "/usr/sbin/showmount -e"
138 show_all "/usr/sbin/nfsstat -v"
139 [ -x /sbin/multipath ] && {
140 show_all "/sbin/multipath -ll"
142 [ -x /sbin/chkconfig ] && {
143 show_all "/sbin/chkconfig --list"
145 [ -x /usr/sbin/getenforce ] && {
146 show_all "/usr/sbin/getenforce"
148 [ -d /proc/net/bonding ] && {
149 for f in /proc/net/bonding/*; do
154 [ -d /usr/lpp/mmfs ] && {
156 --------------------------------------------------------------------
157 Showing GPFS status and recent log entries
159 show_all "tail -100 /var/adm/ras/mmfs.log.latest"
160 show_all "/usr/lpp/mmfs/bin/mmlsconfig"
161 show_all "/usr/lpp/mmfs/bin/mmlsfs all"
162 show_all "/usr/lpp/mmfs/bin/mmlsnsd"
163 show_all "/usr/lpp/mmfs/bin/mmlsnsd -X"
164 show_all "/usr/lpp/mmfs/bin/mmfsadm dump version"
165 show_all "/usr/lpp/mmfs/bin/mmfsadm dump waiters"
166 show_all "/usr/lpp/mmfs/bin/mmlsmount all"
167 show_all "/usr/lpp/mmfs/bin/mmlsquota"
168 show_all "/usr/lpp/mmfs/bin/mmlscluster"
169 show_all "/usr/lpp/mmfs/bin/mmlsmgr"
170 fslist=`mount|grep type.gpfs|awk '{print $1}'`
171 for fs in $fslist; do
172 show_all "/usr/lpp/mmfs/bin/mmlssnapshot $fs"
173 show_all "/usr/lpp/mmfs/bin/mmlsdisk $fs"
174 show_all "/usr/lpp/mmfs/bin/mmlsfileset $fs"
179 --------------------------------------------------------------------
182 show_all "smbstatus -n -B"
183 show_all "net ads testjoin"
184 show_all "lsof -n | grep smbd"
185 show_all "netstat -tan"
186 show_all "net ads info"
188 show_all "smbclient -U% -L 127.0.0.1"
189 WORKGROUP=`testparm -s --parameter-name=WORKGROUP 2> /dev/null`
190 show_all id "$WORKGROUP/Administrator"
192 show_all "wbinfo --sequence"
196 echo "Diagnostics finished with $NUM_ERRORS errors"