2016-08-24 08:12:20 +01:00
|
|
|
source: Extensions/Network-Map.md
|
2018-10-27 23:04:34 +01:00
|
|
|
path: blob/master/doc/
|
2015-07-18 16:15:57 +01:00
|
|
|
|
2017-10-26 15:34:36 -05:00
|
|
|
# Network Map
|
|
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
LibreNMS has the ability to show you a network map based on:
|
2015-07-18 16:15:57 +01:00
|
|
|
|
|
|
|
|
- xDP Discovery
|
|
|
|
|
- MAC addresses
|
|
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
By default, both are are included but you can enable / disable either
|
|
|
|
|
one using the following config option:
|
2015-07-18 16:15:57 +01:00
|
|
|
|
|
|
|
|
```php
|
|
|
|
|
$config['network_map_items'] = array('mac','xdp');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Either remove mac or xdp depending on which you want.
|
2017-10-26 15:34:36 -05:00
|
|
|
XDP is based on FDP, CDP and LLDP support based on the device type.
|
2015-07-18 16:15:57 +01:00
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
A global map will be drawn from the information in the database, it is
|
|
|
|
|
worth noting that this could lead to a large network map. Network maps
|
|
|
|
|
for individual devices are available showing the relationship with
|
|
|
|
|
other devices. Also you can Build Device Groups and those Device
|
|
|
|
|
Groups can be drawn with Network Map.
|
|
|
|
|
|
|
|
|
|
# Network Map Configurator
|
|
|
|
|
|
2021-06-17 03:16:21 +08:00
|
|
|
[This link](https://visjs.github.io/vis-network/docs/network/) will
|
|
|
|
|
show you all the options and explain what they do.
|
|
|
|
|
|
2020-12-30 09:38:14 -05:00
|
|
|
You may also access the dynamic configuration interface [example
|
2019-09-09 05:48:35 -05:00
|
|
|
here](https://visjs.github.io/vis-network/examples/network/other/configuration.html)
|
|
|
|
|
from within LibreNMS by adding the following to config.php
|
2017-10-26 15:34:36 -05:00
|
|
|
|
|
|
|
|
```php
|
|
|
|
|
$config['network_map_vis_options'] = '{
|
|
|
|
|
"configure": { "enabled": true},
|
|
|
|
|
}';
|
|
|
|
|
```
|
2019-09-09 05:48:35 -05:00
|
|
|
|
|
|
|
|
## Note
|
|
|
|
|
|
|
|
|
|
You may want to disable the automatic page refresh while you're
|
|
|
|
|
tweaking your configuration, as the refresh will reset the dynamic
|
|
|
|
|
configuration UI to the values currently saved in config.php This can
|
2020-12-30 09:38:14 -05:00
|
|
|
be done by clicking on the Settings Icon then Refresh Pause.
|
2019-09-09 05:48:35 -05:00
|
|
|
|
|
|
|
|
## Configurator Output
|
|
|
|
|
|
|
|
|
|
Once you've achieved your desired map appearance, click the generate
|
|
|
|
|
options button at the bottom to be given the necessary parameters to
|
|
|
|
|
add to your config.php file. You will need to paste the genrated
|
|
|
|
|
config into config.php the format will need to look something like
|
2020-12-30 09:38:14 -05:00
|
|
|
this. Note that the configurator will output the config with `var options`
|
|
|
|
|
you will need to strip them out and at the end of the config you need to
|
|
|
|
|
add an `}';` see the example below.
|
2019-09-09 05:48:35 -05:00
|
|
|
|
2015-07-29 02:00:26 +02:00
|
|
|
```php
|
|
|
|
|
$config['network_map_vis_options'] = '{
|
2017-10-26 15:34:36 -05:00
|
|
|
"nodes": {
|
|
|
|
|
"color": {
|
|
|
|
|
"background": "rgba(20,252,18,1)"
|
|
|
|
|
},
|
|
|
|
|
"font": {
|
|
|
|
|
"face": "tahoma"
|
|
|
|
|
},
|
|
|
|
|
"physics": false
|
2015-07-29 02:00:26 +02:00
|
|
|
},
|
|
|
|
|
"edges": {
|
|
|
|
|
"smooth": {
|
2017-10-26 15:34:36 -05:00
|
|
|
"forceDirection": "none"
|
2015-07-29 02:00:26 +02:00
|
|
|
}
|
|
|
|
|
},
|
2017-10-26 15:34:36 -05:00
|
|
|
"interaction": {
|
|
|
|
|
"hover": true,
|
|
|
|
|
"multiselect": true,
|
|
|
|
|
"navigationButtons": true
|
|
|
|
|
},
|
|
|
|
|
"manipulation": {
|
|
|
|
|
"enabled": true
|
|
|
|
|
},
|
2015-07-29 02:00:26 +02:00
|
|
|
"physics": {
|
2017-10-26 15:34:36 -05:00
|
|
|
"barnesHut": {
|
|
|
|
|
"avoidOverlap": 0.11
|
2015-07-29 02:00:26 +02:00
|
|
|
},
|
2017-10-26 15:34:36 -05:00
|
|
|
"minVelocity": 0.75
|
2015-07-29 02:00:26 +02:00
|
|
|
}
|
|
|
|
|
}';
|
|
|
|
|
```
|
2017-10-24 16:28:16 -05:00
|
|
|
|
2019-10-07 23:28:06 +02:00
|
|
|

|