Tinc graph and label info.

Claus Strasburger nixnick at online.de
Thu Mar 24 13:39:55 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

for this purpose, I have written a small php script that uses sed to
renew the graph every time it is changed.
it copies the graph file and changes some nodes with a static file that
is copied after the tinc file and one before.

script:

function checkgraph() {
        $graphviz="neato";

        if (
            (!file_exists("graph.png")) ||
            (!file_exists("tinctmp")) ||
            (filemtime("/tmp/tincgraph") > filemtime("graph.png")) ||
            (filemtime("graph.changes") > filemtime("graph.png"))
        ) {
            exec("echo \"digraph {\" > tinctmp");
            exec("cat graph.changes >> tinctmp");
            exec("cat /tmp/tincgraph | sed -e '1d' | sed -e '\$d'>>
tinctmp");
	    exec("cat \"graph.shortness\">>tinctmp");
            exec("echo \"}\">>tinctmp");
            exec("$graphviz  -Tpng tinctmp -o graph.png -Kneato");
        }
    }


graph.changes:

graph [overlap=false, splines=true, size=7, sep=".7"];
        node [style=filled, color="#000000", fontname=Arial];
        node [shape="ellipse", fillcolor="#C4FFC4", fontsize="15"];
        q**** [fillcolor = "#00FF00", fontsize="19"];
        g*** [fillcolor = "#00FF00", fontsize="19"];
        d***** [fillcolor = "#55ff55", fontsize="16"];
        t***** [fillcolor = "#55ff55", fontsize="16"]; ///these are our
main nodes, they have different color and fontsize

graph.shortness:

de***long name****p [label="short name"];
h****long name*****bi [label="short name"];
h****long name*****il [label="short name"];
h****long name*****ven [label="short name"];

you could also change the node names to meaningful ones ;D

Hope this helped,

Claus Strasburger

Am 23.03.2011 22:16, schrieb Perry Couprie:
> Hi,
>
> I use tinc with the option GraphDumpFile=/etc/tinc/ci00036/grapd.dot
>
> In the graph there is the label section:
>
>     ci00036 [label = "ci00036"];
>     ci00037 [label = "ci00037"];
>     ci00038 [label = "ci00038"];
>
> Is there an option to set the label in the tinc config file or host file
> to a custom text ?
> Something that is easy to read and has some meaning instead of the node
> name ?
>
> Perry
>
> _______________________________________________
> tinc mailing list
> tinc at tinc-vpn.org
> http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNizubAAoJEKpNDuWwSADOnw8H/0//Kcai7DjG0dNXd2IG+4kr
ebZPyvy24wqX50EAHwBphgQKLGQchrnh7I4BId66XYtCDTCkhQ8klAmQE/VdyJju
qrytgIqDC/MzQu/JN98guL6hkTxvO8GJjAZhjDMhLNu7U8rn/e59sI4qPqjr7DgF
1107biOErJHqv0Aiokl7p4wIKVT7UQFvi/SkAv2T7uafMtUcCX7kVuUxUkI2TxC7
XDN2wW8b8GsCYfMz3vPDK//V1wqwYqpxJRVrtpar0aKFP0DoJdDyy/4o2BJJB7Ij
y46qSv9C3zxKBxQozY4DxyXsge+Cot+tvHO1xCvV5AJsLQj2G7DCKF9PuN5p48o=
=4LS+
-----END PGP SIGNATURE-----


More information about the tinc mailing list