mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Docs + some variable changes
This commit is contained in:
17
doc/Extensions/Network-Map.md
Normal file
17
doc/Extensions/Network-Map.md
Normal 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.
|
@ -37,7 +37,7 @@ $tmp_ids = array();
|
|||||||
$tmp_links = array();
|
$tmp_links = array();
|
||||||
$tmp_link_ids = array();
|
$tmp_link_ids = array();
|
||||||
|
|
||||||
if (in_array('mac',$config['map_items'])) {
|
if (in_array('mac',$config['network_map_items'])) {
|
||||||
$ports = dbFetchRows("SELECT
|
$ports = dbFetchRows("SELECT
|
||||||
`D1`.`device_id` AS `local_device_id`,
|
`D1`.`device_id` AS `local_device_id`,
|
||||||
`D1`.`os` AS `local_os`,
|
`D1`.`os` AS `local_os`,
|
||||||
@ -76,7 +76,7 @@ if (in_array('mac',$config['map_items'])) {
|
|||||||
", $sql_array);
|
", $sql_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('xdp', $config['map_items'])) {
|
if (in_array('xdp', $config['network_map_items'])) {
|
||||||
$devices = dbFetchRows("SELECT
|
$devices = dbFetchRows("SELECT
|
||||||
`D1`.`device_id` AS `local_device_id`,
|
`D1`.`device_id` AS `local_device_id`,
|
||||||
`D1`.`os` AS `local_os`,
|
`D1`.`os` AS `local_os`,
|
||||||
@ -165,7 +165,7 @@ foreach ($list as $items) {
|
|||||||
if ($link_used > 100) {
|
if ($link_used > 100) {
|
||||||
$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&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
|
$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&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>",'',0,1),'width'=>$width,'color'=>$link_color);
|
||||||
if (!in_array($items['remote_port_id'],$tmp_link_ids)) {
|
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&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>\n",'',0,1),'width'=>$width,'color'=>$link_color);
|
$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&id=".$items['local_port_id']."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=100&height=20&legend=no&bg=".str_replace("#","", $row_colour)."'>\n",'',0,1),'width'=>$width,'color'=>$link_color);
|
||||||
|
@ -306,7 +306,7 @@ $config['graph_colours']['purples'] = array(
|
|||||||
$config['graph_colours']['default'] = $config['graph_colours']['blues'];
|
$config['graph_colours']['default'] = $config['graph_colours']['blues'];
|
||||||
|
|
||||||
// Map colors
|
// Map colors
|
||||||
$config['map_legend'] = array(
|
$config['network_map_legend'] = array(
|
||||||
'0' => '#aeaeae',
|
'0' => '#aeaeae',
|
||||||
'10' => '#79847e',
|
'10' => '#79847e',
|
||||||
'20' => '#97ffca',
|
'20' => '#97ffca',
|
||||||
@ -319,7 +319,7 @@ $config['map_legend'] = array(
|
|||||||
'90' => '#ff6600',
|
'90' => '#ff6600',
|
||||||
'100' => '#ff0000',
|
'100' => '#ff0000',
|
||||||
);
|
);
|
||||||
$config['map_items'] = array('xdp','mac');
|
$config['network_map_items'] = array('xdp','mac');
|
||||||
|
|
||||||
// Device page options
|
// Device page options
|
||||||
$config['show_overview_tab'] = true;
|
$config['show_overview_tab'] = true;
|
||||||
|
Reference in New Issue
Block a user