Docs + some variable changes

This commit is contained in:
laf
2015-07-18 16:15:57 +01:00
parent 87321516be
commit 31f174c7b1
3 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,17 @@
# Network Map
## LibreNMS has the ability to show you a network mab based on:
- xDP Discovery
- MAC addresses
By default, both are are included but you can enable / disable either one using the following config option:
```php
$config['network_map_items'] = array('mac','xdp');
```
Either remove mac or xdp depending on which you want.
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.

View File

@ -37,7 +37,7 @@ $tmp_ids = array();
$tmp_links = array();
$tmp_link_ids = array();
if (in_array('mac',$config['map_items'])) {
if (in_array('mac',$config['network_map_items'])) {
$ports = dbFetchRows("SELECT
`D1`.`device_id` AS `local_device_id`,
`D1`.`os` AS `local_os`,
@ -76,7 +76,7 @@ if (in_array('mac',$config['map_items'])) {
", $sql_array);
}
if (in_array('xdp', $config['map_items'])) {
if (in_array('xdp', $config['network_map_items'])) {
$devices = dbFetchRows("SELECT
`D1`.`device_id` AS `local_device_id`,
`D1`.`os` AS `local_os`,
@ -165,7 +165,7 @@ foreach ($list as $items) {
if ($link_used > 100) {
$link_used = 100;
}
$link_color = $config['map_legend'][$link_used];
$link_color = $config['network_map_legend'][$link_used];
$tmp_links[] = array('from'=>$items['local_device_id'],'to'=>$items['remote_device_id'],'label'=>shorten_interface_type($items['local_ifname']) . ' > ' . shorten_interface_type($items['remote_ifname']),'title'=>generate_port_link($local_port, "<img src='graph.php?type=port_bits&amp;id=".$items['local_port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=100&amp;height=20&amp;legend=no&amp;bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
if (!in_array($items['remote_port_id'],$tmp_link_ids)) {
$tmp_links[] = array('from'=>$items['local_device_id'],'to'=>$items['remote_device_id'],'label'=>shorten_interface_type($items['local_ifname']) . ' > ' . shorten_interface_type($items['remote_ifname']),'title'=>generate_port_link($local_port, "<img src='graph.php?type=port_bits&amp;id=".$items['local_port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=100&amp;height=20&amp;legend=no&amp;bg=".str_replace("#","", $row_colour)."'>\n",'',0,1),'width'=>$width,'color'=>$link_color);

View File

@ -306,7 +306,7 @@ $config['graph_colours']['purples'] = array(
$config['graph_colours']['default'] = $config['graph_colours']['blues'];
// Map colors
$config['map_legend'] = array(
$config['network_map_legend'] = array(
'0' => '#aeaeae',
'10' => '#79847e',
'20' => '#97ffca',
@ -319,7 +319,7 @@ $config['map_legend'] = array(
'90' => '#ff6600',
'100' => '#ff0000',
);
$config['map_items'] = array('xdp','mac');
$config['network_map_items'] = array('xdp','mac');
// Device page options
$config['show_overview_tab'] = true;