Mapstats v3.0 AJAX documentation
Computer and Links Statistics

 
Basic information
First of all check out Mapstats homepage if there is newer version available:
http://www.jklir.net/jklir_soubory2/index.php3?p=mapstats

Every site stat consist of four to five files. So our testing example will consist of those files:
name.nodes - list od computers
name.noping - list of computers which you can not ping.
name.links - list of links between nodes (optional)
name.infopoints - list of info points at map (optional)
name.state - actual state of computers (generated by MapStats script)


You need to create *.nodes , *.noping and *.links 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 gen_mapstats and stats will be gererated. If you want up to date stats, insert gen_mapstats 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


Installation

These programs must be available in the system: awk


Configuration

open index.html in text editor for configuration. There is configuration part:

<script type="text/javascript">
<!--

// set full resolution (100%) of map (width and height)
var full_x = 3100;
var full_y = 2230;

// set outerDiv resolution (width and height)
var inres_x = 700;
var inres_y = 500;

// set magnifier resolution (width and height)
var magres_x = 150;
var magres_y = parseInt(full_y / (full_x / magres_x));

// set start position (from left and top)
var start_left = 110;
var start_top = 50;

// set zoom multiple
var eq_mini = 0.33; // 33%
var eq_medi = 0.5; // 50%
var eq_high = 0.66; // 66%
var eq_orig = 1; // 100%

// set start multiple
var start_mul = eq_mini;

// set displayed functions
var ch_ap = true;
var ch_router = true;
var ch_node = true;
var ch_infopoint = true;
var ch_noping = true;
var ch_legend = true;
var ch_name = true;
var ch_ip = true;
var ch_status = true;
var ch_backbone = true;
var ch_client = true;
var ch_inp = true;

// set source data
var nodes = 'name.nodes';
var noping = 'name.noping';
var links = 'name.links';
var infopoints = 'name.infopoints';
var state = 'name.state';

// set colors of links
var wifi_client = "rgb(0, 200, 0)";
var wifi_backbone = "rgb(250, 250, 0)";
var eth_100 = "rgb(173, 216, 230)";
var fso = "rgb(190, 0, 0)";
var fso_backup = "rgb(255, 80, 80)";
var ghz5 = "rgb(200, 200, 200)";
var ghz10 = "rgb(255, 255, 255)";
var fiber = "rgb(220, 0, 220)";
var other = "rgb(0, 0, 250)";

// set alpha colors of links
var wifi_client_a = "rgba(0, 200, 0, 0.6)";
var wifi_backbone_a = "rgba(250, 250, 0, 0.6)";
var eth_100_a = "rgba(173, 216, 230, 0.6)";
var fso_a = "rgba(190, 0, 0, 0.6)";
var fso_backup_a = "rgba(255, 80, 80, 0.6)";
var ghz5_a = "rgba(200, 200, 200, 0.6)";
var ghz10_a = "rgba(255, 255, 255, 0.6)";
var fiber_a = "rgba(220, 0, 220, 0.6)";
var other_a = "rgba(0, 0, 250, 0.6)";

// set names of links
var name1 = "Wifi Client";
var name2 = "Wifi Backbone";
var name3 = "Ethernet";
var name4 = "FSO";
var name5 = "FSO + Backup";
var name6 = "5 GHz";
var name7 = "10 GHz";
var name8 = "Fiber";
var name9 = "Other";

// set name for link in planning (for legend)
var inp = "(InP)";

// Let's start it
window.onload = function() {
nactiSoubory();
mapInit(start_mul);
nastavCheck();
canvasInit(start_mul);
timerMe();
}

// -->
</script>

Change it as you wish but be carefull.


Create map

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 <count> px). In left top corner is the first rect 256x256px named "x0y0.jpg". x is column and y is 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 +- 3 minutes! You only need the biggest map in jpg format and configure the function. I recommend size less then 5000 x 5000px. You can download it from http://www.jklir.net/jklir_soubory2/odkazy/map_cutter.zip



Display map

The easiest way to display map in existing page is using <object> tag (but IE display only white background color)

<object data="mapstats/index.html" type="text/html" width="930" height="600" border="0" style="overflow:hidden; _width:910px;"></object>
(<iframe> tag has problems on IE [some points doesnt draw on the start])


*.nodes files
computer_name;position_x;position_y;type;IP_address;e-mail
 

computer_name:
I dont recommend names with diacritic and special characters. Use entities without ";" but be very carefull

position_x:
position from left

position_y:
position from top

type:
AP ... display status, IP address and name with point and waves
Router ... display status and name with point
Client ... display only name and point

IP address:
Insert IP address of node, no DNS

e-mail:
Administrator's contact
for notification (not work yet - TODO)

