From 015b176b71388554b874e6d5e69a4de452616ca1 Mon Sep 17 00:00:00 2001
From: thl-cmk <thl-cmk@outlook.com>
Date: Fri, 20 Oct 2023 17:24:48 +0000
Subject: [PATCH] Update README.md

---
 README.md | 43 ++++++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index 82129c6..516350e 100644
--- a/README.md
+++ b/README.md
@@ -68,23 +68,29 @@ To use this tool:
 
 Usage with CDP (this is the default):
 ```
-~/local/lib/topology_data/create_topology_data.py -s Core01 -m
+~/local/lib/topology_data/create_topology_data.py -s Core01 -d
 ```
-
 Usage with LLDP:
 ```
-~/local/lib/topology_data/create_topology_data.py -s Core01 -m --lldp
+~/local/lib/topology_data/create_topology_data.py -s Core01 -d --lldp
+```
+
+Usage with CDP merged into LLDP
+```
+~/local/lib/topology_data/create_topology_data.py -s Core01 -d -m CDP LLDP
 ```
 
 <details><summary>Help output from create_topology_data.py -h</summary>
 
 ```
 OMD[build]:~$ ~/local/bin/topology_data/create_topology_data.py -h
-usage: create_topology_data.py [-h] [-m] [-o OUTPUT_DIRECTORY] [-s SEED_DEVICES [SEED_DEVICES ...]]
-                               [-u USER_DATA_FILE] [-v] [--check-user-data-only] [--data-source DATA_SOURCE]
-                               [--debug] [--dont-compare] [--inventory-columns INVENTORY_COLUMNS] [--keep-domain]
+usage: create_topology_data.py [-h] [-d] [-m {CDP,LLDP} {CDP,LLDP}] [-o OUTPUT_DIRECTORY]
+                               [-s SEED_DEVICES [SEED_DEVICES ...]] [-u USER_DATA_FILE] [-v]
+                               [--check-user-data-only] [--data-source DATA_SOURCE] [--debug]
+                               [--dont-compare] [--inventory-columns INVENTORY_COLUMNS] [--keep-domain]
                                [--keep KEEP] [--lldp] [--lowercase] [--min-age MIN_AGE]
-                               [--path-in-inventory PATH_IN_INVENTORY] [--time-format TIME_FORMAT] [--uppercase]
+                               [--path-in-inventory PATH_IN_INVENTORY] [--time-format TIME_FORMAT]
+                               [--uppercase]
 
 This script creates the topology data file needed for the Checkmk "network_visualization"
 plugin by Andreas Boesl and schnetz. For more information see
@@ -95,12 +101,19 @@ 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
 
-Version: 0.0.7-202310118 | Written by: thl-cmk
+Version: 0.0.8-202310120 | Written by: thl-cmk
 for more information see: https://thl-cmk.hopto.org
 
 options:
   -h, --help            show this help message and exit
-  -m, --make-default    Set the created topology data as default
+  -d, --default         Set the created topology data as default
+  -m {CDP,LLDP} {CDP,LLDP}, --merge {CDP,LLDP} {CDP,LLDP}
+                        Merge topologies. This runs the topology creation for CDP and LLDP.
+                        The topologies are then merged in the specified order.
+                        I.e. -m CDP LLDP merges the CDP topology into the LLDP topology, overwriting
+                        the LLDP data in case there are conflicts.
+                        NOTE: static connection data from the user file will always merged with the
+                         highest priority
   -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
@@ -150,9 +163,9 @@ options:
 
 Usage:
 for CDP (the default):
-~/local/bin/network-topology/create_topology_data.py -s Core01 Core02 -m
+~/local/bin/network-topology/create_topology_data.py -s Core01 Core02 -d
 for LLDP:
-~/local/bin/network-topology/create_topology_data.py -s Core01 Core02 -m --lldp
+~/local/bin/network-topology/create_topology_data.py -s Core01 Core02 -d --lldp
 OMD[build]:~$
 ```
 
@@ -169,10 +182,10 @@ OMD[build]:~$
 <details><summary>If i open the Network visualization, there is no default topology</summary>
 
 \
-To make the topology created by this tool the default use the option `-m` / `--make-default`
+To make the topology created by this tool the default use the option `-d` / `--default`
 
 ```
-$ ~/local/bin/topology_data/create_topology_data.py -s Core01 -m
+$ ~/local/bin/topology_data/create_topology_data.py -s Core01 -d
 ```
 
 </details>
@@ -183,7 +196,7 @@ $ ~/local/bin/topology_data/create_topology_data.py -s Core01 -m
 Yes. Add a cron job for the site user in `~/etc/cron.d`. I.e. to create a topology every hour create the file `create_topoloky_data` in `~/etc/cron.d`
 
 ```
-0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s C9540-7-1 -m --keep 10 --min-age 14
+0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s C9540-7-1 -d --keep 10 --min-age 14
 ```
 
 This will run the tool every hour and create a new topology if there was a changee. It keeps 10 topologies and deletes old topologies only if they are older than 14 days.
@@ -204,7 +217,7 @@ With crontab -l you get the list of active cron jobs
 OMD[build]:~/etc/cron.d$ crontab -l | grep -A 3 -B 1  create_topoloky_data 
 # ------------------------------------------------------------
 # /omd/sites/build/etc/cron.d/create_topoloky_data
-0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s Core01 -m --keep 10
+0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s Core01 d --keep 10
 
 # ------------------------------------------------------------
 ```
-- 
GitLab