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

update project

parent 72a89f53
No related branches found
No related tags found
No related merge requests found
......@@ -16,4 +16,4 @@
2023-01-19: fix using wrong local interface id, switched from IF-MIB::ifName to LLDP-MIB::lldpLocPortId
2023-02-14: fix missing import for declare_invtable_view in inv_lldp_cache.py
2023-02-16: replaced TypedDic (Neighbour) with Dict, removed Dataclass --> wasn't working in CMK 2.1
2023-02-16: changed for CMK 2.1 (moved WATO/VIEW to ~/local/lib/gui/plugins/)
......@@ -161,14 +161,12 @@ def parse_inv_lldp_cache(string_table: List[StringTable]) -> List[Dict[str, str]
return ''
capabilities = []
bytestring = int(ord(bytestring[0]))
# bytestring = bytestring >> 1 # capabilities are one bit of (e.g. L3-Switch has Phone/WLAN instead of Bridge/Router)
for x in lldp_capabilities:
tempcap = lldp_capabilities.get(bytestring & x)
if tempcap != '':
capabilities.append(tempcap)
capabilities = str(', '.join(capabilities))
# print (bytestring , '/' , capabilities)
return capabilities
lldp_info, if_info = string_table
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 2023-01-14: fixed missing import for declare_invtable_view
#
from cmk.gui.plugins.views.utils import (
inventory_displayhints,
)
from cmk.gui.plugins.views.inventory import (
declare_invtable_view,
)
from cmk.gui.i18n import _
inventory_displayhints.update({
'.networking.lldp_cache:': {'title': _('LLDP Cache'),
'keyorder': ['system_name', 'chassis_id', 'port_id', 'local_port_num'],
'view': 'invlldpcache_of_host',
},
'.networking.lldp_cache:*.chassis_id': {'title': _('Neighbour Chassis ID'), },
'.networking.lldp_cache:*.port_id': {'title': _('Neighbour port ID'), },
'.networking.lldp_cache:*.port_description': {'title': _('Neighbour port description'), },
'.networking.lldp_cache:*.system_name': {'title': _('Neighbour name'), },
'.networking.lldp_cache:*.system_description': {'title': _('Neighbour description'), },
'.networking.lldp_cache:*.local_port_num': {'title': _('Local port ID'), },
'.networking.lldp_cache:*.capabilities_map_supported': {'title': _('Capabilities map supported'), },
'.networking.lldp_cache:*.cache_capabilities': {'title': _('Cache Capabilities'), },
})
declare_invtable_view('invlldpcache', '.networking.lldp_cache:', _('LLDP cache'), _('LLDP Cache'))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
from cmk.gui.i18n import _
from cmk.gui.plugins.wato.utils import (
HostRulespec,
rulespec_registry,
)
from cmk.gui.valuespec import (
Dictionary,
FixedValue,
TextAscii,
ListChoice,
)
from cmk.gui.plugins.wato.inventory import (
RulespecGroupInventory,
)
def _valuespec_inv_lldp_cache():
removecolumns = [
('port_description', 'Neighbour port description'),
('system_description', 'Neighbour description'),
('capabilities_map_supported', 'Capabilities map supported'),
('cache_capabilities', 'Cache Capabilities'),
]
return Dictionary(
title=_('LLDP cache'),
elements=[
('remove_domain',
FixedValue(
True,
title=_('Remove domain name from neighbour device name'),
totext=_(''),
default_value=False,
)),
('domain_name',
TextAscii(
title=_('Specific domain name to remove from neighbour device name'),
allow_empty=False,
default_value='',
)),
('removecolumns',
ListChoice(
title=_('List of columns to remove'),
help=_('information to remove from inventory'),
choices=removecolumns,
default_value=[],
)),
('use_short_if_name',
FixedValue(
True,
title=_('use short interface names (i.e. Gi0/0 for GigabitEthernet0/0)'),
totext=_(''),
default_value=False,
)),
],
)
rulespec_registry.register(
HostRulespec(
group=RulespecGroupInventory,
match_type="dict",
name="inv_parameters:inv_lldp_cache",
valuespec=_valuespec_inv_lldp_cache,
))
No preview for this file type
......@@ -8,15 +8,14 @@
'neighbor name\n'
' - 2019-03-04: added support for cmk1.5.x\n'
' - 2020-05-13: added support for CMK1.6x\n'
' - 2021-03-17: rewritten for CMK 2.x\n',
' - 2021-03-17: rewritten for CMK 2.0\n'
' - 2023-02-16: changed for CMK 2.1\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['inv_lldp_cache.py'],
'web': ['plugins/views/inv_lldp_cache.py',
'plugins/wato/inv_lldp_cache.py']},
'gui': ['wato/inv_lldp_cache.py', 'views/inv_lldp_cache.py']},
'name': 'inv_lldp_cache',
'num_files': 3,
'title': 'inventory for LLDP cache',
'version': '20230216.v05f',
'version.min_required': '2.0.0',
'version': '20230216.v07',
'version.min_required': '2.1.0',
'version.packaged': '2.1.0p21',
'version.usable_until': None}
\ No newline at end of file
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