Martijn Schmidt e0da083f5c New OS: Schleifenbauer, entity-physical improvements, various html page fixes (#9471)
* Fix some comment and documentation typos.

* Fix various entphysical page display issues.

- Resolve flickering during loading (missing liClosed for nested items).
- Clicking a sensor actually takes you to the matching graph now.

* Add a few nicecase() calls to clean up html page display.

* Create discover_entity_physical() function

- Add discover_entity_physical() function into includes/discovery/functions.inc.php
- This allows for an easy implementation of OS-specific entity-physical discovery.
- Update includes/discovery/entity-physical/entity-physical.inc.php to use the new function.

* Add power_consumed and power_factor sensors.

* Two new icons, make more entPhysical data visible.

* Pre-commit fix: blank line found at end of control structure.

* Add Schleifenbauer OS support.

* Now really fix the comment typo.

* Fix parsing mistakes.

* Add a generic count sensor.

* Make the Schleifenbauer discovery use count instead of state sensors.

* Don't place count sensor at the top, add sane limits for Schleifenbauer

* Finetuning the rrd_options, changing Schleifenbauer sensor names.

* Update schleifenbauer.svg

* optimize logo too

* add test data

* fix sensor value display (spaces break it)

* update entPhysicalIndex
2019-01-20 12:24:11 -06:00

3.2 KiB

source: Extensions/World-Map.md path: blob/master/doc/

World Map Configuration

LibreNMS comes with a configurable Geo Map based on World Map Widget to visualize where your equipment is located geographically.

World Map Widget

World Map Widget, requires you to have properly formatted addresses in sysLocation or sysLocation override. As part of the standard poller these addresses will be Geocoded by Google and stored in the database.

Location resolution happens as follows

  1. If device['location'] contains [lat, lng] (note the square brackets), that is used
  2. If there is a location overide for the device in the WebUI and it contains [lat, lng] (note the square brackets), that is used.
  3. Attempt to resolve lat, lng using $config['geoloc']['engine']
  4. Properly formatted addresses in sysLocation or sysLocation override, under device settings.

Example:

[40.424521, -86.912755]

or

1100 Congress Ave, Austin, TX 78701

We have two current mapping engines available:

  • Leaflet (default)
  • Jquery-Mapael

World Map Widget Settings

  • Initial Latitude / Longitude: The map will be centered on those coordinates.
  • Initial Zoom: Initial zoom of the map. More information about zoom levels.
  • Grouping radius: Markers are grouped by area. This value define the maximum size of grouping areas.
  • Show devices: Show devices based on there status.

Example Settings:

Example World Map Settings

Offline OpenStreet Map

If you can't access OpenStreet map directly you can run a local tile server. To specify a different url you can set:

$config['leaflet']['tile_url'] = 'localhost.com';

Additional Leaflet config

$config['map']['engine']                                = "leaflet";
$config['leaflet']['default_lat']                       = "51.981074";
$config['leaflet']['default_lng']                       = "5.350342";
$config['leaflet']['default_zoom']                      = 8;    
$config['leaflet']['group_radius']                      = 1;    // Device grouping radius in KM default 80KM

Geocode engine config

$config['geoloc']['engine'] = "google";// Valid options are google, mapquest or bing
$config['geoloc']['api_key'] = "abcdefghijklmnopqrstuvwxyz";

Google: Pros: fast, accurate Cons: requires a credit card even for a free account

MapQuest: Pros: free, no credit card required Cons: inaccurate: most addresses are returned as locations at the center of the US

Bing: Pros: free, no credit card required, accurate Cons: Microsoft(debatable)

Jquery-Mapael config

Further custom options are available to load different maps of the world, set default coordinates of where the map will zoom and the zoom level by default. An example of this is:

$config['map']['engine']                                = "jquery-mapael";
$config['mapael']['default_map'] = 'mapael-maps/united_kingdom/united_kingdom.js';
$config['mapael']['map_width'] = 400;
$config['mapael']['default_lat'] = '50.898482';
$config['mapael']['default_lng'] = '-3.401402';
$config['mapael']['default_zoom'] = 20;

A list of maps can be found in html/js/maps/ or html/js/mapael-maps/.