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

update project

parent 24c19bd6
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# inventory of opengear console servers serial lines # inventory of opengear console servers serial lines
# #
# 2023-02-20: moved gui files from ~/local/share/check_mk/... to ~/local/lib/check_mk... # 2023-02-20: moved gui files from ~/local/share/check_mk/... to ~/local/lib/check_mk...
# # 2023-06-16: removed unused inventory_ruleset_name and params
from cmk.base.plugins.agent_based.agent_based_api.v1 import ( from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register, register,
...@@ -70,10 +70,11 @@ _opengear_parity = { ...@@ -70,10 +70,11 @@ _opengear_parity = {
def parse_inv_opengear_serial_lines(string_table: StringTable): def parse_inv_opengear_serial_lines(string_table: StringTable):
section = [] section = []
for index, label, speed, databits, parity, stopbits, flowcontrol, mode, loglevel, dcd, dtr, dsr, cts, rts in string_table: for index, label, speed, databits, parity, stopbits, flowcontrol, mode, loglevel, \
dcd, dtr, dsr, cts, rts in string_table:
entry = { entry = {
'key_columns': { 'key_columns': {
'index': index 'index': f'{int(index):02}'
}, },
'inventory_columns': { 'inventory_columns': {
'label': label, 'label': label,
...@@ -100,7 +101,7 @@ def parse_inv_opengear_serial_lines(string_table: StringTable): ...@@ -100,7 +101,7 @@ def parse_inv_opengear_serial_lines(string_table: StringTable):
return section return section
def inventory_bgp_peers(params, section) -> InventoryResult: def inventory_bgp_peers(section) -> InventoryResult:
path = ['hardware', 'serial_lines'] path = ['hardware', 'serial_lines']
for entry in section: for entry in section:
...@@ -146,7 +147,4 @@ register.snmp_section( ...@@ -146,7 +147,4 @@ register.snmp_section(
register.inventory_plugin( register.inventory_plugin(
name='inv_opengear_serial_lines', name='inv_opengear_serial_lines',
inventory_function=inventory_bgp_peers, inventory_function=inventory_bgp_peers,
inventory_default_parameters={
},
inventory_ruleset_name='inv_opengear_serial_lines',
) )
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
# File : view/inv_opengear_serial_lines # File : view/inv_opengear_serial_lines
# #
# 2023-02-20: moved from ~/local/share/check_mk/... to ~/local/lib/check_mk... # 2023-02-20: moved from ~/local/share/check_mk/... to ~/local/lib/check_mk...
# # 2023-06-14: removed declare_invtable_view from view definition on cmk 2.2 (see werk 15493)
# changed inventory_displayhints import (see werk 15493)
from cmk.gui.i18n import _ from cmk.gui.i18n import _
from cmk.gui.plugins.views.utils import ( from cmk.gui.views.inventory.registry import inventory_displayhints
inventory_displayhints,
)
from cmk.gui.plugins.views.inventory import declare_invtable_view
inventory_displayhints.update({ inventory_displayhints.update({
'.hardware.serial_lines:': { '.hardware.serial_lines:': {
...@@ -40,5 +39,3 @@ inventory_displayhints.update({ ...@@ -40,5 +39,3 @@ inventory_displayhints.update({
'.hardware.serial_lines:*.dtr': {'title': _('DTR'), }, '.hardware.serial_lines:*.dtr': {'title': _('DTR'), },
'.hardware.serial_lines:*.rts': {'title': _('RTS'), }, '.hardware.serial_lines:*.rts': {'title': _('RTS'), },
}) })
declare_invtable_view('invseriallines', '.hardware.serial_lines:', _('Serial lines'), _('Serial lines'))
No preview for this file type
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'gui': ['views/inv_opengear_serial_lines.py']}, 'gui': ['views/inv_opengear_serial_lines.py']},
'name': 'inv_opengear_serial_line', 'name': 'inv_opengear_serial_line',
'title': 'opengear serial line inventory', 'title': 'opengear serial line inventory',
'version': '0.0.2-20230614', 'version': '0.1.1-20230614',
'version.min_required': '2.1.0b1', 'version.min_required': '2.2.0b1',
'version.packaged': '2.2.0p2', 'version.packaged': '2.2.0p2',
'version.usable_until': '2.2.0b1'} 'version.usable_until': None}
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