1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

36 Commits

Author SHA1 Message Date
Martin Schwenke
79f5d05846 ctdb-tools: Remove duplicate code
These lines are duplicates of those above.  It has always been this
way...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Aug 14 09:00:45 CEST 2017 on sn-devel-144
2017-08-14 09:00:45 +02:00
Martin Schwenke
b71becc150 ctdb-scripts: Ignore shellcheck SC2181 warning (use of $?)
Given the size of the command substitutions it would be less clear to
embed the assignments and substitutions inside a conditional.  It is
clearer if the exit code is checked afterwards.

However, do fix some untidy uses of != instead of -ne when comparing
with $?.  Make the code easier to understand by reversing the logic
and using -eq and ||.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-14 05:15:25 +02:00
Martin Schwenke
3654694a09 ctdb-tools: Avoid shellcheck SC2188 warning (redirect without command)
Shellcheck found a bug!

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-14 05:15:25 +02:00
Martin Schwenke
355c49fc74 ctdb-scripts: Avoid shellcheck warning SC2006 (legacy ..)
SC2006: Use $(..) instead of legacy `..`.

Make the obvious changes to $(...) but convert some to $((...)).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:27 +02:00
Martin Schwenke
aa5187510f ctdb-scripts: Avoid shellcheck warning SC2059 ($ in printf format)
SC2059: Don't use variables in the printf format string.
        Use printf "..%s.." "$foo".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:27 +02:00
Martin Schwenke
77341f61ba ctdb-scripts: Avoid shellcheck warning SC2002 (useless cat)
SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
9255d645f3 ctdb-scripts: Avoid shellcheck warnings SC2046, SC2086 (double-quoting)
SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.

Add some quoting where it makes sense.  Use shellcheck directives for
false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
b933b91a0b ctdb-scripts: Update important installed files to use build-time defaults
In this case: ctdbd_wrapper, onnode, ctdb_diagnostics, ctdb.sudoers.
Set sensible defaults from configure options.

Update documentation to match, trying to fix up anything that has been
missed before.

The onnode unit tests need a symlink to the functions file.
The simple integration tests need to set CTDB_BASE and also
need symlinks to functions/nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

fixup

Signed-off-by: Martin Schwenke <martin@meltin.net>
2015-09-15 08:56:21 +02:00
Martin Schwenke
56fd37ba0d ctdb-tools: Drop vacuum.log from ctdb_diagnostics
This hasn't existed for a long time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-15 08:56:21 +02:00
Martin Schwenke
e79877a230 ctdb-tools: Add dbstatistics to ctdb_diagnostics
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  7 10:00:54 CEST 2015 on sn-devel-104
2015-09-07 10:00:54 +02:00
Martin Schwenke
55df9c86c1 ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X
Also update onnode unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-12-05 21:02:40 +01:00
Martin Schwenke
a04fb43708 tools/ctdb_diagnostics: Add output of "ctdb getdbmap"
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit f0d69a9079b7aecc68f1d2d8510702046b618b19)
2013-08-22 17:00:20 +10:00
Martin Schwenke
6c468c94a2 tools/ctdb_diagnostics: Safer temporary file creation
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 406e1cb1fdd17ddd239774d0228e3657b73ae68f)
2013-08-22 17:00:20 +10:00
Martin Schwenke
7bf693fc1b tools/ctdb_diagnostics: Add "ctdb listvars" output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 2d75a04ba9a2e87a0dcb9bf778c58e335af1871c)
2012-10-18 20:05:43 +11:00
Mathieu Parent
fa197073cd config can be in /etc/default/ instead of /etc/sysconfig/ (ctdb_gnostics part)
(This used to be ctdb commit b6a9dacefd8f031677702f0fbf6b321beb4c4d54)
2011-11-08 16:32:03 +11:00
Martin Schwenke
71b8015ccf Make ctdb_diagnostics more resilient to uncontactable nodes.
Current behaviour is for onnode to timeout (for about 20s) for each
attempted ssh to a down node.  With 40 or 50 invocations of onnode
this takes a long time.

2 changes to work around this:

* If EXTRA_SSH_OPTS (which is passed to ssh by onnode) does not
  contains a ConnectTimeout= setting then add a setting for a 5 second
  timeout.

* Filter the nodes before starting any diagnosis, taking out any "bad
  nodes" that are uncontactable via onnode.

  In the nodes summary at the beginning of the output, print
  information about any "bad nodes".

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 8c3b6427dbaade87e1a0f5590f0894c2e69b31a3)
2011-10-13 14:27:34 +11:00
Ronnie Sahlberg
5b93e0a870 Remove all checking of GPFS from ctdb_diagnostics
CQ S1023524

(This used to be ctdb commit 4cddba08b46db0a56a86b32403a41b89cd097317)
2011-05-11 21:25:25 +10:00
Martin Schwenke
0f18859a6c Add some command-line options to ctdb_diagnostics.
In some contexts ctdb_diagnostics generates too many errors when it is
run on heterogeneous and machine-configured clusters.  In some
clusters some nodes are expected to be differently configured and also
machine-generated configured files can have comments containing
timestamps.

This adds some command-line options that can be used to reduce the
number of errors reported:

    -n <nodes>  Comma separated list of nodes to operate on
    -c          Ignore comment lines (starting with '#') in file comparisons
    -w          Ignore whitespace in file comparisons
    --no-ads    Do not use commands that assume an Active Directory Server

