1 | 1 | unreal | <html> |
2 | | | <title>Maptats v3.0 AJAX documentation</title> |
3 | | | |
4 | | | <body> |
5 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
6 | | | <font size="+1"><b>Mapstats v3.0 AJAX documentation</b></font><br> |
7 | | | Computer and Links Statistics<br><br> |
8 | | | <object data="../index.html" type="text/html" width="930" height="600" border="0" style="overflow:hidden; _width:910px;"></object> <hr size="1"> |
9 | | | |
10 | | | <font size="3"><b>Basic information</b></font><br> |
11 | | | First of all check out Mapstats homepage if there is newer version available:<br> |
12 | | | <a href="http://www.jklir.net/jklir_soubory2/index.php3?p=mapstats"> |
13 | | | http://www.jklir.net/jklir_soubory2/index.php3?p=mapstats</a><br> |
14 | | | <br> |
15 | | | |
16 | | | Every site stat consist of four to five files. So our testing example will consist of those files:<br> |
17 | | | <a href="#nodes">name.nodes</a> - list od computers<br> |
18 | | | <a href="#noping">name.noping</a> - list of computers which you can not ping.<br> |
19 | | | <a href="#links">name.links</a> - list of links between nodes (optional)<br> |
20 | | | <a href="#infopoints">name.infopoints</a> - list of info points at map (optional)<br> |
21 | | | <a href="#state">name.state</a> - actual state of computers (generated by |
22 | | | MapStats script)<br> |
23 | | | <br> |
24 | | | <br> |
25 | | | |
26 | | | You need to create <i>*.nodes</i> , <i>*.noping</i> and <i>*.links </i> file(s) for every site stat. You can |
27 | | | place as many sites as you want into mapstats directory or create new directory |
28 | | | with same files. Then just run <i>gen_mapstats</i> and stats will |
29 | | | be gererated. If you want up to date stats, insert <i>gen_mapstats</i> into cron daemon (for example every |
30 | | | 5-10 minutes). No spaces in the files ! All files must exists, if you can not use |
31 | | | noping, links or infopoints files you must delete content inside<br> |
32 | | | <br> |
33 | | | |
34 | | | </p> |
35 | | | |
36 | | | <hr size="1"> |
37 | | | |
38 | | | <font size="3"><b>Installation</b></font><br> |
39 | | | <br> |
40 | | | |
41 | | | <b>These programs must be available in the system:</b> awk<br> |
42 | | | <ul> |
43 | | | <li>unpack the archive</li> |
44 | | | <li>move maptats directory to your www directory (or somewhere you want to use it in)</li> |
45 | | | <li>change path, directories and configuration in 'gen_mapstats'</li> |
46 | | | <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> |
47 | | | <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> |
48 | | | <li>run 'gen_mapstats' to test the configuration</li> |
49 | | | <li>edit 'name.*' files to match your configuration (sample files are included)</li> |
50 | | | <li>add 'gen_mapstats' to cron if you want to generate statistics periodically</li> |
51 | | | </ul> |
52 | | | |
53 | | | <hr size="1"> |
54 | | | |
55 | | | <br> |
56 | | | |
57 | | | </font><b> |
58 | | | <font face="Verdana, Arial, Helvetica" color="#000000"> |
59 | | | Configuration</font></b><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br> |
60 | | | <br> |
61 | | | |
62 | | | <b>open index.html in text editor for configuration. There is configuration |
63 | | | part:</b></font><p> |
64 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
65 | | | <script type="text/javascript"><br> |
66 | | | <!--<br> |
67 | | | <br> |
68 | | | // set full resolution (100%) of map (width and height)<br> |
69 | | | var full_x = 3100;<br> |
70 | | | var full_y = 2230;<br> |
71 | | | <br> |
72 | | | // set outerDiv resolution (width and height)<br> |
73 | | | var inres_x = 700;<br> |
74 | | | var inres_y = 500;<br> |
75 | | | <br> |
76 | | | // set magnifier resolution (width and height)<br> |
77 | | | var magres_x = 150;<br> |
78 | | | var magres_y = parseInt(full_y / (full_x / magres_x));<br> |
79 | | | <br> |
80 | | | // set start position (from left and top)<br> |
81 | | | var start_left = 110;<br> |
82 | | | var start_top = 50;<br> |
83 | | | <br> |
84 | | | // set zoom multiple<br> |
85 | | | var eq_mini = 0.33; // 33%<br> |
86 | | | var eq_medi = 0.5; // 50%<br> |
87 | | | var eq_high = 0.66; // 66%<br> |
88 | | | var eq_orig = 1; // 100%<br> |
89 | | | <br> |
90 | | | // set start multiple<br> |
91 | | | var start_mul = eq_mini;<br> |
92 | | | <br> |
93 | | | // set displayed functions<br> |
94 | | | var ch_ap = true;<br> |
95 | | | var ch_router = true;<br> |
96 | | | var ch_node = true;<br> |
97 | | | var ch_infopoint = true;<br> |
98 | | | var ch_noping = true;<br> |
99 | | | var ch_legend = true;<br> |
100 | | | var ch_name = true;<br> |
101 | | | var ch_ip = true;<br> |
102 | | | var ch_status = true;<br> |
103 | | | var ch_backbone = true;<br> |
104 | | | var ch_client = true;<br> |
105 | | | var ch_inp = true;<br> |
106 | | | <br> |
107 | | | // set source data<br> |
108 | | | var nodes = 'name.nodes';<br> |
109 | | | var noping = 'name.noping';<br> |
110 | | | var links = 'name.links';<br> |
111 | | | var infopoints = 'name.infopoints';<br> |
112 | | | var state = 'name.state';<br> |
113 | | | <br> |
114 | | | // set colors of links<br> |
115 | | | var wifi_client = "rgb(0, 200, 0)";<br> |
116 | | | var wifi_backbone = "rgb(250, 250, 0)";<br> |
117 | | | var eth_100 = "rgb(173, 216, 230)";<br> |
118 | | | var fso = "rgb(190, 0, 0)";<br> |
119 | | | var fso_backup = "rgb(255, 80, 80)";<br> |
120 | | | var ghz5 = "rgb(200, 200, 200)";<br> |
121 | | | var ghz10 = "rgb(255, 255, 255)";<br> |
122 | | | var fiber = "rgb(220, 0, 220)";<br> |
123 | | | var other = "rgb(0, 0, 250)";<br> |
124 | | | <br> |
125 | | | // set alpha colors of links<br> |
126 | | | var wifi_client_a = "rgba(0, 200, 0, 0.6)";<br> |
127 | | | var wifi_backbone_a = "rgba(250, 250, 0, 0.6)";<br> |
128 | | | var eth_100_a = "rgba(173, 216, 230, 0.6)";<br> |
129 | | | var fso_a = "rgba(190, 0, 0, 0.6)";<br> |
130 | | | var fso_backup_a = "rgba(255, 80, 80, 0.6)";<br> |
131 | | | var ghz5_a = "rgba(200, 200, 200, 0.6)";<br> |
132 | | | var ghz10_a = "rgba(255, 255, 255, 0.6)";<br> |
133 | | | var fiber_a = "rgba(220, 0, 220, 0.6)";<br> |
134 | | | var other_a = "rgba(0, 0, 250, 0.6)";<br> |
135 | | | <br> |
136 | | | // set names of links<br> |
137 | | | var name1 = "Wifi Client";<br> |
138 | | | var name2 = "Wifi Backbone";<br> |
139 | | | var name3 = "Ethernet";<br> |
140 | | | var name4 = "FSO";<br> |
141 | | | var name5 = "FSO + Backup";<br> |
142 | | | var name6 = "5 GHz";<br> |
143 | | | var name7 = "10 GHz";<br> |
144 | | | var name8 = "Fiber";<br> |
145 | | | var name9 = "Other";<br> |
146 | | | <br> |
147 | | | // set name for link in planning (for legend)<br> |
148 | | | var inp = "(InP)";<br> |
149 | | | <br> |
150 | | | // Let's start it<br> |
151 | | | window.onload = function() {<br> |
152 | | | nactiSoubory();<br> |
153 | | | mapInit(start_mul);<br> |
154 | | | nastavCheck();<br> |
155 | | | canvasInit(start_mul);<br> |
156 | | | timerMe();<br> |
157 | | | }<br> |
158 | | | <br> |
159 | | | // --><br> |
160 | | | </script></font></p> |
161 | | | <p> |
162 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
163 | | | Change it as you wish but be carefull.</p> |
164 | | | |
165 | | | <hr size="1"> |
166 | | | |
167 | | | </font> |
168 | | | <p> |
169 | | | <font face="Verdana, Arial, Helvetica" color="#000000"> |
170 | | | <b>Create map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br> |
171 | | | <br> |
172 | | | |
173 | | | You need create you own map. There is 4 scales includes map rects inside (size1 |
174 | | | is the smallest, size4 is the biggest) and one directory with thumbnail of map |
175 | | | (150 x <count> px). In left top corner is the first rect |
176 | | | 256x256px named "x0y0.jpg". x is column and y is row. Every rect has |
177 | | | 256px width and 256px height. If the width or height of rect is less then 256px, |
178 | | | the rect will be smaller. The creation is very hard, so I wrote little PHP |
179 | | | script which do it all in +- 3 minutes! You only need the biggest map in jpg |
180 | | | format 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> |
181 | | | |
182 | | | <hr size="1"> |
183 | | | |
184 | | | </font> |
185 | | | <p> |
186 | | | <font face="Verdana, Arial, Helvetica" color="#000000"><b>Display map</b></font><font face="Verdana, Arial, Helvetica" color="#000000" size="2"><br> |
187 | | | <br> |
188 | | | |
189 | | | The easiest way to display map in existing page is using <object> tag (but |
190 | | | IE display only white background color)</font></p> |
191 | | | |
192 | | | <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> |
193 | | | |
194 | | | <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> |
195 | | | |
196 | | | <hr size="1"> |
197 | | | |
198 | | | <a name="nodes"> |
199 | | | <font size="3"><b>*.nodes files</b></font><br> |
200 | | | computer_name;position_x;position_y;type;IP_address;e-mail<br> |
201 | | | <p> |
202 | | | |
203 | | | <b>computer_name:</b><br> |
204 | | | I dont recommend names with diacritic and special characters. Use entities |
205 | | | without ";" but be very carefull</p> |
206 | | | <p> |
207 | | | |
208 | | | <b>position_x:</b><br> |
209 | | | position from left<br> |
210 | | | <br> |
211 | | | |
212 | | | <b>position_y: </b><br> |
213 | | | position from top</p> |
214 | | | <p> |
215 | | | |
216 | | | <b>type:</b><BR> |
217 | | | AP ... display status, IP address and name with point and waves<br> |
218 | | | Router ... display status and name with point<br> |
219 | | | Client ... display only name and point |
220 | | | </p> |
221 | | | <p> |
222 | | | |
223 | | | <b>IP address:</b><BR> |
224 | | | Insert IP address of node, no DNS</p> |
225 | | | <p> |
226 | | | |
227 | | | <b>e-mail:</b><br> |
228 | | | Administrator's contact</a> for notification (not work yet - TODO)</p> |
229 | | | |
230 | | | <p> |
231 | | | |
232 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="1"> |
233 | | | <b><i>Example - name.nodes</i></b><br> |
234 | | | Unreal;1928;451;Client;10.32.135.151;example@example.cz<br> |
235 | | | Alderan;764;876;Router;10.32.0.146;example@example.cz<br> |
236 | | | WESKR;2044;819;Router;10.32.0.141;example@example.cz<br> |
237 | | | hapri;1935;1407;Router;10.32.0.142;example@example.cz<br> |
238 | | | Jark;698;792;AP;10.32.0.140;example@example.cz<br> |
239 | | | Jelinkova;1246;735;AP;10.32.0.138;example@example.cz<br> |
240 | | | Tomcat;499;1098;AP;10.32.139.139;example@example.cz<br> |
241 | | | Pospa;1931;628;AP;10.32.0.131;example@example.cz<br> |
242 | | | Looser;1962;286;AP;10.32.0.135;example@example.cz<br> |
243 | | | Duch;2058;282;Router;10.32.0.157;example@example.cz<br> |
244 | | | Jipe;2022;923;AP;10.32.0.132;example@example.cz<br> |
245 | | | Passi;2090;942;Router;10.32.0.134;example@example.cz<br> |
246 | | | Kozel;2233;1983;AP;10.33.0.1;example@example.cz<br> |
247 | | | sluknovska;2897;1239;AP;10.33.0.4;example@example.cz<br> |
248 | | | jabtoc;2935;1447;AP;10.33.0.21;example@example.cz<br> |
249 | | | Jablonecka;3070;1593;AP;10.33.0.2;example@example.cz<br> |
250 | | | Kyselova;1272;1285;AP;10.32.0.147;example@example.cz</font></font></p> |
251 | | | |
252 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
253 | | | |
254 | | | <hr size="1"> |
255 | | | |
256 | | | <a name="noping"> |
257 | | | <font size="3"><b>*.noping files</b></font><br> |
258 | | | computer_name;position_x;position_y;type<br> |
259 | | | <br> |
260 | | | |
261 | | | </a><b>computer_name<a name="config">:</a></b><a name="config"><br> |
262 | | | I dont recommend names with diacritic and special characters. Use entities |
263 | | | without ";" but be very carefull<p> |
264 | | | |
265 | | | <b>position_x:</b><br> |
266 | | | position from left<br> |
267 | | | <br> |
268 | | | |
269 | | | <b>position_y: </b><br> |
270 | | | position from top</a></p> |
271 | | | <p><b>type:</b><br> |
272 | | | 1 ... Client<br> |
273 | | | 2 ... Switch<a name="comp"><br><br> |
274 | | | |
275 | | | |
276 | | | If type = 1 the computer_name will show<br>If type = 2 the computer_name will be |
277 | | | hidden</a></p> |
278 | | | |
279 | | | <p>Noping file(s) is for computers which you can not ping<a name="comp"><br> |
280 | | | <br> |
281 | | | |
282 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="1"> |
283 | | | <b><i>Example - name.noping</i></b><br> |
284 | | | Switch_jipe;2015;891;2<br> |
285 | | | Havrankova;1705;475;1</font><br> |
286 | | | |
287 | | | </p> |
288 | | | |
289 | | | <hr size="1"> |
290 | | | |
291 | | | <a name="links"> |
292 | | | <font size="3"><b>*.links files</b></font><br> |
293 | | | from_name#to_name;link_weight;is_inplanning;type_of_link<p> |
294 | | | |
295 | | | <b>from_name#to_name:</b><br> |
296 | | | Put names from nodes or noping file. You can change the name to coordinates or |
297 | | | add 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> |
298 | | | <br> |
299 | | | |
300 | | | <b>link_weight: </b><br> |
301 | | | Client ...</a> tiny line (3px)<br>Backbone ... thick line (4.5px)</p> |
302 | | | <p> |
303 | | | |
304 | | | <b>is_inplanning:</b><br> |
305 | | | INP ... yes, link id in planning and display transparent<br>NO ... no, link is |
306 | | | normal and dont display transparent<br> |
307 | | | <br> |
308 | | | |
309 | | | <b>type of link:</b><a name="link"><br> |
310 | | | <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> |
311 | | | <b><font class="form" color="#64c8ff">ETH</font><font class="form">,</font><font class="form" color="#64c8ff"> |
312 | | | </font><font class="form" color="#be0000">FSO</font><font class="form">,</font><font class="form" color="#ff5050"> FSO |
313 | | | + WiFi</font><font class="form">,</font></b> <b> |
314 | | | <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"> |
315 | | | |
316 | | | </font> |
317 | | | |
318 | | | <b><font class="form" color="#dc00dc">Fiber</font><font class="form">,</font><font class="form" color="#dc00dc"> |
319 | | | </font><font class="form" color="#0000fa">Other</font></b><br> |
320 | | | 1 |
321 | | | 2 |
322 | | | 3 4 |
323 | | | 5 6 |
324 | | | 7 8 |
325 | | | >8<br><br> |
326 | | | |
327 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="1"> |
328 | | | <b><i>Example - name.links</i></b><br> |
329 | | | Looser#Unreal;Client;NO;1<br> |
330 | | | Havrankova#Jipe;Client;NO;1<br> |
331 | | | Jelinkova#Pospa;Backbone;NO;2<br> |
332 | | | Jelinkova#Tomcat;Backbone;NO;2<br> |
333 | | | Jelinkova#Alderan;Backbone;NO;2<br> |
334 | | | Jark#Alderan;Backbone;NO;2<br> |
335 | | | Jipe#Passi;Backbone;NO;2<br> |
336 | | | jabtoc#Jablonecka;Backbone;NO;3<br> |
337 | | | Kyselova#Jark;Backbone;NO;6<br> |
338 | | | Looser#Duch;Backbone;NO;6<br> |
339 | | | Looser#WESKR;Backbone;NO;6<br> |
340 | | | Jelinkova#WESKR;Backbone;NO;6<br> |
341 | | | Duch#Jipe;Backbone;NO;6<br> |
342 | | | Duch#2350&0;Backbone;NO;6<br> |
343 | | | Jipe#Jablonecka;Backbone;NO;6<br> |
344 | | | sluknovska#Duch;Backbone;NO;6<br> |
345 | | | sluknovska#jabtoc;Backbone;NO;6<br> |
346 | | | Kyselova#Kozel;Backbone;NO;6<br> |
347 | | | Jelinkova#Kyselova;Backbone;NO;6<br> |
348 | | | Jipe#1949&931#1928&900#1563&1027#1594&1124#1531&1149;Backbone;INP;8<br> |
349 | | | hapri#Jipe;Client;INP;1<br> |
350 | | | Switch_jipe#Pospa;Backbone;NO;6<br> |
351 | | | Switch_jipe#Jipe;Backbone;NO;3</font></p> |
352 | | | |
353 | | | </p> |
354 | | | |
355 | | | <hr size="1"> |
356 | | | |
357 | | | </font> |
358 | | | |
359 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
360 | | | |
361 | | | </font> |
362 | | | |
363 | | | <a name="infopoints"> |
364 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
365 | | | <font size="3"><b>*.infopoints files</b></font><br> |
366 | | | name_of_point;position_x;position_y<br> |
367 | | | </font></a><br> |
368 | | | |
369 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
370 | | | |
371 | | | <b>name_of_point:</b><br> |
372 | | | I dont recommend names with diacritic and special characters. Use entities |
373 | | | without ";" but be very carefull<p> |
374 | | | |
375 | | | <b>position_x:</b><br> |
376 | | | position from left<br> |
377 | | | <br> |
378 | | | |
379 | | | <b>position_y: </b><br> |
380 | | | position from top<br><br> |
381 | | | |
382 | | | |
383 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="1"> |
384 | | | <b><i>Example - name.infopoints</i></b><br> |
385 | | | </font> |
386 | | | </font> |
387 | | | <font face="Verdana, Arial, Helvetica" size="1">Restaurace Na |
388 | | | Vyhlidce;673;804<br> |
389 | | | Vinarna U Kocoura;762;1054<br> |
390 | | | Bar Las Vegas;1536;1198<br> |
391 | | | Bar Wild Jack;1490;1228<br> |
392 | | | Restaurace Na Melnicke;2021;600<br> |
393 | | | Zernosecka;1614;736</font></p> |
394 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
395 | | | |
396 | | | <hr size="1"> |
397 | | | |
398 | | | </font> |
399 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="2"> |
400 | | | |
401 | | | <a name="state"> |
402 | | | <font size="3"><b>*.state files</b></font><br> |
403 | | | ip_address;number_of_pings_received(if >0 => computer is green, otherwise red);latency<br> |
404 | | | <br> |
405 | | | |
406 | | | <font face="Verdana, Arial, Helvetica" color="#000000" size="1"> |
407 | | | <b><i>Example - name.state</i></b><br> |
408 | | | 10.32.135.151;1;2.684<br> |
409 | | | 10.32.0.146;1;3.539<br> |
410 | | | 10.32.0.141;1;1.085<br> |
411 | | | 10.32.0.142;0;0<br> |
412 | | | 10.32.0.140;1;3.385<br> |
413 | | | 10.32.0.138;1;1.818<br> |
414 | | | 10.32.139.139;0;0<br> |
415 | | | 10.32.0.131;1;1.593<br> |
416 | | | 10.32.0.135;1;0.540<br> |
417 | | | 10.32.0.157;1;0.180<br> |
418 | | | 10.32.0.132;1;1.208<br> |
419 | | | 10.32.0.134;0;0<br> |
420 | | | 10.33.0.1;1;2.757<br> |
421 | | | 10.33.0.4;1;1.065<br> |
422 | | | 10.33.0.21;1;2.257<br> |
423 | | | 10.33.0.2;1;2.050<br> |
424 | | | 10.32.0.147;1;2.555<br> |
425 | | | <br> |
426 | | | </font> |
427 | | | <br> |
428 | | | |
429 | | | <hr size="1"> |
430 | | | |
431 | | | (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> |
432 | | | <br> |
433 | | | |
434 | | | </font> |
435 | | | </body> |
436 | | | </html> |