jablonka.czprosek.czf

mapstats

Subversion Repositories:
[/] [doc/] [index.html] - Blame information for rev 10

 

Line No. Rev Author Line
11unreal<html>
29unreal<title>Maptats v4.0 AJAX documentation</title>
31unreal 
4<body>
5<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
69unreal<font size="+1"><b>Mapstats v4.0 AJAX documentation</b></font><br>
71unrealComputer and Links Statistics<br><br>
89unreal<iframe src="../mapstats/index.html" width="910" height="580" border="0" frameborder="no" scrolling="no" allowTransparency="true"></iframe>&nbsp;<hr size="1">
91unreal 
10<font size="3"><b>Basic information</b></font><br>
11First of all check out Mapstats homepage if there is newer version available:<br>
129unreal<a href="http://www.jklir.net/?p=mapstats">http://www.jklir.net/?p=mapstats</a><br>
131unreal<br>
14 
15Every site stat consist of four to five files. So our testing example will consist of those files:<br>
169unreal<a href="#nodes">name.nodes</a> - list of computers<br>
171unreal<a href="#noping">name.noping</a> - list of computers which you can not ping.<br>
18<a href="#links">name.links</a> - list of links between nodes (optional)<br>
199unreal<a href="#infopoints">name.infopoints</a> - list of info points on the map (optional)<br>
201unreal<a href="#state">name.state</a> - actual state of computers (generated by
219unrealMapstats script)<br>
221unreal<br>
23<br>
24 
25You need to create <i>*.nodes</i> , <i>*.noping</i> and <i>*.links </i> file(s) for every site stat. You can
26place as many sites as you want into mapstats directory or create new directory
27with same files. Then just run <i>gen_mapstats</i> and stats will
28be gererated. If you want up to date stats, insert <i>gen_mapstats</i> into cron daemon (for example every
295-10 minutes). No spaces in the files ! All files must exists, if you can not use
30noping, links or infopoints files you must delete content inside<br>
31<br>
32 
33</p>
34 
35<hr size="1">
36 
37<font size="3"><b>Installation</b></font><br>
38<br>
39 
40<b>These programs must be available in the system:</b> awk<br>
41<ul>
42<li>unpack the archive</li>
43<li>move maptats directory to your www directory (or somewhere you want to use it in)</li>
44<li>change path, directories and configuration in 'gen_mapstats'</li>
45<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>
46<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>
47<li>run 'gen_mapstats' to test the configuration</li>
48<li>edit 'name.*' files to match your configuration (sample files are included)</li>
49<li>add 'gen_mapstats' to cron if you want to generate statistics periodically</li>
50</ul>
51 
52<hr size="1">
53 
54</font><b>
55<font face="Verdana, Arial, Helvetica" color="#000000">
56Configuration</font></b><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br>
57<br>
58 
59<b>open index.html in text editor for configuration. There is configuration
60part:</b></font><p>
61<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
62&lt;script type=&quot;text/javascript&quot;&gt;<br>
63&lt;!--<br>
64<br>
65// set full resolution (100%) of map (width and height)<br>
669unrealvar full_x = 5420;<br>
67var full_y = 3696;<br>
681unreal<br>
69// set outerDiv resolution (width and height)<br>
70var inres_x = 700;<br>
71var inres_y = 500;<br>
72<br>
73// set magnifier resolution (width and height)<br>
74var magres_x = 150;<br>
75var magres_y = parseInt(full_y / (full_x / magres_x));<br>
76<br>
77// set start position (from left and top)<br>
789unrealvar start_left = 650;<br>
79var start_top = 165;<br>
801unreal<br>
81// set zoom multiple<br>
829unrealvar eq_mini = 0.2; // 23%<br>
831unrealvar eq_medi = 0.5; // 50%<br>
849unrealvar eq_high = 0.7; // 70%<br>
85var eq_orig = 1; // 100%<br>
861unreal<br>
87// set start multiple<br>
88var start_mul = eq_mini;<br>
89<br>
90// set displayed functions<br>
91var ch_ap = true;<br>
92var ch_router = true;<br>
93var ch_node = true;<br>
94var ch_infopoint = true;<br>
95var ch_noping = true;<br>
96var ch_legend = true;<br>
97var ch_name = true;<br>
98var ch_ip = true;<br>
99var ch_status = true;<br>
100var ch_backbone = true;<br>
101var ch_client = true;<br>
102var ch_inp = true;<br>
103<br>
104// set source data<br>
105var nodes = 'name.nodes';<br>
106var noping = 'name.noping';<br>
107var links = 'name.links';<br>
108var infopoints = 'name.infopoints';<br>
109var state = 'name.state';<br>
110<br>
111// set colors of links<br>
112var wifi_client = &quot;rgb(0, 200, 0)&quot;;<br>
113var wifi_backbone = &quot;rgb(250, 250, 0)&quot;;<br>
114var eth_100 = &quot;rgb(173, 216, 230)&quot;;<br>
115var fso = &quot;rgb(190, 0, 0)&quot;;<br>
116var fso_backup = &quot;rgb(255, 80, 80)&quot;;<br>
117var ghz5 = &quot;rgb(200, 200, 200)&quot;;<br>
118var ghz10 = &quot;rgb(255, 255, 255)&quot;;<br>
119var fiber = &quot;rgb(220, 0, 220)&quot;;<br>
120var other = &quot;rgb(0, 0, 250)&quot;;<br>
121<br>
122// set alpha colors of links<br>
123var wifi_client_a = &quot;rgba(0, 200, 0, 0.6)&quot;;<br>
124var wifi_backbone_a = &quot;rgba(250, 250, 0, 0.6)&quot;;<br>
125var eth_100_a = &quot;rgba(173, 216, 230, 0.6)&quot;;<br>
126var fso_a = &quot;rgba(190, 0, 0, 0.6)&quot;;<br>
127var fso_backup_a = &quot;rgba(255, 80, 80, 0.6)&quot;;<br>
128var ghz5_a = &quot;rgba(200, 200, 200, 0.6)&quot;;<br>
129var ghz10_a = &quot;rgba(255, 255, 255, 0.6)&quot;;<br>
130var fiber_a = &quot;rgba(220, 0, 220, 0.6)&quot;;<br>
131var other_a = &quot;rgba(0, 0, 250, 0.6)&quot;;<br>
132<br>
133// set names of links<br>
134var name1 = &quot;Wifi Client&quot;;<br>
135var name2 = &quot;Wifi Backbone&quot;;<br>
136var name3 = &quot;Ethernet&quot;;<br>
137var name4 = &quot;FSO&quot;;<br>
138var name5 = &quot;FSO + Backup&quot;;<br>
139var name6 = &quot;5 GHz&quot;;<br>
140var name7 = &quot;10 GHz&quot;;<br>
141var name8 = &quot;Fiber&quot;;<br>
142var name9 = &quot;Other&quot;;<br>
143<br>
1449unreal// set name for link in
145planning (for legend)<br>
1461unrealvar inp = &quot;(InP)&quot;;<br>
147<br>
148window.onload = function() {<br>
1499unreal&nbsp;&nbsp;&nbsp; timerMe();<br>
150&nbsp;&nbsp;&nbsp; loadFiles();<br>
151&nbsp;&nbsp;&nbsp; mapInit(start_mul);<br>
152&nbsp;&nbsp;&nbsp; setCheckboxes();<br>
153&nbsp;&nbsp;&nbsp; canvasInit(start_mul);<br>
154&nbsp;&nbsp;&nbsp; setAutoLoader();<br>
1551unreal}<br>
156<br>
157// --&gt;<br>
158&lt;/script&gt;</font></p>
159<p>
160<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
1619unrealChange it as you wish but be carefull.</font></p>
1621unreal 
1639unreal<p><hr size="1">
1641unreal 
165<font face="Verdana, Arial, Helvetica" color="#000000">
166<b>Create map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br>
167<br>
168 
169You need create you own map. There is 4 scales includes map rects inside (size1
170is the smallest, size4 is the biggest) and one directory with thumbnail of map
171(150 x &lt;count&gt; px). In left top corner is the first rect
1729unreal256x256px named &quot;x0y0.jpg&quot;. x is the column and y is the row. Every rect has
1731unreal256px width and 256px height. If the width or height of rect is less then 256px,
174the rect will be smaller. The creation is very hard, so I wrote little PHP
1759unrealscript which do it all in +- 8 minutes. You only need the biggest map in jpg or png
176format 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>
1771unreal 
1789unreal<p><hr size="1">
1791unreal 
180<font face="Verdana, Arial, Helvetica" color="#000000"><b>Display map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br>
181<br>
182 
1839unrealThe easiest way to display map in existing pages is using &lt;iframe&gt; tag</font></p>
1841unreal 
1859unreal<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>
1861unreal 
1879unreal<hr size="1"><hr size="1">
1881unreal 
189 
1909unreal<a name="nodes"></a>
1911unreal<font size="3"><b>*.nodes files</b></font><br>
192computer_name;position_x;position_y;type;IP_address;e-mail<br>
193&nbsp;<p>
194 
195<b>computer_name:</b><br>
1969unrealI don't recommend names with diacritic and special characters. Use entities
197without &quot;;&quot; but be carefull</p>
1981unreal<p>
199 
200<b>position_x:</b><br>
2019unrealposition from the left<br>
2021unreal<br>
203 
204<b>position_y: </b><br>
2059unrealposition from the top</p>
2061unreal<p>
207 
208<b>type:</b><BR>
209AP ... display status, IP address and name with point and waves<br>
210Router ... display status and name with point<br>
211Client ... display only name and point
212</p>
213<p>
214 
215<b>IP address:</b><BR>
216Insert IP address of node, no DNS</p>
217<p>
218 
219<b>e-mail:</b><br>
220Administrator's contact</a> for notification (not work yet - TODO)</p>
221 
222<p>
223 
224<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
225<b><i>Example - name.nodes</i></b><br>
2269unrealUnreal;3163;735;AP;10.32.135.151;example@example.cz<br>
227Alderan;1251;1469;Router;10.32.0.146;example@example.cz<br>
228WESKR;3391;1377;Router;10.32.0.141;example@example.cz<br>
229hapri;3190;2330;Router;10.32.0.142;example@example.cz<br>
230Jark;1133;1322;AP;10.32.0.140;example@example.cz<br>
231Jelinkova;2044;1214;AP;10.32.0.138;example@example.cz<br>
232Tomcat;813;1845;AP;10.32.139.139;example@example.cz<br>
233Pospa;3177;1032;AP;10.32.0.131;example@example.cz<br>
234Looser;3220;471;AP;10.32.0.135;example@example.cz<br>
235Duch;3375;467;Router;10.32.0.157;example@example.cz<br>
236Jipe;3318;1500;AP;10.32.0.132;example@example.cz<br>
237Passi;3465;1568;Router;10.32.0.134;example@example.cz<br>
238Kozel;3681;3279;AP;10.33.0.1;example@example.cz<br>
239sluknovska;4778;2048;AP;10.33.0.4;example@example.cz<br>
240jabtoc;4857;2407;AP;10.33.0.21;example@example.cz<br>
241Jablonecka;5077;2642;AP;10.33.0.2;example@example.cz<br>
242Kyselova;2085;2107;AP;10.32.0.147;example@example.cz</font></font></p>
2431unreal 
244<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
245 
246<hr size="1">
247 
2489unreal<a name="noping"></a>
2491unreal<font size="3"><b>*.noping files</b></font><br>
250computer_name;position_x;position_y;type<br>
251<br>
252 
253</a><b>computer_name<a name="config">:</a></b><a name="config"><br>
254I dont recommend names with diacritic and special characters. Use entities
2559unrealwithout &quot;;&quot; but be carefull<p>
2561unreal 
257<b>position_x:</b><br>
2589unrealposition from the left<br>
2591unreal<br>
260 
261<b>position_y: </b><br>
2629unrealposition from the top</a></p>
2631unreal<p><b>type:</b><br>
2641 ... Client<br>
2652 ... Switch<a name="comp"><br><br>
266 
267 
268If type = 1 the computer_name will show<br>If type = 2 the computer_name will be
269hidden</a></p>
270 
271<p>Noping file(s) is for computers which you can not ping<a name="comp"><br>
272<br>
273 
274<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
275<b><i>Example - name.noping</i></b><br>
2769unrealSwitch_jipe;3314;1470;2<br>
277Havrankova;2794;794;1</font><br>
2781unreal 
279</p>
280 
281<hr size="1">
282 
2839unreal<a name="links"></a>
2841unreal<font size="3"><b>*.links files</b></font><br>
285from_name#to_name;link_weight;is_inplanning;type_of_link<p>
286 
287<b>from_name#to_name:</b><br>
288Put names from nodes or noping file. You can change the name to coordinates or
2899unrealadd 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>
2901unreal<br>
291 
292<b>link_weight: </b><br>
2939unrealClient ...</a> tiny line (2.7px)<br>
294Backbone ... thick line (4.1px)</p>
2951unreal<p>
296 
297<b>is_inplanning:</b><br>
2989unrealINP ... yes, link is in planning and draw transparent<br>
299NO ... no, link is normal and draw without transparency<br>
3001unreal<br>
301 
302<b>type of link:</b><a name="link"><br>
303<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>
304<b><font class="form" color="#64c8ff">ETH</font><font class="form">,</font><font class="form" color="#64c8ff">
305</font><font class="form" color="#be0000">FSO</font><font class="form">,</font><font class="form" color="#ff5050">&nbsp;&nbsp;FSO
306+ WiFi</font><font class="form">,</font></b> <b>
307<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">
308 
309</font>
310 
311<b><font class="form" color="#dc00dc">Fiber</font><font class="form">,</font><font class="form" color="#dc00dc">
312</font><font class="form" color="#0000fa">Other</font></b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3177&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
318&gt;8<br><br>
319 
320<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
321<b><i>Example - name.links</i></b><br>
322Havrankova#Jipe;Client;NO;1<br>
323Jelinkova#Pospa;Backbone;NO;2<br>
324Jelinkova#Tomcat;Backbone;NO;2<br>
325Jelinkova#Alderan;Backbone;NO;2<br>
326Jark#Alderan;Backbone;NO;2<br>
327Jipe#Passi;Backbone;NO;2<br>
328jabtoc#Jablonecka;Backbone;NO;3<br>
329Kyselova#Jark;Backbone;NO;6<br>
3309unrealLooser#Unreal;Backbone;NO;6<br>
3311unrealLooser#Duch;Backbone;NO;6<br>
332Looser#WESKR;Backbone;NO;6<br>
333Jelinkova#WESKR;Backbone;NO;6<br>
334Duch#Jipe;Backbone;NO;6<br>
3359unrealDuch#3745&amp;0;Backbone;NO;6<br>
3361unrealJipe#Jablonecka;Backbone;NO;6<br>
337sluknovska#Duch;Backbone;NO;6<br>
338sluknovska#jabtoc;Backbone;NO;6<br>
339Kyselova#Kozel;Backbone;NO;6<br>
340Jelinkova#Kyselova;Backbone;NO;6<br>
3419unrealJipe#3189&amp;1481#2574&amp;1699#2630&amp;1863#2537&amp;1898;Backbone;INP;8<br>
3421unrealhapri#Jipe;Client;INP;1<br>
343Switch_jipe#Pospa;Backbone;NO;6<br>
344Switch_jipe#Jipe;Backbone;NO;3</font></p>
345 
346</p>
347 
348<hr size="1">
349 
350</font>
351 
3529unreal<a name="infopoints"></a>
3531unreal<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
354<font size="3"><b>*.infopoints files</b></font><br>
355name_of_point;position_x;position_y<br>
3569unreal</a><br>
3571unreal 
358<b>name_of_point:</b><br>
3599unrealI don't recommend names with diacritic and special characters. Use entities
360without &quot;;&quot; but be carefull<p>
3611unreal 
362<b>position_x:</b><br>
3639unrealposition from the left<br>
3641unreal<br>
365 
366<b>position_y: </b><br>
3679unrealposition from the top<br><br>
3681unreal 
369 
370<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
371<b><i>Example - name.infopoints</i></b><br>
3729unrealRestaurace Na Vyhlidce;1091;1348<br>
373Vinarna U Kocoura;1231;1719<br>
374Bar Las Vegas;2530;1989<br>
375Bar Wild Jack;2453;2041<br>
376Restaurace Na Melnicke;3324;983<br>
377Pizzerie Trebenicka;3665;1659<br>
378Zernosecka;2652;1218<br>
379Pizzerie Severka;5098;2678</font></p>
3801unreal 
381<hr size="1">
382 
383<font face="Verdana, Arial, Helvetica" color="#000000" size="2">
384 
3859unreal<a name="state"></a>
3861unreal<font size="3"><b>*.state files</b></font><br>
387ip_address;number_of_pings_received(if >0 => computer is green, otherwise red);latency<br>
388<br>
389 
390<font face="Verdana, Arial, Helvetica" color="#000000" size="1">
391<b><i>Example - name.state</i></b><br>
39210.32.135.151;1;2.684<br>
39310.32.0.146;1;3.539<br>
39410.32.0.141;1;1.085<br>
39510.32.0.142;0;0<br>
39610.32.0.140;1;3.385<br>
39710.32.0.138;1;1.818<br>
39810.32.139.139;0;0<br>
39910.32.0.131;1;1.593<br>
40010.32.0.135;1;0.540<br>
40110.32.0.157;1;0.180<br>
40210.32.0.132;1;1.208<br>
40310.32.0.134;0;0<br>
40410.33.0.1;1;2.757<br>
40510.33.0.4;1;1.065<br>
40610.33.0.21;1;2.257<br>
40710.33.0.2;1;2.050<br>
40810.32.0.147;1;2.555<br>
409<br>
410</font>
411<br>
412 
413<hr size="1">
414 
4159unreal(c)2011 by <a href="http://www.jklir.net">Unreal][</a> &amp; <a href="http://www.mobilnews.cz/honza/calstats">Jan Krupa</a>.<br>
4161unreal<br>
417 
418</font>
419</body>
420</html>

Powered by WebSVN 2.2.1