Network Map w/ port-channels or multiple links

I did the latest git pull and the code changes were in there as @louis had mentioned. However, I am still not seeing multiple links. I am using xdp for link detection.

1 Like

New pull request the issue

Do not optimize if array $config[‘network_map_items’] contains “mac”.

1 Like

Currently on master, I only see 1 link between devices on the map instead of all the links of the aggregate (I have $config['network_map_items'] = ["xdp"];)

Still works on my side
You should debug print-map.inc.php to see what’s going on

Any hint on how to debug it ? I’m not really familiar with this part

I took a look at the generated JSON code used by viz and it looks like all the data is there (all the links) so I assume they are all overlapping ?

Well done
In that case, try with this config

$config[‘network_map_vis_options’] = ‘{
“nodes”: {
“color”: {
“background”: “rgba(20,252,18,1)”
},
“font”: {“size”:20},
“shadow”: {“enabled”:true}
},
“physics”: {
“solver”: “repulsion”,
“minVelocity”: 1.75,
“repulsion”: {
“centralGravity”: 0.1,
“nodeDistance”: 300,
“springLength”: 300,
“springConstant”: 0.05
},
}
}’;

$config[‘network_map_legend’][‘dn’][‘node’] = “rgba(193,66,66,1)”;
$config[‘network_map_legend’][‘dn’][‘edge’] = “rgba(193,66,66,1)”;

Yes, this way I do see multiple links correctly :slight_smile:
But on routers with a lot of aggregate between them, they are too close and are quite difficult to read, I suppose there is a configuration for that ?

play with parameters and post them so that we can do a pull request to change default parameters

“physics”: {
“solver”: “repulsion”,
“minVelocity”: 1.75,
“repulsion”: {
“centralGravity”: 0.1,
“nodeDistance”: 300,
“springLength”: 300,
“springConstant”: 0.05

I started playing with those, I could mostly fix the global map, but with the device level map, I always get the 2 devices completely overlapping, I’m stil investigating on how to fix this part.

This is my current config

"physics": {
"solver": "repulsion",
"minVelocity": 1.75,
"repulsion": {
"centralGravity": 0.1,
"nodeDistance": 1000,
"springLength": 800,
"springConstant": 0.05
},
}

1 Like

Hi @kedare @louis !
Please trie using this config. I think the parameter “forceAtlas2Based” would help you.

$config[‘network_map_vis_options’] = '{
“nodes”: {
“borderWidthSelected”: null,
“color”: {
“highlight”: {},
“hover”: {}
},
“font”: {
“size”: 24,
“strokeWidth”: null
},
“shapeProperties”: {
“borderRadius”: null
},
“size”: null
},
“edges”: {
“font”: {
“size”: 19,
“align”: “top”
},
“smooth”: {
“forceDirection”: “none”
}
},
“physics”: {
“forceAtlas2Based”: {
“gravitationalConstant”: -200,
“centralGravity”: 0.005,
“springLength”: 600,
“springConstant”: 0.09,
“avoidOverlap”: 0.29
},
“minVelocity”: 0.92,
“solver”: “forceAtlas2Based”
}

}’;

This is an example:

Regards

2 Likes

Thank you, indeed this one works better :slight_smile:
I still have a few issue with some links but I suppose I just have too many links between some devices

Hi Kedare
Yes, when you have many links between devices its more difficult to make them look right, trie to modify this values:

“centralGravity”: 0.005,
“springLength”: 600, <<<<<<< move to 1000
“springConstant”: 0.09,
“avoidOverlap”: 0.29

Regards

Could make a pull request to set that by default ?

That would be great! i will check what are the steps to make a pull request, because i never did it.

Regards

Steps are on github with an account :

  • click on fork
  • sync to your workstation git clone https://github.com/your-login/librenms
  • create a new branch git branch network_map_vis_options
  • go to branch git checkout network_map_vis_options
  • commit your patch on the branch git commit -am "network_map_vis_options default
  • make a pull request from webui

Hi Louis! This are the logs when i tried to make a pull request:

[email protected]:/opt/librenms# git commit -am “network_map_vis_options default”
On branch network_map_vis_options
Untracked files:
includes/my-port-descr-parser.inc.php
librenms/

nothing added to commit but untracked files present

The modification on the code doesn’t figure because the "config[‘network_map_vis_options’] " is in config.php?

[email protected]:/opt/librenms# git add config.php
The following paths are ignored by one of your .gitignore files:
config.php
Use -f if you really want to add them.

Regards

I think the default options are set in ./misc/config_definitions.json ? (But nore sure, btw config.php.default still refers to includes/default.inc.php that is gone)
config.php should not be in the git repository indeed (as it’s specific to your setup)

Yes, it looks like the default config of network map is in “/misc/config_definitions.json”

   > "network_map_vis_options": {
>             "default": "{\n  layout:{\n      randomSeed:2\n  },\n  \"edges\": {\n    arrows: {\n          to:     {enabled: true, scaleFactor:0.5},\n    },\n    \"smooth\": {\n        enabled: false\n    },\n    font: {\n        size: 14,\n        color: \"red\",\n        face: \"sans\",\n        background: \"white\",\n        strokeWidth:3,\n        align: \"middle\",\n        strokeWidth: 2\n    }\n  },\n  \"physics\": {\n     \"barnesHut\": {\n      \"gravitationalConstant\": -2000,\n      \"centralGravity\": 0.3,\n      \"springLength\": 200,\n      \"springConstant\": 0.04,\n      \"damping\": 0.09,\n      \"avoidOverlap\": 1\n    },\n\n     \"forceAtlas2Based\": {\n      \"gravitationalConstant\": -50,\n      \"centralGravity\": 0.01,\n      \"springLength\": 200,\n      \"springConstant\": 0.08,\n      \"damping\": 0.4,\n      \"avoidOverlap\": 1\n    },\n\n     \"repulsion\": {\n      \"centralGravity\": 0.2,\n      \"springLength\": 250,\n      \"springConstant\": 0.2,\n      \"nodeDistance\": 200,\n      \"damping\": 0.07\n    },\n\n     \"hierarchicalRepulsion\": {\n      \"nodeDistance\": 300,\n      \"centralGravity\": 0.2,\n      \"springLength\": 300,\n      \"springConstant\": 0.2,\n      \"damping\": 0.07\n    },\n\n  \"maxVelocity\": 50,\n  \"minVelocity\": 0.4,\n  \"solver\": \"hierarchicalRepulsion\",\n  \"stabilization\": {\n    \"enabled\": true,\n    \"iterations\": 1000,\n    \"updateInterval\": 100,\n    \"onlyDynamicEdges\": false,\n    \"fit\": true\n  },\n\n  \"timestep\": 0.4,\n }\n}",
>             "type": "text"
>         },

yes do
git add misc/config_definitions.json