Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 549b8877 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

Update README.md

parent e3cd320f
No related branches found
No related tags found
No related merge requests found
......@@ -59,14 +59,11 @@ To use this tool:
<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 ...]] [-v]
[--data-source DATA_SOURCE] [--debug] [--dont-compare]
[--inventory-columns INVENTORY_COLUMNS] [--keep-domain]
[--keep-max KEEP_MAX] [--lldp] [--lowercase]
[--min-age MIN_AGE]
[--path-in-inventory PATH_IN_INVENTORY]
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 ...]] [-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]
This script creates the topology data file needed for the Checkmk "network_visualization"
......@@ -78,7 +75,7 @@ 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.5-202310117 | Written by: thl-cmk
Version: 0.0.6-202310117 | Written by: thl-cmk
for more information see: https://thl-cmk.hopto.org
options:
......@@ -93,6 +90,8 @@ options:
List of devices to start the topology discovery from.
I.e. Core01 Core02
-v, --version Print version of this script and exit
--check-user-data-only
Only tries to read/parse the user data from create_topology_data.toml and exits.
--data-source DATA_SOURCE
The source from which the topology data originates.
I.e. inv_CDP for CDP data from the inventory.
......@@ -109,16 +108,16 @@ options:
NOTE: the columns must be in the order: neighbour, local_port,
neighbour_port
--keep-domain Do not remove the domain name from the neighbor name
--keep-max KEEP_MAX Number of topologies to keep. The oldest topologies above keep
max will be deleted. The minimum value for --keep-max is 1.
Note: The default topologies will be always kept.
--keep KEEP Number of topologies to keep. The oldest topologies above keep
max will be deleted. The minimum value for --keep is 1.
NOTE: The default topologies will be always kept.
--lldp Sets data source to inv_LLDP, inventory path
to "networking,lldp_cache" and columns
to "system_name,local_port_num,port_id"
--lowercase Change neighbour names to all lower case
--min-age MIN_AGE The minimum number of days before a topology is deleted
by "--keep-max".
Note: Topologies that are not older than 1 days are always kept.
by "--keep".
NOTE: Topologies that are not older than 1 days are always kept.
--path-in-inventory PATH_IN_INVENTORY
Checkmk inventory path to the topology data.
I.e. "networking,cdp_cache"
......@@ -132,7 +131,6 @@ for CDP (the default):
for LLDP:
~/local/bin/network-topology/create_topology_data.py -s Core01 Core02 -m --lldp
OMD[build]:~$
```
</details>
......@@ -162,7 +160,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-max 10 --keep-max 10 --min-age 14
0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s C9540-7-1 -m --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.
......@@ -183,7 +181,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-max 10
0 * * * * $OMD_ROOT/local/bin/topology_data/create_topology_data.py -s Core01 -m --keep 10
# ------------------------------------------------------------
```
......@@ -195,22 +193,22 @@ OMD[build]:~/etc/cron.d$ crontab -l | grep -A 3 -B 1 create_topoloky_data
<details><summary>Can I limit the number of topology changes saved</summary>
\
Yes. If you use the option --keep-max <number of topologies to keep> the tool will delete all topologies over this number. I.e.
Yes. If you use the option --keep <number of topologies to keep> the tool will delete all topologies over this number. I.e.
```
$ ~/local/bin/topology_data/create_topology_data.py -s Core01 --keep-max 10
$ ~/local/bin/topology_data/create_topology_data.py -s Core01 --keep 10
```
will delete the oldest topologies until there only 10 topologies left.
**Note**: the default topology will never be deleted.
**Note**: the minimal `--keep-max` is _1_
**Note**: the minimal `--keep` is _1_
</details>
<details><summary>I will not delete topologies from the last X days</summary>
No problem. Just use the option `--min-age` togeher with `--keep-max`. I.e.
No problem. Just use the option `--min-age` togeher with `--keep`. I.e.
```
$ ~/local/bin/topology_data/create_topology_data.py -s Core01 --keep-max 10 --min-age 30
$ ~/local/bin/topology_data/create_topology_data.py -s Core01 --keep 10 --min-age 30
```
will only delete a topology if it older than 30 days.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment