From 79171869b04cca6da382fde2a3d0048800b15442 Mon Sep 17 00:00:00 2001 From: thl-cmk <thl-cmk@outlook.com> Date: Sun, 15 Oct 2023 19:18:06 +0000 Subject: [PATCH] Update README.md --- README.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0f52178..b531a1b 100644 --- a/README.md +++ b/README.md @@ -101,25 +101,66 @@ OMD[build]:~$ If neighbour names in CD/LLDP data and Checkmk host names don't match, you can configure a mapping in the `create_topology_data.py` file. I.e.: +--- +### FAQ + +<details><summary>Can the topology data creation be customized</summary> + +\ +Yes. You can customize the topology data creation by modifying the `~/local/bin/topology_data/create_topology_data.toml` file. Use `~/local/bin/topology_data/create_topology_data.toml_clean` as a template. + +**Note**: This file uses [Tom's Obvious Minimal Language](https://toml.io/en/) + +</details> + +<details><summary>Neighbor names from inventory and checkmk host names do not match</summary> + +\ +If the neighbor names from the inventory and the checkmk host names do not match, the topology does not work. To fix this, add a mapping between the neighbor name and the checkmk name to the **HOST_MAP** in the `create_topology_data.toml` file. I.e. + ``` -# map inventory neighbour name to CMK host name -HOST_MAP = { - 'neighbour': 'cmk_host',, - 'nexus01': 'NX01', - 'nexus02': 'NX02', - 'nexus03': 'NX03', -} +# map inventory neighbour name to Checkmk host name +[HOST_MAP] +inventory_neighbour1 = "cmk_host1" +inventory_neighbour2 = "cmk_host2" +inventory_neighbour3 = "cmk_host3" ``` -**NOTE**: the script will automatically remove the domain name form the neighbour names. See Usage option `-k` / `--keep-domain` +**NOTE**: The script will automatically remove the domain name form the neighbour names. See Usage option `-k` / `--keep-domain` + +</details> + +<details><summary>In the inventory are invalid neighbor names</summary> + +\ +If you have invalid neighbor names in the inventory (i.e. "not advertised"), you can drop them by adding them to the **DROP_HOSTS** list in the `create_topology_data.toml` file. I.e.. -At the same place you can exclude invalid hosts from the topology data ``` # drop neighbours with invalid names DROP_HOSTS = [ - 'not advertised', + "not advertised", + "a nother invalid name", +] +``` + +</details> + + +<details><summary>Not all connections are included in the inventory</summary> + +\ +If your inventory data does not contain all the required topology information, you can add static connections in the `create_topology_data.toml` file. This may be the case if not all of your devices use CDP/LLDP. The connections defined in **STATIC_CONNECTIONS** are added to the topology from host to neighbor and vice versa. I.e.. + +``` +# user defined static connections +# connections will be added from host to neighbour and in reverese +STATIC_CONNECTIONS = [ + ["host1", "local-port1", "neighbour-port1", "neighbour1", "label"], + ["host1", "local-port2", "neighbour-port2", "neighbour2", "label"], ] ``` +</details> + --- ### Sample Output -- GitLab