Änderungen

Zur Navigation springen Zur Suche springen
63 Bytes hinzugefügt ,  02:16, 1. Okt. 2006
Zeile 96: Zeile 96:  
*'''auf dem Router eine Karte fuer GraphViz generieren'''
 
*'''auf dem Router eine Karte fuer GraphViz generieren'''
 
<pre>
 
<pre>
awk '{if($2=="localhost")s=1;z++;if(z>5){if($0=="")exit;print $1,substr($2,1,length($2)-5)}}END{print "---"}' /etc/hosts|sed -e 's/[^a-zA-Z0-9. ]//g'|awk -F'[. ]' '{print $1"."$2"."$3"."$4,$5"="$3}' >/tmp/dat
+
awk '{if($2=="localhost")s=1;z++;if(z>5){if($0=="")exit;print $1,substr($2,1,length($2)-5)}}END{print "---"}' /etc/hosts|sed -e 's/[^a-zA-Z0-9. ]//g'|awk -F'[. ]' '{print $1"."$2"."$3"."$4,$5""$3}' >/tmp/dat
    
wget -O - http://127.0.0.1:2006|awk '{if(s==1){if($0=="")exit;if($5<10&&$5!="0.00"&&$5<11)print $1,$2,$5};if($2=="Topology")s=1}' >>/tmp/dat
 
wget -O - http://127.0.0.1:2006|awk '{if(s==1){if($0=="")exit;if($5<10&&$5!="0.00"&&$5<11)print $1,$2,$5};if($2=="Topology")s=1}' >>/tmp/dat
   −
awk 'BEGIN{print "graph g {"}{if(s==1){if($3<12){pre="edge[style=";typ="dotted,weight=0] "};if($3<6)typ="dashed,weight=3] ";if($3<4){typ="";pre="edge[weigth=6] "};if($3<2){pre="edge[style=";typ="bold,weight=9] "};print pre""typ""node[$1]" -- "node[$2]";"};if(s!=1){node[$1]=$2};if($1=="---")s=1}END{print "}"}' /tmp/dat >/tmp/g.dot
+
awk 'BEGIN{print "graph g {"}{if(s==1){if($3<12){pre="edge[style=";typ="dotted,weight=0] "};if($3<6)typ="dashed,weight=3] ";if($3<4){typ="";pre="edge[weigth=6] "};if($3<2){pre="edge[style=";typ="bold,weight=9] "};print pre""typ""node[$1]" -- "node[$2]";"};if(s!=1){node[$1]=$2};if($1=="...")s=1}END{print "}"}' /tmp/dat >/tmp/g.dot
 +
 
 +
neato -Goverlap=scale -v -Tjpg -o /tmp/vpnkarte.jpg /tmp/g.dot
 
</pre>
 
</pre>
  

Navigationsmenü