#!/usr/bin/env python # vim: set fileencoding=UTF-8: # Copyright 2013 Red Hat, Inc. # Author: Jan Pokorný # Distributed under GPLv2+; generated content under CC-BY-SA 3.0 # (to view a copy, visit http://creativecommons.org/licenses/by-sa/3.0/) """Model of cman-based cluster capturing deployment, communication, etc. By default, output is a PDF file named as per this script modulo extension. Generally, you can specify arbitrary format/extension supported by graphviz as a first parameter and you'll get what you ask for, including original '.dot' file for further utilization. If you generate mere dot file (./overview.py dot), you can view it conveniently using XDot: http://code.google.com/p/jrfonseca/wiki/XDot """ from sys import argv from os.path import splitext from lib import * FONT = 'Inconsolata' FONTDEF = map(lambda switch: '-' + switch + 'fontname=' + FONT, "GNE") BLACKLIST = [] #BLACKLIST = [Daemon] OUTPUT = splitext(__file__)[0] graph = lambda: \ LibDot('Cluster.conf-related tools', overlap='scalexy', compound='true', splines='yes', # , ranksep='1.2', _subgraphs=[ # management client SubgraphStandard('cluster-climgmt', label='management client', _nodes=[ Executable('luci'), Executable('ccs'), ] ), # other monitoring SubgraphStandard('cluster-monitor', label='other monitoring', _nodes=[ Executable('snmpwalk'), Executable('wbemcli'), ] ), # nodes SubgraphInvisible('cluster-nodes', _subgraphs=[ # node c - general SubgraphImportant('cluster-node_c', label='NODE C', _subgraphs=[ # node c - management SubgraphStandard('cluster-node_c-conga', label='management (incomplete)', _nodes=[ Daemon('node_c-ricci', label='ricci'), Daemon('node_c-modclusterd', label='modclusterd') ] ) ] ), # node b - detailed SubgraphImportant('cluster-node_b', label='NODE B', _subgraphs=[ # node b - management SubgraphStandard('cluster-node_b-conga', label='management', _nodes=[ Agent('node_b-libClusterMonitorSnmp.so', label='libClusterMonitorSnmp.so'), Agent('node_b-libRedHatClusterProvider.so', label='libRedHatClusterProvider.so'), Artefact('node_b-clumond.sock', label='/var/run/clumond.sock'), Daemon('node_b-ricci', label='ricci'), Daemon('node_b-modclusterd', label='modclusterd'), Executable('node_b-modcluster', label='modcluster'), ], _edges=[ Consume('node_b-libClusterMonitorSnmp.so', 'node_b-clumond.sock'), Consume('node_b-libRedHatClusterProvider.so', 'node_b-clumond.sock'), Consume('node_b-modcluster', 'node_b-clumond.sock'), Produce('node_b-modclusterd', 'node_b-clumond.sock'), ] ), # node b - core SubgraphStandard('cluster-node_b-core', label='core', _nodes=[ Library('node_b-libccsconfdb', label='libccsconfdb'), Daemon('node_b-rgmanager', label='rgmanager'), Executable('node_b-clustat', label='clustat'), Artefact('node_b-rgmanager.sk', label='/var/run/cluster/rgmanager.sk'), ], _edges=[ Consume('node_b-clustat', 'node_b-rgmanager.sk'), Consume('node_b-rgmanager', 'node_b-libccsconfdb'), Produce('node_b-rgmanager', 'node_b-rgmanager.sk'), ] ) ], _nodes=[ Artefact('node_b-cluster.conf', label='/etc/cluster/cluster.conf'), Daemon('node_b-snmpd', label='snmpd'), Daemon('node_b-cimserver', label='cimserver'), ], _edges=[ Consume('node_b-modcluster', 'node_b-cluster.conf', label='version?'), Consume('node_b-modclusterd', 'node_b-cluster.conf', label='version?'), Consume('node_b-libccsconfdb', 'node_b-cluster.conf', label='version?'), Consume('node_b-ricci', 'node_b-cluster.conf', label='clustername\nclusteralias'), Consume('node_b-snmpd', 'node_b-libClusterMonitorSnmp.so'), Consume('node_b-cimserver', 'node_b-libRedHatClusterProvider.so'), DelegateOddjobExec('node_b-ricci', 'node_b-modcluster'), ] ), # node a - general SubgraphImportant('cluster-node_a', label='NODE A', _subgraphs=[ # node a - management SubgraphStandard('cluster-node_a-conga', label='management (incomplete)', _nodes=[ Daemon('node_a-ricci', label='ricci'), Daemon('node_a-modclusterd', label='modclusterd'), ] ) ] ), ] ), ], _nodes=[ Executable('firefox') ], _edges=[ DelegateRICCIRPC('luci', 'node_a-ricci', ltail='cluster-climgmt', constraint='false'), DelegateRICCIRPC('luci', 'node_b-ricci', ltail='cluster-climgmt'), DelegateRICCIRPC('luci', 'node_c-ricci', ltail='cluster-climgmt', constraint='false'), DelegateLuciHTTPS('firefox', 'luci'), DelegateSNMP('snmpwalk', 'node_b-snmpd'), DelegateCIM('wbemcli', 'node_b-cimserver'), Exchange('node_a-modclusterd', 'node_b-modclusterd', label='port 16851 (either direction)', constraint='false'), Exchange('node_a-modclusterd', 'node_c-modclusterd', label='port 16851 (either direction)', constraint='false'), Exchange('node_b-modclusterd', 'node_c-modclusterd', label='port 16851 (either direction)', constraint='false'), ] ) ### if __name__ == '__main__': main(graph, argv, *FONTDEF, blacklist=BLACKLIST, output=OUTPUT)