The -n option simply allows ctdb_diagnostics to operate on a subset of
nodes, avoiding file comparisons with and data collection on nodes
that are differently configured.  For file comparisons, instead of
showing each file on the current node and then comparing other nodes
to that file, the file from the first (available or requested) nodes
is shown and then other nodes are compared to that.  That has resulted
in changes in output - that is, ctdb diagnostics no longer prints
messages referencing the current node.

-c and -w are used to weaken comparisons between configuration files.

--no-ads can be used to avoid running ADS-specific commands if a
cluster uses LDAP (or other non-ADS) configuration.

This also fixes a number of bugs in related code:

* A call to onnode was losing the >> NODE ...  << lines because they
  now go to stderr.  This was changed in onnode long ago but
  ctdb_diagnostics was never updated to match.

* ctdb_diagnostics was counting lines in /etc/ctdb/nodes to determine
  what nodes to operate on.  For some time the nodes file has
  supported syntax that makes this invalid.  "ctdb listnodes -Y" is
  now used to list available nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 36c8244a0f68c7c9bbee40982f230e9d14d3c0ea)
2010-08-06 11:10:56 +10:00
Stefan Metzmacher
3d713d9e53 ctdb_diagnostics: don't use hardcoded path to iptables
All event scripts use only the relative path, so we should
here.

Also PATH includes /sbin and /usr/sbin...

metze

(This used to be ctdb commit 20678e1506db1f96b58c326ee91339e797c07c22)
2009-10-26 14:23:09 +11:00
Christian Ambach
8e9736ac1f Remove error messages about a non-existing /var/log/log.ctdb when running ctdb with logging to syslog
(This used to be ctdb commit afdbf3c0df02decd823615134294abf2c8a8a5f3)
2009-05-14 18:59:31 +10:00
Ronnie Sahlberg
4d2195c503 The wbinfo --sequence command has been depreciated in favor of the new
--online-status command

(This used to be ctdb commit b6e34503ac094a274a569a69e3d93d92ad911f4d)
2009-03-19 10:43:57 +11:00
root
4088e0aceb make sure we can collect proper mmfs data
(This used to be ctdb commit 76d655f9aa3ebd39e7a40d0bbd85e40d08f3e90b)
2009-03-12 12:33:19 +11:00
root
7a11082f0f collect net conf list in ctdb_diagnostics
(This used to be ctdb commit 0bb130090b8dce5f85b0cb178a19f877759c0caa)
2007-03-10 14:10:21 +11:00
root
b1e7724eb8 check the static-routes file if it exists
(This used to be ctdb commit 9ce84a7915abaa987160ecbcae63128a9ed0a741)
2007-03-10 13:45:38 +11:00
Andrew Tridgell
371e6aa155 Merge commit 'ronnie/master'
(This used to be ctdb commit 5403ed6dcfdfc101b05b43f83002e720d81b4e38)
2008-10-16 12:58:25 +11:00
Ronnie Sahlberg
6dbeb91e03 From Mathieu Parent
patch to make debian systems log the package versions in
ctdb_diagnostics

(This used to be ctdb commit 07dd4c7d2e8ba10f53d4cf2644fc4b7b8647e286)
2008-10-13 08:21:20 +11:00
Andrew Tridgell
c5edaf7a6e added some more gpfs commands per-filesystem
(This used to be ctdb commit a5d5aa455c7f7eb93d3fa6f403d5b8e0b795109d)
2008-10-09 18:45:12 +11:00
Andrew Tridgell
6cf004e98f expanded ctdb_diagnostics based on recent experience
(This used to be ctdb commit a06abf6bff6c4d379453e5063d8de1a6542c982a)
2008-09-17 21:00:04 +10:00
Andrew Tridgell
d38fbaa38b nicer onnode output
(This used to be ctdb commit ac5c1e090d007bc2e3965589731620b87c0217fb)
2008-01-07 14:31:13 +11:00
Andrew Tridgell
684282f7a1 added bonding info to ctdb_diagnostics
(This used to be ctdb commit 71b5fc434bc5d88eb0669ee29aa932ba12737e07)
2007-10-30 10:18:52 +11:00
Andrew Tridgell
6b9d73a96d more detail on multipath config
(This used to be ctdb commit 78c44f2267cbef5fbc57d56dfd5ff40972733a1f)
2007-10-16 20:13:28 +10:00
Andrew Tridgell
0438b07b53 separate out the various fs display ops
(This used to be ctdb commit dc89e1a428da5d5ca2a9c4988c05de3ea65f00f4)
2007-09-19 11:46:11 +10:00
Andrew Tridgell
bd7eeebe16 expanded ctdb_diagnostics a bit
(This used to be ctdb commit 70a4bb3dc7e624ad778949dbc874c2617fd532e6)
2007-09-17 15:31:33 +10:00
Andrew Tridgell
023b885793 new approach for killing TCP connections on IP release
(This used to be ctdb commit c33a0db29b5604966f582b1f8c5fd66760c72197)
2007-09-13 10:24:48 +10:00
Andrew Tridgell
f3927719c9 add crontab and sysctl output
(This used to be ctdb commit b1b59f3294ee7a5ed6d685f373bf19d3152170fa)
2007-09-10 11:27:07 +10:00
Andrew Tridgell
c572d3c226 added a diagnostics tool for ctdb
(This used to be ctdb commit 032a2238caf688656b00e06bf363182368e037e1)
2007-09-05 14:20:34 +10:00