samba-tool visualize for understanding AD DC behaviour
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 9 Aug 2017 23:57:24 +0000 (11:57 +1200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 13 Jan 2018 16:37:07 +0000 (17:37 +0100)
commitc6294c3c7b6c97f15daad7d463bda267726245c7
tree06ab08dda8ab2ee28a8ea78f74d92180d8442f0a
parentba2306f00d32d2fc55685b388e03e28fd7d97fd7
samba-tool visualize for understanding AD DC behaviour

To work out what is happening in a replication graph, it is sometimes
helpful to use visualisations. We introduce a samba-tool subcommand to
write Graphviz dot output and generate text-based heatmaps of the
distance in hops between DCs.

There are two subcommands, two graphical modes, and (roughly) two modes of
operation with respect to the location of authority.

`samba-tool visualize ntdsconn` looks at NTDS Connections.
`samba-tool visualize reps` looks at repsTo and repsFrom objects.

In '--distance' mode (default), the distances between DCs are shown in
a matrix in the terminal. With '--color=yes', this is depicted as a
heatmap. With '--utf8' it is a lttle prettier.

In '--dot' mode, Graphviz dot output is generated. When viewed using
dot or xdot, this shows the network as a graph with DCs as vertices
and connections edges. Certain types of degenerate edges are shown in
different colours or line-styles.

Normally samba-tool talks to one database; with the '-r' (a.k.a.
'--talk-to-remote') option attempts are made to contact all the DCs
known to the first database. This is necessary to get sensible results
from `samba-tool visualize reps` because the repsFrom/To objects are
not replicated, and it can reveal replication issues in other modes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/main.py
python/samba/netcmd/visualize.py [new file with mode: 0644]
python/samba/tests/samba_tool/visualize.py [new file with mode: 0644]
python/samba/tests/samba_tool/visualize_drs.py [new file with mode: 0644]
source4/selftest/tests.py