Traceroute to Graphviz: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
(New page: Traceroute from various places to your destination, dump the resu;ts to a file. then awk it up yo! <pre> awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$...) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Traceroute from various places to your destination, dump the | Traceroute from various places to your destination, dump the results to a file. | ||
then awk it up yo! | then awk it up yo! | ||
Line 15: | Line 15: | ||
</pre> | </pre> | ||
send all this awk output to a file, then wrap it in a graphviz header, and close the graph... then run graphviz on it... and .. well voila pending. | |||
( | for vi find replace: | ||
:s:^:awk '{if ( length(last) > 0 \&\& ( $2 != "*" ) ) {print "\\"" last "\\"->\\"" $3"\\\\n"$2"\\" [ color=\\":g | |||
:s:<control-v><tab>:\\"];"} ; last=$3"\\\\n"$2}' :g | |||
escapes are escaped, sigh. |
Latest revision as of 15:30, 29 June 2012
Traceroute from various places to your destination, dump the results to a file.
then awk it up yo!
awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"red\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"green\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"blue\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"black\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"orange\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"salmon\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"yellow\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"darkgreen\"];"} ; last=$3"\\n"$2}' trace1.out awk '{if ( length(last) > 0 && ( $2 != "*" ) ) {print "\"" last "\"->\"" $3"\\n"$2"\" [ color=\"thistle2\"];"} ; last=$3"\\n"$2}' trace1.out
send all this awk output to a file, then wrap it in a graphviz header, and close the graph... then run graphviz on it... and .. well voila pending.
for vi find replace:
- s:^:awk '{if ( length(last) > 0 \&\& ( $2 != "*" ) ) {print "\\"" last "\\"->\\"" $3"\\\\n"$2"\\" [ color=\\":g
- s:<control-v><tab>:\\"];"} ; last=$3"\\\\n"$2}' :g
escapes are escaped, sigh.