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

added drop broadcast IPs

parent 8acbc0c0
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/inv_ip_address-0.0.7-20241214.mkp "inv_ip_address-0.0.7-20241214.mkp"
[PACKAGE]: ../../raw/master/mkp/inv_ip_address-0.0.8-20250124.mkp "inv_ip_address-0.0.8-20250124.mkp"
# Inventory of IP addresses
The plugin adds the IP-addresses information to the inventory for devices monitored via SNMP. The plugin supports IPv4 and IPv6.
......
File added
......@@ -26,6 +26,8 @@
# 2024-12-14: fixed crash if raw_address is longer than raw_length (fortinet_2), ends with interface index
# better handling of raw_address length
# fixed crash in IBM raw_address format (dec_ip_address index out of range)
# 2025-01-21: added drop broadcast IPs
# 2025-01-24: fixed crash on bad prefix-length (to long for the ip version i.e. 33 for ipv4) ThX to to andreas doehler
from collections.abc import Mapping, MutableSequence, Sequence
from ipaddress import AddressValueError, NetmaskValueError, ip_interface
......@@ -192,9 +194,12 @@ def parse_inv_ip_addresses(string_table: List[StringByteTable]) -> Section:
try:
interface_ip = ip_interface(f'{raw_address}/{prefix}')
except (AddressValueError, NetmaskValueError):
except (AddressValueError, NetmaskValueError, ValueError):
continue
if interface_ip.ip.compressed == interface_ip.network.broadcast_address.compressed:
continue # drop broadcast IPs
if interface_ip.ip.is_loopback: # Drop localhost
continue
......
......@@ -13,7 +13,7 @@
'web': ['plugins/views/inv_ip_addresses.py']},
'name': 'inv_ip_address',
'title': 'Inventory of IP addresses',
'version': '0.0.7-20241214',
'version': '0.0.8-20250124',
'version.min_required': '2.3.0b1',
'version.packaged': 'cmk-mkp-tool 0.2.0',
'version.usable_until': '2.4.0b1'}
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