Mapstats v4.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/?p=mapstats

Every site stat consist of four to five files. So our testing example will consist of those files:
name.nodes - list of 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 on the 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 = 5420;
var full_y = 3696;

// 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 = 650;
var start_top = 165;

// set zoom multiple
var eq_mini = 0.2; // 23%
var eq_medi = 0.5; // 50%
var eq_high = 0.7; // 70%
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)";

window.onload = function() {
    timerMe();
    loadFiles();
    mapInit(start_mul);
    setCheckboxes();
    canvasInit(start_mul);
    setAutoLoader();
}

// -->
</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 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 http://www.jklir.net/jklir_soubory2/odkazy/map_cutter.zip



Display map

The easiest way to display map in existing pages is using <iframe> tag

<iframe src="../mapstats/index.html" width="910" height="580" border="0" frameborder="no" scrolling="no" allowTransparency="true"></iframe>


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

computer_name:
I don't recommend names with diacritic and special characters. Use entities without ";" but be carefull

position_x:
position from the left

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

position_x:
position from the left

position_y:
position from the 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;3314;1470;2
Havrankova;2794;794;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#3189&1481#2574&1699#2630&1863#2537&1898]

link_weight:
Client ... tiny line (2.7px)
Backbone ... thick line (4.1px)

is_inplanning:
INP ... yes, link is in planning and draw transparent
NO ... no, link is normal and draw without transparency

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
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#Unreal;Backbone;NO;6
Looser#Duch;Backbone;NO;6
Looser#WESKR;Backbone;NO;6
Jelinkova#WESKR;Backbone;NO;6
Duch#Jipe;Backbone;NO;6
Duch#3745&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#3189&1481#2574&1699#2630&1863#2537&1898;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 don't recommend names with diacritic and special characters. Use entities without ";" but be carefull

position_x:
position from the left

position_y:
position from the top

Example - name.infopoints
Restaurace Na Vyhlidce;1091;1348
Vinarna U Kocoura;1231;1719
Bar Las Vegas;2530;1989
Bar Wild Jack;2453;2041
Restaurace Na Melnicke;3324;983
Pizzerie Trebenicka;3665;1659
Zernosecka;2652;1218
Pizzerie Severka;5098;2678


*.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)2011 by Unreal][ & Jan Krupa.

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

mapstats

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

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1