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 7a06a675 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent c79d4ea1
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/nvdct-0.8.7-20240430.mkp "nvdct-0.8.7-20240430.mkp"
[PACKAGE]: ../../raw/master/mkp/nvdct-0.8.8-20240508.mkp "nvdct-0.8.8-20240508.mkp"
Network Visualization Data Creation Tool (NVDCT)
This script creates the topology data file needed for the [Checkmk Exchange Network visualization](https://exchange.checkmk.com/p/network-visualization) plugin by Andreas Boesl and [schnetz](https://exchange.checkmk.com/u/schnetz).\
......
File added
......@@ -58,6 +58,7 @@ class Wildcard(NamedTuple):
int_wildcard: int
ip_address: str
wildcard: str
bit_pattern: int
class Settings:
......@@ -400,11 +401,14 @@ class Settings:
)
continue
try:
# 0.0.127.0 -> 255.255.128.255
inverted_wildcard = '.'.join([str(255 - int(octet)) for octet in wildcard.split('.')])
self.__l3v4_ignore_wildcard.append(Wildcard(
int_ip_address=int(IPv4Address(ip_address)),
int_wildcard=int(IPv4Address(wildcard)),
int_wildcard=int(IPv4Address(inverted_wildcard)),
ip_address=ip_address,
wildcard=wildcard,
bit_pattern= int(IPv4Address(ip_address)) & int(IPv4Address(inverted_wildcard))
))
except (AddressValueError, NetmaskValueError):
LOGGER.error(
......
......@@ -22,7 +22,7 @@ from time import time as now_time
from tomllib import loads as toml_loads, TOMLDecodeError
from typing import List, Dict, Any, TextIO
NVDCT_VERSION = '0.8.7-20240430'
NVDCT_VERSION = '0.8.8-20240507'
@unique
......
......@@ -101,6 +101,7 @@
# 2024-04-18: added option --skip-l3-ip
# added tooltip for --skip-l3-if and --skip-l3-ip
# 2024-04-30: automatically create @default if it doesn't exist
# 2024-05-07: fixed handling of ignore wildcard in L3v4 topology
# creating topology data json from inventory data
#
......@@ -872,7 +873,7 @@ def is_ignore_ipv4(ip_address: str, ignore_ips: List[IPv4Network]) -> bool:
def is_ignore_wildcard(ip_address: str, ignore_wildcard: List[Wildcard]) -> bool:
int_ip_address = int(IPv4Address(ip_address))
for wildcard in ignore_wildcard:
if int_ip_address & wildcard.int_wildcard == wildcard.int_ip_address:
if int_ip_address & wildcard.int_wildcard == wildcard.bit_pattern:
LOGGER.info(
f'IP address {ip_address} matches ignore wildcard '
f'list ({wildcard.ip_address}/{wildcard.wildcard})'
......
......@@ -44,9 +44,14 @@ L3V4_IGNORE_IP = [
]
# ignore IPs by wildcard
# if comparing an ip address:
# each 0 bit in the wildcad has to be exacly as in the pattern
# each 1 bit in the wildacrd will be ignored
L3V4_IRNORE_WILDCARD = [
# ["0.0.0.1", "0.0.0.255"], # ignore all IPs ending with 1
# ["172.17.0.2", "255.255.0.255"], # ignore all IPs ending with 1 from 172.17.0.0/16
# [ pattern , wildcard ]
# ["172.17.0.1", "0.0.255.0"], # ignore all IPs ending with 1 from 172.17.128.0/16
# ["172.17.128.0", "0.0.127.3"], # ignore all IPs ending with 0-3 from 172.17.128.0/17
["172.17.128.3", "0.0.127.0"], # ignore all IPs ending with 3 from 172.17.128.0/17
]
# networks to summarize
......
......@@ -57,7 +57,7 @@
'htdocs/images/icons/location_80.png']},
'name': 'nvdct',
'title': 'Network Visualization Data Creation Tool (NVDCT)',
'version': '0.8.7-20240430',
'version': '0.8.8-20240508',
'version.min_required': '2.2.0b1',
'version.packaged': '2.2.0p24',
'version.usable_until': '2.4.0p1'}
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