From: Andrew Tridgell Date: Wed, 5 Sep 2007 04:20:34 +0000 (+1000) Subject: added a diagnostics tool for ctdb X-Git-Tag: tevent-0.9.20~348^2~2432 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c572d3c226353d5b57bbf0ed00536f72864e8407;p=thirdparty%2Fsamba.git added a diagnostics tool for ctdb (This used to be ctdb commit 032a2238caf688656b00e06bf363182368e037e1) --- diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in index d8c06fab9ad..a92f7c8124a 100644 --- a/ctdb/Makefile.in +++ b/ctdb/Makefile.in @@ -165,6 +165,7 @@ install: all ${INSTALLCMD} -m 755 config/events.d/50.samba $(DESTDIR)$(etcdir)/ctdb/events.d ${INSTALLCMD} -m 755 config/events.d/60.nfs $(DESTDIR)$(etcdir)/ctdb/events.d ${INSTALLCMD} -m 755 config/events.d/61.nfstickle $(DESTDIR)$(etcdir)/ctdb/events.d + ${INSTALLCMD} -m 755 tools/ctdb_diagnostics $(DESTDIR)$(bindir) ${INSTALLCMD} -m 755 tools/onnode.ssh $(DESTDIR)$(bindir) ${INSTALLCMD} -m 755 tools/onnode.rsh $(DESTDIR)$(bindir) if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man1; fi diff --git a/ctdb/packaging/RPM/ctdb.spec b/ctdb/packaging/RPM/ctdb.spec index 7774c4439d9..550a2b36e71 100644 --- a/ctdb/packaging/RPM/ctdb.spec +++ b/ctdb/packaging/RPM/ctdb.spec @@ -104,6 +104,7 @@ fi %{_sbindir}/ctdbd %{_bindir}/ctdb %{_bindir}/smnotify +%{_bindir}/ctdb_diagnostics %{_bindir}/onnode.ssh %{_bindir}/onnode.rsh %{_bindir}/onnode diff --git a/ctdb/tools/ctdb_diagnostics b/ctdb/tools/ctdb_diagnostics new file mode 100755 index 00000000000..97e16cbc62d --- /dev/null +++ b/ctdb/tools/ctdb_diagnostics @@ -0,0 +1,174 @@ +#!/bin/sh +# a script to test the basic setup of a CTDB/Samba install +# tridge@samba.org September 2007 + +PATH="$PATH:/sbin:/usr/sbin:/usr/lpp/mmfs/bin" + +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" + +2>&1 + +cat <> $ERRORS +} + +show_file() { + fname="$1" + echo " ================================" + echo " File: $fname" + echo " `ls -l $fname`" + cat "$fname" | sed 's/^/ /' + echo " ================================" +} + +show_all() { + echo "running $1 on all nodes" + onnode all "hostname; date; $1 2>&1 | sed 's/^/ /'" +} + +ERRORS="/tmp/diag_err.$$" +NUM_NODES=`wc -l < /etc/ctdb/nodes` +MAX_NODE=`expr $NUM_NODES - 1` +NUM_ERRORS=0 +cat < $tmpf + cmp $f $tmpf || { + error "File $f is different on node $i" + diff -u $f $tmpf + } + rm -f $tmpf + done +done + +cat < /dev/null` +show_all id "$WORKGROUP/Administrator" +show_all "wbinfo -p" +show_all "wbinfo --sequence" +show_all "smbd -b" + +date +echo "Diagnostics finished with $NUM_ERRORS errors" + +[ -r $ERRORS ] && { + cat $ERRORS + rm -f $ERRORS +} +exit $NUM_ERRORS +