Example - name.nodes
Unreal;1928;451;Client;10.32.135.151;example@example.cz
Alderan;764;876;Router;10.32.0.146;example@example.cz
WESKR;2044;819;Router;10.32.0.141;example@example.cz
hapri;1935;1407;Router;10.32.0.142;example@example.cz
Jark;698;792;AP;10.32.0.140;example@example.cz
Jelinkova;1246;735;AP;10.32.0.138;example@example.cz
Tomcat;499;1098;AP;10.32.139.139;example@example.cz
Pospa;1931;628;AP;10.32.0.131;example@example.cz
Looser;1962;286;AP;10.32.0.135;example@example.cz
Duch;2058;282;Router;10.32.0.157;example@example.cz
Jipe;2022;923;AP;10.32.0.132;example@example.cz
Passi;2090;942;Router;10.32.0.134;example@example.cz
Kozel;2233;1983;AP;10.33.0.1;example@example.cz
sluknovska;2897;1239;AP;10.33.0.4;example@example.cz
jabtoc;2935;1447;AP;10.33.0.21;example@example.cz
Jablonecka;3070;1593;AP;10.33.0.2;example@example.cz
Kyselova;1272;1285;AP;10.32.0.147;example@example.cz


*.noping files
computer_name;position_x;position_y;type

computer_name:
I dont recommend names with diacritic and special characters. Use entities without ";" but be very carefull

position_x:
position from left

position_y:
position from top

type:
1 ... Client
2 ... Switch

If type = 1 the computer_name will show
If type = 2 the computer_name will be hidden

Noping file(s) is for computers which you can not ping

Example - name.noping
Switch_jipe;2015;891;2
Havrankova;1705;475;1


*.links files
from_name#to_name;link_weight;is_inplanning;type_of_link

from_name#to_name:
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: [
Jipe#1949&931#1928&900#1563&1027#1594&1124#1531&1149]

link_weight:
Client ...
tiny line (3px)
Backbone ... thick line (4.5px)

is_inplanning:
INP ... yes, link id in planning and display transparent
NO ... no, link is normal and dont display transparent

type of link:
WiFi Client, WiFi Backbone, ETH, FSO,  FSO + WiFi, 5Ghz
,  10Ghz, Fiber, Other
      1                  2               3      4            5           6         7         8        >8

Example - name.links
Looser#Unreal;Client;NO;1
Havrankova#Jipe;Client;NO;1
Jelinkova#Pospa;Backbone;NO;2
Jelinkova#Tomcat;Backbone;NO;2
Jelinkova#Alderan;Backbone;NO;2
Jark#Alderan;Backbone;NO;2
Jipe#Passi;Backbone;NO;2
jabtoc#Jablonecka;Backbone;NO;3
Kyselova#Jark;Backbone;NO;6
Looser#Duch;Backbone;NO;6
Looser#WESKR;Backbone;NO;6
Jelinkova#WESKR;Backbone;NO;6
Duch#Jipe;Backbone;NO;6
Duch#2350&0;Backbone;NO;6
Jipe#Jablonecka;Backbone;NO;6
sluknovska#Duch;Backbone;NO;6
sluknovska#jabtoc;Backbone;NO;6
Kyselova#Kozel;Backbone;NO;6
Jelinkova#Kyselova;Backbone;NO;6
Jipe#1949&931#1928&900#1563&1027#1594&1124#1531&1149;Backbone;INP;8
hapri#Jipe;Client;INP;1
Switch_jipe#Pospa;Backbone;NO;6
Switch_jipe#Jipe;Backbone;NO;3


*.infopoints files
name_of_point;position_x;position_y

name_of_point:
I dont recommend names with diacritic and special characters. Use entities without ";" but be very carefull

position_x:
position from left

position_y:
position from top

Example - name.infopoints
Restaurace Na Vyhlidce;673;804
Vinarna U Kocoura;762;1054
Bar Las Vegas;1536;1198
Bar Wild Jack;1490;1228
Restaurace Na Melnicke;2021;600
Zernosecka;1614;736


*.state files
ip_address;number_of_pings_received(if >0 => computer is green, otherwise red);latency

Example - name.state
10.32.135.151;1;2.684
10.32.0.146;1;3.539
10.32.0.141;1;1.085
10.32.0.142;0;0
10.32.0.140;1;3.385
10.32.0.138;1;1.818
10.32.139.139;0;0
10.32.0.131;1;1.593
10.32.0.135;1;0.540
10.32.0.157;1;0.180
10.32.0.132;1;1.208
10.32.0.134;0;0
10.33.0.1;1;2.757
10.33.0.4;1;1.065
10.33.0.21;1;2.257
10.33.0.2;1;2.050
10.32.0.147;1;2.555



(c)2008 by
Unreal][ & Jan Krupa.

WebSVN - mapstats - Blame - Rev 1 - /doc/index.html
  jablonka.czprosek.czf

mapstats

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

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1