From d8e7921b81fca7e84badb43f4362e2ef7a5b732a Mon Sep 17 00:00:00 2001 From: thl-cmk <thl-cmk@outlook.com> Date: Sun, 17 Nov 2024 16:47:00 +0000 Subject: [PATCH] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 0e91e8c..c5307d2 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -109,13 +109,13 @@ This can happen if NVDCT cannot map the neighbor names from CDP/LLDP to host nam The best way to solve such issues use the same name on the device and in Checkmk. If this not possible there are several options how NVDCT converts neighbor names to Checkmk names -1. NVDCT removes the domain name and only uses the host name +1. You can remove the domain name from the neighbour name. - If the FQDN is used in Checkmk, this kan be disabled with the option `--keep-domain` or in the configuratin file with + To use only the hostname part from the neighbour as chekmk host name, use the option `--remove-domain` or in the configuratin file set `remove_domain` under `[SETTINGS]` to `true`. ``` [SETTINGS] - keep_domain = true + remove_domain = true ``` 1. NVDCT can convert all neighbor names to upper or lower case @@ -136,18 +136,35 @@ The best way to solve such issues use the same name on the device and in Checkmk prefix = "yor-prefix-" ``` -4. NVDCT can map neighbor names to Checkmk names via the [HOST_MAP] section. +4. NVDCT can map neighbor names to Checkmk names via the L2_[HOST_MAP] section. - If all this options dont solve your nameig issues, there is as last option the [HOST_MAP] section in the settings file. Here you can map neighbor names to Checkmk names. + If all this options dont solve your nameig issues, there is as last option the [HOST_MAP] section in the settings file. + Here you can map neighbor names to Checkmk names. ``` - [HOST_MAP] + [L2_HOST_MAP] inventory_neighbour1 = "cmk_host1" inventory_neighbour2 = "cmk_host2" inventory_neighbour3 = "cmk_host3" ``` - You can use the NVDCT log file to check for such issues +5. Use of L2_NEIGHBOUR_REPLACE_REGEX + + If you need ro replace more comlex parts of the neighbour name (ie. serial numbers) you can use the L2_NEIGHBOUR_REPLACE_REGEX + section in the config file. Ie. to replace the serial number at the end of some neighbour names use + + ``` + [L2_NEIGHBOUR_REPLACE_REGEX] + "\\([0-9a-zA-Z]+\\)$" = "" + ``` + + You can also use this section to drop neighbour (Ie. MAC addresses). + ``` + [L2_NEIGHBOUR_REPLACE_REGEX] + "^(([0-9a-fA-F]){2}[:.-]?){5}([0-9a-fA-F]){2}$" = "" + ``` + +6. You can use the NVDCT log file to check for such issues ``` OMD[build]:~$ grep "not found in CMK" ~/var/log/nvdct.log @@ -165,20 +182,19 @@ In most environments you will find some devices in the CDP/LLDP topology that ar There are two options in the configuration file to remove such devices from the topology. -Under `DROP_HOST` you can simply add neighbor names to be excluded from the topology creation. +Under `L2_DROP_HOST` you can simply add neighbor names to be excluded from the topology creation. ``` -DROP_HOSTS = [ +L2_DROP_HOSTS = [ "not advertised", "a nother invalid name", ] ``` -If `DROP_HOST` is not sufficient, you can use `DROP_HOSTS_REGEX`. It has the same purpose as DROP_HOSTS, but the names are interpreted here as Python regex. You can use this, for example, to remove neighbors with a MAC address as a neighbor name from the topology. +If `L2_DROP_HOST` is not sufficient, you can use `L2_NEIGHBOUR_REPLACE_REGEX`. Ie. to remove neighbours with a MAC addresses as name use: ``` -DROP_HOSTS_REGEX = [ - "^(([0-9a-fA-F]){2}[:.-]?){5}([0-9a-fA-F]){2}$", -] +[L2_NEIGHBOUR_REPLACE_REGEX] +"^(([0-9a-fA-F]){2}[:.-]?){5}([0-9a-fA-F]){2}$" = "" ``` </details> -- GitLab