From 118e1ed88b2881b5007e2f5b61a949b802c60517 Mon Sep 17 00:00:00 2001
From: thl-cmk <thl-cmk@outlook.com>
Date: Mon, 30 Dec 2024 11:01:50 +0000
Subject: [PATCH] Update README.md

---
 README.md | 100 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 46 deletions(-)

diff --git a/README.md b/README.md
index 9ba3b1d..9443e2c 100644
--- a/README.md
+++ b/README.md
@@ -82,31 +82,30 @@ and let Checkmk run the HW/SW inventory for each device at least once
 Usage with LLDP:
 
 ```
-~/local/bin/nvdct/nvdct.py -u ~/local/bin/conf/my_nvdct.toml -d -l LLDP
+~/local/bin/nvdct/nvdct.py -d -l LLDP
 ```
 
 <details><summary>Help output from nvdct.py --help</summary>
 
 ```
-OMD[build]:~$ ~/local/bin/nvdct/nvdct.py -h
+OMD[build]:~$ ./local/bin/nvdct/nvdct.py --help
 usage: nvdct.py [-h] [-b {LIVESTATUS,MULTISITE,RESTAPI}] [-d] [-o OUTPUT_DIRECTORY] [-p PREFIX]
-                [-l {CDP,CUSTOM,LLDP,STATIC,L3v4} [{CDP,CUSTOM,LLDP,STATIC,L3v4} ...]] [-u USER_DATA_FILE] [-v] [--api-port API_PORT]
-                [--case {LOWER,UPPER}] [--check-user-data-only] [--log-file LOG_FILE]
-                [--log-level {CRITICAL,FATAL,ERROR,WARNING,INFO,DEBUG,OFF}] [--log-to-stdout] [--dont-compare]
-                [--filter-customers {INCLUDE,EXCLUDE}] [--filter-sites {INCLUDE,EXCLUDE}] [--include-l3-hosts] [--remove-domain] [--keep KEEP]
-                [--min-age MIN_AGE] [--pre-fetch] [--quiet] [--skip-l3-if] [--skip-l3-ip] [--time-format TIME_FORMAT]
-
-This script creates the topology data file needed for the Checkmk "network_visualization"
-plugin by Andreas Boesl and schnetz. For more information see
-the announcement from schnetz: https://forum.checkmk.com/t/network-visualization/41680
-and the plugin on the Exchange: https://exchange.checkmk.com/p/network-visualization .
-
-The required inventory data can be created with my inventory plugins:
-CDP: https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_cdp_cache
-LLDP: https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_lldp_cache
-L3v4: https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/inventory/inv_ip_address
-
-Version: 0.9.4-20241210 | Written by: thl-cmk
+                [-l {CDP,LLDP,L3v4,STATIC} [{CDP,LLDP,L3v4,STATIC} ...]] [-u USER_DATA_FILE] [-v] [--adjust-toml]
+                [--api-port API_PORT] [--case {LOWER,UPPER}] [--check-user-data-only] [--log-file LOG_FILE]
+                [--log-level {CRITICAL,FATAL,ERROR,WARNING,INFO,DEBUG,OFF}] [--log-to-stdout] [--display-l2-neighbours]
+                [--dont-compare] [--filter-customers {INCLUDE,EXCLUDE}] [--filter-sites {EXCLUDE,EXCLUDE}] [--include-l3-hosts]
+                [--include-l3-loopback] [--remove-domain] [--keep KEEP] [--min-age MIN_AGE] [--pre-fetch] [--quiet]
+                [--skip-l3-cidr-0] [--skip-l3-cidr-32-128] [--skip-l3-if] [--skip-l3-ip] [--skip-l3-public]
+                [--time-format TIME_FORMAT]
+
+This script creates the topology data file needed for the Checkmk Network Visualization,
+For more information see the announcement from schnetz in the Checkmk forum:
+https://forum.checkmk.com/t/network-visualization/41680
+
+The required plugins to create the inventory data can be found here:
+https://thl-cmk.hopto.org/gitlab/explore/projects/topics/Network%20Visualization
+
+Version: 0.9.7-20241230 | Written by: thl-cmk
 for more information see: https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/nvdct
 
 options:
@@ -117,65 +116,74 @@ options:
                          - MULTISITE  : like LIVESTATUS but for distributed environments (default)
                          - RESTAPI    : uses the CMK REST API.
   -d, --default         Set the created topology data as default. Will be created automatically
-                        if it doesn't exists.
+                        if it doesnt exists.
   -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
                         Directory name where to save the topology data.
                         I.e.: my_topology. Default is the actual date/time
                         in "--time-format" format.
                         NOTE: the directory is a sub directory under "~/var/check_mk/topology/data/"
   -p PREFIX, --prefix PREFIX
-                        Prepends each host with the prefix. (Needs testing)
-  -l {CDP,CUSTOM,LLDP,STATIC,L3v4} [{CDP,CUSTOM,LLDP,STATIC,L3v4} ...], --layers {CDP,CUSTOM,LLDP,STATIC,L3v4} [{CDP,CUSTOM,LLDP,STATIC,L3v4} ...]
-                         - CDP   : needs inv_cdp_cache package at least in version 0.7.1-20240320
-                         - LLDP  : needs inv_lldp_cache package at least in version 0.9.3-20240320
-                         - L3v4  : needs inv_ip_address package at least in version 0.0.6-20241210 for SNMP based hosts
-                                   for Linux based hosts inv_lnx_ip_if in version 0.0.4-20241210
-                                   for Windows based hosts inv_win_ip_if in version 0.0.3-20241210
-                         - STATIC: creates a topology base on the "STATIC_CONNECTIONS" in the toml file
-                         - CUSTOM: (deprecated)
+                        Prepends each host with the prefix. (Needs more testing)
+  -l {CDP,LLDP,L3v4,STATIC} [{CDP,LLDP,L3v4,STATIC} ...], --layers {CDP,LLDP,L3v4,STATIC} [{CDP,LLDP,L3v4,STATIC} ...]
+                         - CDP      : needs inv_cdp_cache package at least in version 0.7.1-20240320
+                         - LLDP     : needs inv_lldp_cache package at least in version 0.9.3-20240320
+                         - L3v4     : needs inv_ip_address package at least in version 0.0.6-20241210 for SNMP based hosts
+                                      for Linux based hosts inv_lnx_ip_if in version 0.0.4-20241210
+                                      for Windows based hosts inv_win_ip_if in version 0.0.3-20241210
+                         - STATIC   : creates a topology base on the "[STATIC_CONNECTIONS]" section in the TOML file
   -u USER_DATA_FILE, --user-data-file USER_DATA_FILE
-                        Set the name uf the user provided data file
+                        Set the name of the user provided data file
                         Default is ~/local/bin/nvdct/conf/nvdct.toml
   -v, --version         Print version of this script and exit
-  --api-port API_PORT   TCP Port to access the REST API. Default is 80. NVDCT will try to automatically
+  --adjust-toml         Adjusts old options in TOML file.
+  --api-port API_PORT   TCP Port to access the REST API. By NVDCT will try to automatically
                         detect the site apache port.
-  --case {LOWER,UPPER}  Change neighbour name to all lower/upper case
+  --case {LOWER,UPPER}  Change L2 neighbour name to all lower/upper case before matching to CMK host
   --check-user-data-only
                         Only tries to read/parse the user data from nvdct.toml and exits.
-  --log-file LOG_FILE   Set the log file. Default is ~/var/log/nvdct.log
+  --log-file LOG_FILE   Set the log file. Default is "~/var/log/nvdct.log"
   --log-level {CRITICAL,FATAL,ERROR,WARNING,INFO,DEBUG,OFF}
                         Sets the log level. The default is "WARNING"
   --log-to-stdout       Send log to stdout.
+  --display-l2-neighbours
+                        Use L2 neighbour name as display name in L2 topologies
   --dont-compare        Do not compare the actual topology data with the default topology
                         data. By default, the actual topology is compared with the default
                         topology. If the data matches, the actual topology is not saved.
                         So, if you run this tool in a cron job, a new topology will be
                         created only if there was a change, unless you use "--dont-compare".
   --filter-customers {INCLUDE,EXCLUDE}
-                        INCLUDE/EXCLUDE customer list from config file.
+                        INCLUDE/EXCLUDE customer list "[CUSTOMERS]" from TOML file.
                         Note: MULTISITE backend only.
-  --filter-sites {INCLUDE,EXCLUDE}
-                        INCLUDE/EXCLUDE site list from config file.
-                        Note: MULTISITE backend only.
-  --include-l3-hosts    Include hosts (single IP objects) in layer 3 topology
-  --remove-domain       Remove the domain name from the neighbor name
+  --filter-sites {EXCLUDE,EXCLUDE}
+                        INCLUDE/EXCLUDE site list "[SITES]" from TOML file.
+  --include-l3-hosts    Include hosts (single IP objects) in layer 3 topologies
+  --include-l3-loopback
+                        Include loopback ip-addresses in layer 3 topologies
+  --remove-domain       Remove the domain name from the L2 neighbor name before matching CMK host.
   --keep KEEP           Number of topologies to keep. The oldest topologies above keep
-                        max will be deleted.
-                        NOTE: The default topologies will be always kept.
-  --min-age MIN_AGE     The minimum number of days before a topology is deleted by "--keep".
+                        will be deleted.
+                        NOTE: The default/protected topologies will be kept always.
+  --min-age MIN_AGE     The minimum number of days before a topology is deleted by "--keep"
   --pre-fetch           Try to fetch host data, with less API calls. Can improve RESTAPI backend
                         performance
-  --quiet               Suppress output to stdtout
-  --skip-l3-if          Skip interface in layer 3 topology
-  --skip-l3-ip          Skip ip-address in layer 3 topology
+  --quiet               Suppress all output to stdtout
+  --skip-l3-cidr-0      Skip ip-address with CIDR "/0" in layer 3 topologies
+  --skip-l3-cidr-32-128
+                        Skip ip-address with CIDR "/32" or "/128" in layer 3 topologies
+  --skip-l3-if          Dont show interface in layer 3 topologies
+  --skip-l3-ip          Dont show ip-addresses in layer 3 topologies
+  --skip-l3-public      Skip public ip-addresses in layer 3 topologies
   --time-format TIME_FORMAT
-                        Format string to render the time. (default: %Y-%m-%dT%H:%M:%S.%m)
+                        Format string to render the time. (default: "%Y-%m-%dT%H:%M:%S.%m")
 
 Exit codes:
  0 - No error
  1 - Bad options list
+ 2 - Bad TOML file format
  3 - Backend not implemented
  4 - Automation secret not found
+ 5 - No layer to work on
 
 Usage:
 ~/local/bin/nvdct/nvdct.py -u ~/local/bin/nvdct/conf/my_nvdct.toml
-- 
GitLab