![]() ![]() |
mapstats |
Subversion Repositories: |
Compare with Previous - Blame - Download
<html><title>Maptats v3.0 AJAX documentation</title><body><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><font size="+1"><b>Mapstats v3.0 AJAX documentation</b></font><br>Computer and Links Statistics<br><br><object data="../index.html" type="text/html" width="930" height="600" border="0" style="overflow:hidden; _width:910px;"></object> <hr size="1"><font size="3"><b>Basic information</b></font><br>First of all check out Mapstats homepage if there is newer version available:<br><a href="http://www.jklir.net/jklir_soubory2/index.php3?p=mapstats">http://www.jklir.net/jklir_soubory2/index.php3?p=mapstats</a><br><br>Every site stat consist of four to five files. So our testing example will consist of those files:<br><a href="#nodes">name.nodes</a> - list od computers<br><a href="#noping">name.noping</a> - list of computers which you can not ping.<br><a href="#links">name.links</a> - list of links between nodes (optional)<br><a href="#infopoints">name.infopoints</a> - list of info points at map (optional)<br><a href="#state">name.state</a> - actual state of computers (generated byMapStats script)<br><br><br>You need to create <i>*.nodes</i> , <i>*.noping</i> and <i>*.links </i> file(s) for every site stat. You canplace as many sites as you want into mapstats directory or create new directorywith same files. Then just run <i>gen_mapstats</i> and stats willbe gererated. If you want up to date stats, insert <i>gen_mapstats</i> into cron daemon (for example every5-10 minutes). No spaces in the files ! All files must exists, if you can not usenoping, links or infopoints files you must delete content inside<br><br></p><hr size="1"><font size="3"><b>Installation</b></font><br><br><b>These programs must be available in the system:</b> awk<br><ul><li>unpack the archive</li><li>move maptats directory to your www directory (or somewhere you want to use it in)</li><li>change path, directories and configuration in 'gen_mapstats'</li><li>if you have fping installed change STATS_TYPE from 'ping' to 'fping' (<a href="http://www.fping.com">www.fping.com</a>) for faster stats generation</li><li>if you have nmap installed change STATS_TYPE from 'ping' to 'nmap' (<a href="http://www.insecure.org/nmap/">www.insecure.org/nmap/</a>) for faster stats generation</li><li>run 'gen_mapstats' to test the configuration</li><li>edit 'name.*' files to match your configuration (sample files are included)</li><li>add 'gen_mapstats' to cron if you want to generate statistics periodically</li></ul><hr size="1"><br></font><b><font face="Verdana, Arial, Helvetica" color="#000000">Configuration</font></b><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br><br><b>open index.html in text editor for configuration. There is configurationpart:</b></font><p><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><script type="text/javascript"><br><!--<br><br>// set full resolution (100%) of map (width and height)<br>var full_x = 3100;<br>var full_y = 2230;<br><br>// set outerDiv resolution (width and height)<br>var inres_x = 700;<br>var inres_y = 500;<br><br>// set magnifier resolution (width and height)<br>var magres_x = 150;<br>var magres_y = parseInt(full_y / (full_x / magres_x));<br><br>// set start position (from left and top)<br>var start_left = 110;<br>var start_top = 50;<br><br>// set zoom multiple<br>var eq_mini = 0.33; // 33%<br>var eq_medi = 0.5; // 50%<br>var eq_high = 0.66; // 66%<br>var eq_orig = 1; // 100%<br><br>// set start multiple<br>var start_mul = eq_mini;<br><br>// set displayed functions<br>var ch_ap = true;<br>var ch_router = true;<br>var ch_node = true;<br>var ch_infopoint = true;<br>var ch_noping = true;<br>var ch_legend = true;<br>var ch_name = true;<br>var ch_ip = true;<br>var ch_status = true;<br>var ch_backbone = true;<br>var ch_client = true;<br>var ch_inp = true;<br><br>// set source data<br>var nodes = 'name.nodes';<br>var noping = 'name.noping';<br>var links = 'name.links';<br>var infopoints = 'name.infopoints';<br>var state = 'name.state';<br><br>// set colors of links<br>var wifi_client = "rgb(0, 200, 0)";<br>var wifi_backbone = "rgb(250, 250, 0)";<br>var eth_100 = "rgb(173, 216, 230)";<br>var fso = "rgb(190, 0, 0)";<br>var fso_backup = "rgb(255, 80, 80)";<br>var ghz5 = "rgb(200, 200, 200)";<br>var ghz10 = "rgb(255, 255, 255)";<br>var fiber = "rgb(220, 0, 220)";<br>var other = "rgb(0, 0, 250)";<br><br>// set alpha colors of links<br>var wifi_client_a = "rgba(0, 200, 0, 0.6)";<br>var wifi_backbone_a = "rgba(250, 250, 0, 0.6)";<br>var eth_100_a = "rgba(173, 216, 230, 0.6)";<br>var fso_a = "rgba(190, 0, 0, 0.6)";<br>var fso_backup_a = "rgba(255, 80, 80, 0.6)";<br>var ghz5_a = "rgba(200, 200, 200, 0.6)";<br>var ghz10_a = "rgba(255, 255, 255, 0.6)";<br>var fiber_a = "rgba(220, 0, 220, 0.6)";<br>var other_a = "rgba(0, 0, 250, 0.6)";<br><br>// set names of links<br>var name1 = "Wifi Client";<br>var name2 = "Wifi Backbone";<br>var name3 = "Ethernet";<br>var name4 = "FSO";<br>var name5 = "FSO + Backup";<br>var name6 = "5 GHz";<br>var name7 = "10 GHz";<br>var name8 = "Fiber";<br>var name9 = "Other";<br><br>// set name for link in planning (for legend)<br>var inp = "(InP)";<br><br>// Let's start it<br>window.onload = function() {<br>nactiSoubory();<br>mapInit(start_mul);<br>nastavCheck();<br>canvasInit(start_mul);<br>timerMe();<br>}<br><br>// --><br></script></font></p><p><font face="Verdana, Arial, Helvetica" color="#000000" size="2">Change it as you wish but be carefull.</p><hr size="1"></font><p><font face="Verdana, Arial, Helvetica" color="#000000"><b>Create map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br><br>You need create you own map. There is 4 scales includes map rects inside (size1is the smallest, size4 is the biggest) and one directory with thumbnail of map(150 x <count> px). In left top corner is the first rect256x256px named "x0y0.jpg". x is column and y is row. Every rect has256px width and 256px height. If the width or height of rect is less then 256px,the rect will be smaller. The creation is very hard, so I wrote little PHPscript which do it all in +- 3 minutes! You only need the biggest map in jpgformat and configure the function. I recommend size less then 5000 x 5000px. You can download it from <a href="http://www.jklir.net/jklir_soubory2/odkazy/map_cutter.zip">http://www.jklir.net/jklir_soubory2/odkazy/map_cutter.zip</a></p><br><hr size="1"></font><p><font face="Verdana, Arial, Helvetica" color="#000000"><b>Display map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br><br>The easiest way to display map in existing page is using <object> tag (butIE display only white background color)</font></p><pre id="line77"><font face="Verdana, Arial, Helvetica"><object data="mapstats/index.html" type="text/html" width="930" height="600" border="0" style="overflow:hidden; _width:910px;"></object></font></pre><pre id="line77"><font face="Verdana, Arial, Helvetica">(<iframe> tag has problems on IE [some points doesnt draw on the start])</font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br><br></pre><hr size="1"><a name="nodes"><font size="3"><b>*.nodes files</b></font><br>computer_name;position_x;position_y;type;IP_address;e-mail<br> <p><b>computer_name:</b><br>I dont recommend names with diacritic and special characters. Use entitieswithout ";" but be very carefull</p><p><b>position_x:</b><br>position from left<br><br><b>position_y: </b><br>position from top</p><p><b>type:</b><BR>AP ... display status, IP address and name with point and waves<br>Router ... display status and name with point<br>Client ... display only name and point</p><p><b>IP address:</b><BR>Insert IP address of node, no DNS</p><p><b>e-mail:</b><br>Administrator's contact</a> for notification (not work yet - TODO)</p><p><font face="Verdana, Arial, Helvetica" color="#000000" size="1"><b><i>Example - name.nodes</i></b><br>Unreal;1928;451;Client;10.32.135.151;example@example.cz<br>Alderan;764;876;Router;10.32.0.146;example@example.cz<br>WESKR;2044;819;Router;10.32.0.141;example@example.cz<br>hapri;1935;1407;Router;10.32.0.142;example@example.cz<br>Jark;698;792;AP;10.32.0.140;example@example.cz<br>Jelinkova;1246;735;AP;10.32.0.138;example@example.cz<br>Tomcat;499;1098;AP;10.32.139.139;example@example.cz<br>Pospa;1931;628;AP;10.32.0.131;example@example.cz<br>Looser;1962;286;AP;10.32.0.135;example@example.cz<br>Duch;2058;282;Router;10.32.0.157;example@example.cz<br>Jipe;2022;923;AP;10.32.0.132;example@example.cz<br>Passi;2090;942;Router;10.32.0.134;example@example.cz<br>Kozel;2233;1983;AP;10.33.0.1;example@example.cz<br>sluknovska;2897;1239;AP;10.33.0.4;example@example.cz<br>jabtoc;2935;1447;AP;10.33.0.21;example@example.cz<br>Jablonecka;3070;1593;AP;10.33.0.2;example@example.cz<br>Kyselova;1272;1285;AP;10.32.0.147;example@example.cz</font></font></p><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><hr size="1"><a name="noping"><font size="3"><b>*.noping files</b></font><br>computer_name;position_x;position_y;type<br><br></a><b>computer_name<a name="config">:</a></b><a name="config"><br>I dont recommend names with diacritic and special characters. Use entitieswithout ";" but be very carefull<p><b>position_x:</b><br>position from left<br><br><b>position_y: </b><br>position from top</a></p><p><b>type:</b><br>1 ... Client<br>2 ... Switch<a name="comp"><br><br>If type = 1 the computer_name will show<br>If type = 2 the computer_name will behidden</a></p><p>Noping file(s) is for computers which you can not ping<a name="comp"><br><br><font face="Verdana, Arial, Helvetica" color="#000000" size="1"><b><i>Example - name.noping</i></b><br>Switch_jipe;2015;891;2<br>Havrankova;1705;475;1</font><br></p><hr size="1"><a name="links"><font size="3"><b>*.links files</b></font><br>from_name#to_name;link_weight;is_inplanning;type_of_link<p><b>from_name#to_name:</b><br>Put names from nodes or noping file. You can change the name to coordinates oradd next points for the link (useful for creating fiber optic link) example: [</a><font face="Verdana, Arial, Helvetica" color="#000000" size="1">Jipe#1949&931#1928&900#1563&1027#1594&1124#1531&1149</font>]<a name="config"><br><br><b>link_weight: </b><br>Client ...</a> tiny line (3px)<br>Backbone ... thick line (4.5px)</p><p><b>is_inplanning:</b><br>INP ... yes, link id in planning and display transparent<br>NO ... no, link isnormal and dont display transparent<br><br><b>type of link:</b><a name="link"><br><b><font class="form" color="#00c800">WiFi Client</font><font class="form">,</font><font class="form" color="#fafa00"> WiFi Backbone</font><font class="form">,</font></b><b><font class="form" color="#64c8ff">ETH</font><font class="form">,</font><font class="form" color="#64c8ff"></font><font class="form" color="#be0000">FSO</font><font class="form">,</font><font class="form" color="#ff5050"> FSO+ WiFi</font><font class="form">,</font></b> <b><font class="form" color="#c8c8c8">5Ghz</font></b></font><b><font face="Verdana, Arial, Helvetica" size="2">,</font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><font class="form"> </font></font><font class="form"><font face="Verdana, Arial, Helvetica" color="#F0F0F0" size="2"> 10Ghz</font><font face="Verdana, Arial, Helvetica" size="2">,</font></font></b><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><font face="Verdana, Arial, Helvetica" color="#F0F0F0" size="2"></font><b><font class="form" color="#dc00dc">Fiber</font><font class="form">,</font><font class="form" color="#dc00dc"></font><font class="form" color="#0000fa">Other</font></b><br> 1 2 3 4 5 6 7 8 >8<br><br><font face="Verdana, Arial, Helvetica" color="#000000" size="1"><b><i>Example - name.links</i></b><br>Looser#Unreal;Client;NO;1<br>Havrankova#Jipe;Client;NO;1<br>Jelinkova#Pospa;Backbone;NO;2<br>Jelinkova#Tomcat;Backbone;NO;2<br>Jelinkova#Alderan;Backbone;NO;2<br>Jark#Alderan;Backbone;NO;2<br>Jipe#Passi;Backbone;NO;2<br>jabtoc#Jablonecka;Backbone;NO;3<br>Kyselova#Jark;Backbone;NO;6<br>Looser#Duch;Backbone;NO;6<br>Looser#WESKR;Backbone;NO;6<br>Jelinkova#WESKR;Backbone;NO;6<br>Duch#Jipe;Backbone;NO;6<br>Duch#2350&0;Backbone;NO;6<br>Jipe#Jablonecka;Backbone;NO;6<br>sluknovska#Duch;Backbone;NO;6<br>sluknovska#jabtoc;Backbone;NO;6<br>Kyselova#Kozel;Backbone;NO;6<br>Jelinkova#Kyselova;Backbone;NO;6<br>Jipe#1949&931#1928&900#1563&1027#1594&1124#1531&1149;Backbone;INP;8<br>hapri#Jipe;Client;INP;1<br>Switch_jipe#Pospa;Backbone;NO;6<br>Switch_jipe#Jipe;Backbone;NO;3</font></p></p><hr size="1"></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"></font><a name="infopoints"><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><font size="3"><b>*.infopoints files</b></font><br>name_of_point;position_x;position_y<br></font></a><br><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><b>name_of_point:</b><br>I dont recommend names with diacritic and special characters. Use entitieswithout ";" but be very carefull<p><b>position_x:</b><br>position from left<br><br><b>position_y: </b><br>position from top<br><br><font face="Verdana, Arial, Helvetica" color="#000000" size="1"><b><i>Example - name.infopoints</i></b><br></font></font><font face="Verdana, Arial, Helvetica" size="1">Restaurace NaVyhlidce;673;804<br>Vinarna U Kocoura;762;1054<br>Bar Las Vegas;1536;1198<br>Bar Wild Jack;1490;1228<br>Restaurace Na Melnicke;2021;600<br>Zernosecka;1614;736</font></p><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><hr size="1"></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><a name="state"><font size="3"><b>*.state files</b></font><br>ip_address;number_of_pings_received(if >0 => computer is green, otherwise red);latency<br><br><font face="Verdana, Arial, Helvetica" color="#000000" size="1"><b><i>Example - name.state</i></b><br>10.32.135.151;1;2.684<br>10.32.0.146;1;3.539<br>10.32.0.141;1;1.085<br>10.32.0.142;0;0<br>10.32.0.140;1;3.385<br>10.32.0.138;1;1.818<br>10.32.139.139;0;0<br>10.32.0.131;1;1.593<br>10.32.0.135;1;0.540<br>10.32.0.157;1;0.180<br>10.32.0.132;1;1.208<br>10.32.0.134;0;0<br>10.33.0.1;1;2.757<br>10.33.0.4;1;1.065<br>10.33.0.21;1;2.257<br>10.33.0.2;1;2.050<br>10.32.0.147;1;2.555<br><br></font><br><hr size="1">(c)2008 by <a href="http://www.jklir.net">Unreal][</a> & <a href="http://www.mobilnews.cz/honza/en_prog_linux_calstats.php">Jan Krupa</a>.<br><br></font></body></html>