jablonka.czprosek.czf

mapstats

Subversion Repositories:
[/] [doc/] [index.html] - Rev 9

Compare with Previous - Blame - Download


<html>
<title>Maptats v4.0 AJAX documentation</title>

<body>
<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
<font size="+1"><b>Mapstats v4.0 AJAX documentation</b></font><br>
Computer and Links Statistics<br><br>
<iframe src="../mapstats/index.html" width="910" height="580" border="0" frameborder="no" scrolling="no" allowTransparency="true"></iframe>&nbsp;<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/?p=mapstats">http://www.jklir.net/?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 of 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 on the map (optional)<br>
<a href="#state">name.state</a> - actual state of computers (generated by 
Mapstats 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 can
place as many sites as you want into mapstats directory or create new directory 
with same files. Then just run <i>gen_mapstats</i> and stats will
be gererated. If you want up to date stats, insert <i>gen_mapstats</i> into cron daemon (for example every
5-10 minutes). No spaces in the files ! All files must exists, if you can not use 
noping, 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">

</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 configuration 
part:</b></font><p>
<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
&lt;script type=&quot;text/javascript&quot;&gt;<br>
&lt;!--<br>
<br>
// set full resolution (100%) of map (width and height)<br>
var full_x = 5420;<br>
var full_y = 3696;<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 = 650;<br>
var start_top = 165;<br>
<br>
// set zoom multiple<br>
var eq_mini = 0.2; // 23%<br>
var eq_medi = 0.5; // 50%<br>
var eq_high = 0.7; // 70%<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 = &quot;rgb(0, 200, 0)&quot;;<br>
var wifi_backbone = &quot;rgb(250, 250, 0)&quot;;<br>
var eth_100 = &quot;rgb(173, 216, 230)&quot;;<br>
var fso = &quot;rgb(190, 0, 0)&quot;;<br>
var fso_backup = &quot;rgb(255, 80, 80)&quot;;<br>
var ghz5 = &quot;rgb(200, 200, 200)&quot;;<br>
var ghz10 = &quot;rgb(255, 255, 255)&quot;;<br>
var fiber = &quot;rgb(220, 0, 220)&quot;;<br>
var other = &quot;rgb(0, 0, 250)&quot;;<br>
<br>
// set alpha colors of links<br>
var wifi_client_a = &quot;rgba(0, 200, 0, 0.6)&quot;;<br>
var wifi_backbone_a = &quot;rgba(250, 250, 0, 0.6)&quot;;<br>
var eth_100_a = &quot;rgba(173, 216, 230, 0.6)&quot;;<br>
var fso_a = &quot;rgba(190, 0, 0, 0.6)&quot;;<br>
var fso_backup_a = &quot;rgba(255, 80, 80, 0.6)&quot;;<br>
var ghz5_a = &quot;rgba(200, 200, 200, 0.6)&quot;;<br>
var ghz10_a = &quot;rgba(255, 255, 255, 0.6)&quot;;<br>
var fiber_a = &quot;rgba(220, 0, 220, 0.6)&quot;;<br>
var other_a = &quot;rgba(0, 0, 250, 0.6)&quot;;<br>
<br>
// set names of links<br>
var name1 = &quot;Wifi Client&quot;;<br>
var name2 = &quot;Wifi Backbone&quot;;<br>
var name3 = &quot;Ethernet&quot;;<br>
var name4 = &quot;FSO&quot;;<br>
var name5 = &quot;FSO + Backup&quot;;<br>
var name6 = &quot;5 GHz&quot;;<br>
var name7 = &quot;10 GHz&quot;;<br>
var name8 = &quot;Fiber&quot;;<br>
var name9 = &quot;Other&quot;;<br>
<br>
// set name for link in 
planning (for legend)<br>
var inp = &quot;(InP)&quot;;<br>
<br>
window.onload = function() {<br>
&nbsp;&nbsp;&nbsp; timerMe();<br>
&nbsp;&nbsp;&nbsp; loadFiles();<br>
&nbsp;&nbsp;&nbsp; mapInit(start_mul);<br>
&nbsp;&nbsp;&nbsp; setCheckboxes();<br>
&nbsp;&nbsp;&nbsp; canvasInit(start_mul);<br>
&nbsp;&nbsp;&nbsp; setAutoLoader();<br>
}<br>
<br>
// --&gt;<br>
&lt;/script&gt;</font></p>
<p>
<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
Change it as you wish but be carefull.</font></p>

<p><hr size="1">

<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 (size1 
is the smallest, size4 is the biggest) and one directory with thumbnail of map 
(150 x &lt;count&gt; px). In left top corner is the first rect 
256x256px named &quot;x0y0.jpg&quot;. x is the column and y is the row. Every rect has 
256px 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 PHP 
script which do it all in +- 8 minutes. You only need the biggest map in jpg or png
format and configure the function. I recommend size less then 10000 x 10000px. 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></font></p><br>

<p><hr size="1">

<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 pages is using &lt;iframe&gt; tag</font></p>

<pre id="line77"><font face="Verdana, Arial, Helvetica" color="#000000" size="2">&lt;iframe src=&quot;../mapstats/index.html&quot; width=&quot;910&quot; height=&quot;580&quot; border=&quot;0&quot; frameborder=&quot;no&quot; scrolling=&quot;no&quot; allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;<br></pre>

<hr size="1"><hr size="1">


<a name="nodes"></a>
<font size="3"><b>*.nodes files</b></font><br>
computer_name;position_x;position_y;type;IP_address;e-mail<br>
&nbsp;<p>

<b>computer_name:</b><br>
I don't recommend names with diacritic and special characters. Use entities 
without &quot;;&quot; but be carefull</p>
<p>

<b>position_x:</b><br>
position from the left<br>
<br>

<b>position_y: </b><br>
position from the 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;3163;735;AP;10.32.135.151;example@example.cz<br>
Alderan;1251;1469;Router;10.32.0.146;example@example.cz<br>
WESKR;3391;1377;Router;10.32.0.141;example@example.cz<br>
hapri;3190;2330;Router;10.32.0.142;example@example.cz<br>
Jark;1133;1322;AP;10.32.0.140;example@example.cz<br>
Jelinkova;2044;1214;AP;10.32.0.138;example@example.cz<br>
Tomcat;813;1845;AP;10.32.139.139;example@example.cz<br>
Pospa;3177;1032;AP;10.32.0.131;example@example.cz<br>
Looser;3220;471;AP;10.32.0.135;example@example.cz<br>
Duch;3375;467;Router;10.32.0.157;example@example.cz<br>
Jipe;3318;1500;AP;10.32.0.132;example@example.cz<br>
Passi;3465;1568;Router;10.32.0.134;example@example.cz<br>
Kozel;3681;3279;AP;10.33.0.1;example@example.cz<br>
sluknovska;4778;2048;AP;10.33.0.4;example@example.cz<br>
jabtoc;4857;2407;AP;10.33.0.21;example@example.cz<br>
Jablonecka;5077;2642;AP;10.33.0.2;example@example.cz<br>
Kyselova;2085;2107;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"></a>
<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 entities 
without &quot;;&quot; but be carefull<p>

<b>position_x:</b><br>
position from the left<br>
<br>

<b>position_y: </b><br>
position from the 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 be 
hidden</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;3314;1470;2<br>
Havrankova;2794;794;1</font><br>

</p>

<hr size="1">

<a name="links"></a>
<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 or 
add next points for the link (useful for creating fiber optic link) example: [</a><font face="Verdana, Arial, Helvetica" color="#000000" size="1">Jipe#3189&amp;1481#2574&amp;1699#2630&amp;1863#2537&amp;1898</font>]<a name="config"></a><br>
<br>

<b>link_weight: </b><br>
Client ...</a> tiny line (2.7px)<br>
Backbone ... thick line (4.1px)</p>
<p>

<b>is_inplanning:</b><br>
INP ... yes, link is in planning and draw transparent<br>
NO ... no, link is normal and draw without transparency<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">&nbsp;&nbsp;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">&nbsp;</font></font><font class="form"><font face="Verdana, Arial, Helvetica" color="#F0F0F0" size="2">&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&gt;8<br><br>

<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
<b><i>Example - name.links</i></b><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#Unreal;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#3745&amp;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#3189&amp;1481#2574&amp;1699#2630&amp;1863#2537&amp;1898;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>

<a name="infopoints"></a>
<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>
</a><br>

<b>name_of_point:</b><br>
I don't recommend names with diacritic and special characters. Use entities 
without &quot;;&quot; but be carefull<p>

<b>position_x:</b><br>
position from the left<br>
<br>

<b>position_y: </b><br>
position from the top<br><br>


<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
<b><i>Example - name.infopoints</i></b><br>
Restaurace Na Vyhlidce;1091;1348<br>
Vinarna U Kocoura;1231;1719<br>
Bar Las Vegas;2530;1989<br>
Bar Wild Jack;2453;2041<br>
Restaurace Na Melnicke;3324;983<br>
Pizzerie Trebenicka;3665;1659<br>
Zernosecka;2652;1218<br>
Pizzerie Severka;5098;2678</font></p>

<hr size="1">

<font face="Verdana, Arial, Helvetica" color="#000000" size="2">

<a name="state"></a>
<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)2011 by <a href="http://www.jklir.net">Unreal][</a> &amp; <a href="http://www.mobilnews.cz/honza/calstats">Jan Krupa</a>.<br>
<br>

</font>
</body>
</html>

Powered by WebSVN 2.2.1