diff --git a/HOWTO.md b/HOWTO.md index b42dadbc789109fda497e9f85f0af1107e742c80..441747bed39456595573f265fd7dc2970f28c1e9 100644 --- a/HOWTO.md +++ b/HOWTO.md @@ -1,110 +1,108 @@ # HOWTO -1. Requirements +## 1. Requirements - You need at least CMK 2.2.0 or CMK 2.3.0 to use the Network visualization +You need at least CMK 2.2.0 or CMK 2.3.0 to use the Network visualization -1. Installed packages +## 2. Installed packages - For the Network visualization to work you need to install some additional plugins (MKPs). +For the Network visualization to work you need to install some additional plugins (MKPs). - For the OSI layer 2 topology - - [CDP cache HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_cdp_cache) - - [LLDP cache HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_lldp_cache) +For the OSI layer 2 topology +- [CDP cache HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_cdp_cache) +- [LLDP cache HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_lldp_cache) - For the OSI layer 3 topology - - [IPv4 address HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_ipv4_addresses) +For the OSI layer 3 topology +- [IPv4 address HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_ipv4_addresses) - For the name to service matching (optional, but recommended) - - [INV_IFNAME HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_ifname) +For the name to service matching (optional, but recommended) +- [INV_IFNAME HW/SW inventory plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_ifname) - For the topology data creation - - [NVDCT (NetworkVisualizationDataCreationTool) plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/nvdct) +For the topology data creation +- [NVDCT (NetworkVisualizationDataCreationTool) plugin](https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/nvdct) - For topology visualization (**only CMK 2.2.0x**, CMK 2.3.0 has this built-in) - - [Network visualization plugin](https://exchange.checkmk.com/p/network-visualization) +For topology visualization (**only CMK 2.2.0x**, CMK 2.3.0 has this built-in) +- [Network visualization plugin](https://exchange.checkmk.com/p/network-visualization) - **Note**: [Here](https://thl-cmk.hopto.org/gitlab/explore/projects/topics/Network%20Visualization) you can find all plugins from this page at one place. +**Note**: [Here](https://thl-cmk.hopto.org/gitlab/explore/projects/topics/Network%20Visualization) you can find all plugins from this page at one place. - If you are done with the package installation your package repository should look like this -  +If you are done with the package installation your package repository should look like this + Here you will find help on [Checkmk extension packages (MKPs)](https://docs.checkmk.com/latest/en/mkps.html). -1. Checkmk Rules +## 3. Checkmk Rules - You should have two rules: - - Enable the HW/SW inventory for all your (network) devices that you want to include in the topology. -  - - Normal check interval for the HW/SW inventory check -  +You should have two rules: +- Enable the HW/SW inventory for all your (network) devices that you want to include in the topology. + +- Normal check interval for the HW/SW inventory check + - Here you will find help on CMKs [HW/SW Inventory](https://docs.checkmk.com/latest/en/inventory.html) +Here you will find help on CMKs [HW/SW Inventory](https://docs.checkmk.com/latest/en/inventory.html) -1. Host labels +## 4. Host labels - Some parts of the NVDCT are dependent on the presence of certain host labels: - - `nvdct/routing_capable:yes` for the IPv4 topology and `--pre-fetch` option - - `nvdct/has_cdp_neighbours:yes` for the `--pre-fetch` option - - `nvdct/has_lldp_neighbours:yes` for the `--pre-fetch` option +Some parts of the NVDCT are dependent on the presence of certain host labels: +- `nvdct/routing_capable:yes` for the IPv4 topology and `--pre-fetch` option +- `nvdct/has_cdp_neighbours:yes` for the `--pre-fetch` option +- `nvdct/has_lldp_neighbours:yes` for the `--pre-fetch` option - After installing the HW/SW inventory plugins, you must therefore perform rediscovery of host labels. +After installing the HW/SW inventory plugins, you must therefore perform rediscovery of host labels. -  + - Depending on the host data, the host labels should then be found on the host. -  +Depending on the host data, the host labels should then be found on the host. + - Here you will find help on [Including labels found in the discovery check](https://docs.checkmk.com/latest/en/labels.html?lquery=host%20label#discovery_check) +Here you will find help on [Including labels found in the discovery check](https://docs.checkmk.com/latest/en/labels.html?lquery=host%20label#discovery_check) -1. Check the HW/SW inventory +## 5. Check the HW/SW inventory - Run the HW/SW inventory at least once for each host and then check whether the required data has been found. If so, proceed to the next step. If your device has CDP neighbors, you should see a table like the table for LLDP. -  +Run the HW/SW inventory at least once for each host and then check whether the required data has been found. If so, proceed to the next step. If your device has CDP neighbors, you should see a table like the table for LLDP. + -1. Modify the user settings for NVDCT +## 6. Modify the user settings for NVDCT - Before you create the topology data, take a look at `~/local/bin/nvdct/conf/nvdct.toml`. Here you can fine tune some aspects of the topology creation. Before you do this, please create a copy of the nvdct.toml file (e.g. my_nvdct.toml) and only change the copy. By working with a copy of the `nvdct.toml` file, you ensure that your changes will survive the next update of the `nvdct.mkp`. For the CDP/LLDP topologies add at least your seed devices - from where NVDCT will start to create the topology - in the `SEED_DEVICES` section. +Before you create the topology data, take a look at `~/local/bin/nvdct/conf/nvdct.toml`. Here you can fine tune some aspects of the topology creation. Before you do this, please create a copy of the nvdct.toml file (e.g. my_nvdct.toml) and only change the copy. By working with a copy of the `nvdct.toml` file, you ensure that your changes will survive the next update of the `nvdct.mkp`. For the CDP/LLDP topologies add at least your seed devices - from where NVDCT will start to create the topology - in the `SEED_DEVICES` section. - ``` - # list of (additional to -s/--seed-devices) seed devices - SEED_DEVICES = [ - "DEVICE01", - "DEVICE02", - "DEVICE03", - ] - ``` - In the [SETTINGS] section enable the layers you want to create. By default NVDCT will onyl create the CDP layer. - ``` - # settings equivalent to CLI options - [SETTINGS] - # layers = ["LLDP", "CDP", "STATIC", "CUSTOM", "L3v4"] - layers = ["LLDP", "L3v4"] - ``` +``` +# list of (additional to -s/--seed-devices) seed devices +SEED_DEVICES = [ + "DEVICE01", + "DEVICE02", + "DEVICE03", +] +``` +In the [SETTINGS] section enable the layers you want to create. By default NVDCT will onyl create the CDP layer. +``` +# settings equivalent to CLI options +[SETTINGS] +# layers = ["LLDP", "CDP", "STATIC", "CUSTOM", "L3v4"] +layers = ["LLDP", "L3v4"] +``` +## 7. Create the topology data +``` +~/local/bin/nvdct/nvdct.py -u ~/local/bin/nvdct/conf/my_nvdct.toml +``` -1. Create the topology data +For CMK 2.3.0 you should find the created data under `~/var/check_mk/topology/data`. There should be also a symbolic link to the default topology. +``` +~$ ls -ls ~/var/check_mk/topology/data +total 20 +4 drwx------ 2 build build 4096 Apr 30 13:54 2024-04-30T13:54:51.04/ +4 drwx------ 2 build build 4096 Apr 30 14:17 2024-04-30T14:17:05.04/ +4 drwx------ 2 build build 4096 Apr 30 14:20 2024-04-30T14:20:07.04/ +4 drwx------ 2 build build 4096 Apr 30 14:25 2024-04-30T14:25:17.04/ +4 drwx------ 2 build build 4096 May 1 13:15 2024-05-01T13:15:51.05/ +0 lrwxrwxrwx 1 build build 57 Apr 30 14:25 default -> /omd/sites/build/var/check_mk/topology/data/2024-04-30T14:25:17.04/ - ``` - ~/local/bin/nvdct/nvdct.py -u ~/local/bin/nvdct/conf/my_nvdct.toml - ``` +``` +For CMK 2.2.0 you will find those files under `~/var/topology_data/` - For CMK 2.3.0 you should find the created data under `~/var/check_mk/topology/data`. There should be also a symbolic link to the default topology. - ``` - ~$ ls -ls ~/var/check_mk/topology/data - total 20 - 4 drwx------ 2 build build 4096 Apr 30 13:54 2024-04-30T13:54:51.04/ - 4 drwx------ 2 build build 4096 Apr 30 14:17 2024-04-30T14:17:05.04/ - 4 drwx------ 2 build build 4096 Apr 30 14:20 2024-04-30T14:20:07.04/ - 4 drwx------ 2 build build 4096 Apr 30 14:25 2024-04-30T14:25:17.04/ - 4 drwx------ 2 build build 4096 May 1 13:15 2024-05-01T13:15:51.05/ - 0 lrwxrwxrwx 1 build build 57 Apr 30 14:25 default -> /omd/sites/build/var/check_mk/topology/data/2024-04-30T14:25:17.04/ - - ``` - For CMK 2.2.0 you will find those files under `~/var/topology_data/` - -1. Go to CMK and show the network topology +## 8. Go to CMK and show the network topology Now you can show the Network topology 