diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000000000000000000000000000000000000..9868eef628b7d71fc40799643e58823843cd7434 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,55 @@ +EoX +2017-03-20: initial version EoX +2017-05-29: fixed empty pid handling + added serial number cleanup +2018-04-09: removed import +2018-09-04: changes for CMK 1.5.x (inv_tree --> inv_tree_list) +2018-09-05: changes for CMK 1.5.x (replaced global variable g_hostname with api call host_name()) +2018-08-13: changed variable host_name to _hostname for cmk 1.5 +2020-08-04: code cleanup (_create_eox_record function) + moved node tree from hardware.system.support to hardware.system +2021-07-23: rewrite for CMK 2.0 + + +Contract +2017-03-20: initial version EoX +2017-05-29: fixed empty pid handling + added serial number cleanup +2018-04-09: removed import +2018-09-04: changes for CMK 1.5.x (inv_tree --> inv_tree_list) +2018-09-05: changes for CMK 1.5.x (replaced global variable g_hostname with api call host_name()) +2019-08-13: chaged variable host_anme to _hostname for cmk1.5 +2020-08-04: moved node tree from hardware.system.support to hardware.system + cleanup create_sn2info_record + + +PSIRT +2017-07-05: initial release +2018-04-09: removed import +2018-09-04: changes for CMK 1.5.x (inv_tree --> inv_tree_list) +2018-09-05: changes for CMK 1.5.x (replaced global variable g_hostname with api call host_name()) +2018-01-06: minor changes, added status info for removed advisories (not updated, older than, ...) +2019-08-13: changed for cmk 1.5 + #node = inv_tree_list('software.support.cisco_psirt.') + node = inv_tree('software.support.cisco_psirt.') + changed variable host_name to _hostname for cmk 1.5 + + +Suggestion +2017-07-13: initial release +2018-04-09 : removed import +2018-09-04 : changes for CMK 1.5.x (inv_tree --> inv_tree_list) +2018-09-05 : changes for CMK 1.5.x (replaced global variable g_hostname with api call host_name()) +2019-08-13 : changes for cmk 1.5.x varianle host_name changed to _hotname + + +Bug +2018-12-26: initial release +2019-08-03: changes for cmk 1.5: inv_tree_list to inv_tree, comment out split for cmk 1.5 + #bug['known_fixed_releases'] = bug['known_fixed_releases'].split(' ') + #bug['known_affected_releases'] = bug['known_affected_releases'].split(' ') + + +All +2021-07-23: rewritten for CMK 2.0 +2021-07-25: removed sugestion and api_status plugins \ No newline at end of file diff --git a/agent_based/inv_cisco_bug.py b/agent_based/inv_cisco_bug.py index 7182d59ce61cfe706fc84e81ee421f3b217c55e8..111928277f8a754d98955722f3a7abe933b7e56e 100644 --- a/agent_based/inv_cisco_bug.py +++ b/agent_based/inv_cisco_bug.py @@ -221,8 +221,8 @@ def inventory_cisco_bug(params, section) -> InventoryResult: for bug in bugs: if bug.get('bug_id') not in bug_ids: bug_ids.append(bug.get('bug_id')) - #bug['known_fixed_releases'] = bug['known_fixed_releases'].split(' ') - #bug['known_affected_releases'] = bug['known_affected_releases'].split(' ') + bug['known_fixed_releases'] = ', '.join(bug['known_fixed_releases'].split(' ')) + bug['known_affected_releases'] = ', '.join(bug['known_affected_releases'].split(' ')) bug['status'] = get_bug_status(bug['status']) bug['behavior_changed'] = get_bug_behavior_changed(bug['behavior_changed']) logging.info('remove columns: %s' % optionalcolumns) diff --git a/agent_based/inv_cisco_psirt.py b/agent_based/inv_cisco_psirt.py index ea74331b1c01b3ae143295241305f18e2500c30f..f337914e8cd91fb58f95c91b286779143a88e57c 100644 --- a/agent_based/inv_cisco_psirt.py +++ b/agent_based/inv_cisco_psirt.py @@ -62,7 +62,7 @@ def parse_inv_cisco_psirt(string_table: List[StringTable]): def inventory_cisco_psirt(params, section) -> InventoryResult: - def create_psirt_record(filepath, filename, not_updated, dont_show_older_then): + def create_psirt_record(filepath, filename, not_updated, dont_show_older_then, optionalcolumns): psirtfile = filepath + filename advisories = {} if os.path.isfile(psirtfile): @@ -80,14 +80,21 @@ def inventory_cisco_psirt(params, section) -> InventoryResult: advisory.update({'installed_version': filename}) advisory.update({'lastUpdated': advisory.get('lastUpdated', 'T1980-01-01').split('T')[0]}) advisory.update({'firstPublished': advisory.get('firstPublished', 'T1980-01-01').split('T')[0]}) - advisory.update({'bugIDs': ' '.join(advisory.get('bugIDs', ''))}) + advisory.update({'bugIDs': ', '.join(advisory.get('bugIDs', ''))}) advisory.update({'firstFixed': ', '.join(advisory.get('firstFixed', ''))}) advisory.update({'cves': ', '.join(advisory.get('cves', ''))}) advisory.update({'cwe': ', '.join(advisory.get('cwe', ''))}) + + keys = advisory.keys() + for column in optionalcolumns: + if column in keys: + advisory.pop(column) else: # add old advisories to remove list remove_advisories.insert(0, advisories.index(advisory)) + + # remove advisories older then not_updated # if len(remove_advisories) > 0: # node['removed_advisories'] = len(remove_advisories) @@ -253,9 +260,9 @@ def inventory_cisco_psirt(params, section) -> InventoryResult: # create psirt advisory list if product_family in ['IOS', 'IOS-XE']: # do not remove entrys from IOS(XE) - advisories = create_psirt_record(path_found, psirt, 10000000, '2000-01-01') + advisories = create_psirt_record(path_found, psirt, 10000000, '2000-01-01', optionalcolumns) else: - advisories = create_psirt_record(path_found, psirt, not_updated, dont_show_older_then) + advisories = create_psirt_record(path_found, psirt, not_updated, dont_show_older_then, optionalcolumns) if dont_show_older_then != '0000-00-00': yield Attributes( path=path, diff --git a/agent_based/utils/ciscoapi.py b/agent_based/utils/ciscoapi.py index 86f322c5376d141b948e68c2652fa091ae0b4ea5..4ae674c10c2445bd11fbfa8f060fa10a1a829bea 100644 --- a/agent_based/utils/ciscoapi.py +++ b/agent_based/utils/ciscoapi.py @@ -24,7 +24,7 @@ from typing import List # list of PIDs to drop g_PID_black_list = ['BUILT-IN', 'MICRON', 'C400-MTFDD'] # list of PIDs to try by serial number -g_PID_bad_list = ['UNSPECIFIED', 'FABRIC', 'ASA', 'C2611XM-2FE', 'FTLX8570D3BCL', 'FTLF8519P2BCL', 'FTLX8571D3BCL', 'FTRJ-8519-7D', 'PLRXPL-SC-S43'] +g_PID_bad_list = ['UNSPECIFIED', 'FABRIC', 'ASA', 'C2611XM-2FE', 'FTLX8570D3BCL', 'FTLF8519P2BCL', 'FTLX8571D3BCL', 'FTRJ-8519-7D', 'PLRXPL-SC-S43'] # # list of S/Ns to drop g_SN_black_list = [] diff --git a/inv_cisco_support.mkp b/inv_cisco_support.mkp index a35d91cf9c8c5856fa3fb242f70e1ef3309153fa..98beed0b82237bae5dcfe94088455d38b073dd97 100644 Binary files a/inv_cisco_support.mkp and b/inv_cisco_support.mkp differ diff --git a/packages/inv_cisco_support b/packages/inv_cisco_support index 5721f1fec46dfe11711bd25bf0a83d10a1ad1d84..d374c2a88adf86de36249eab93235f80db59174e 100644 --- a/packages/inv_cisco_support +++ b/packages/inv_cisco_support @@ -12,7 +12,8 @@ 'detection in PSIRT (WLC, Nexus, APIC, ASA, ...)\n' 'v.0.0.11: fixes for CMK 1.5.x\n' '\n' - 'v0.1: rewrite for CMK 2.0\n', + 'v0.1: rewrite for CMK 2.0\n' + ' - suggestion and api_status removed\n', 'download_url': 'https://thl-cmk.hopto.org', 'files': {'agent_based': ['inv_cisco_eox.py', 'inv_cisco_contract.py', @@ -29,12 +30,13 @@ 'plugins/wato/inv_cisco_bug.py', 'plugins/wato/inv_cisco_eox.py', 'plugins/wato/inv_cisco_contract.py', - 'plugins/wato/inv_cisco_psirt.py']}, + 'plugins/wato/inv_cisco_psirt.py', + 'htdocs/css/inv_cisco_support.css']}, 'name': 'inv_cisco_support', - 'num_files': 16, + 'num_files': 17, 'title': 'Inventory for Cisco Bug, EoX, contract status, PSIRT advisories and ' 'suggested software', - 'version': '2021-07-23.v0.1', + 'version': '2021-07-25.v0.1a', 'version.min_required': '2.0.0', 'version.packaged': '2021.07.14', 'version.usable_until': None} \ No newline at end of file diff --git a/web/htdocs/css/inv_cisco_support.css b/web/htdocs/css/inv_cisco_support.css new file mode 100644 index 0000000000000000000000000000000000000000..5d463b04ef7da0942ffd42027945e4d1294158e0 --- /dev/null +++ b/web/htdocs/css/inv_cisco_support.css @@ -0,0 +1,25 @@ +/* for cisco_support */ +td.date_default { + background-color: #00c020 !important; /* green */ + box-shadow: 0px 0px 3px #ccffcc inset; + color: #000000 !important; +} + +td.date_warn { + background-color: #ffff00 !important; /* yellow */ + box-shadow: 0px 0px 2px #000 inset; + color: #000000 !important; +} + +td.date_crit { + background-color: #ff0000 !important; /* red */ + box-shadow: 0px 0px 2px #000 inset; + +} + + +a.href_blue { + color: limegreen !important; + text-decoration: underline !important; +} + diff --git a/web/plugins/views/inv_cisco_support.py b/web/plugins/views/inv_cisco_support.py index 7f3b8895f4e763e559028768b9bdc8f23ab825bc..01cfe890c8e466f298f2535ee0b558f4c27e7027 100644 --- a/web/plugins/views/inv_cisco_support.py +++ b/web/plugins/views/inv_cisco_support.py @@ -12,441 +12,168 @@ # 2021-07-23: rewrite for CMK 2.0 # suggestion removed --> table to complicated :-( # -# -# ToDo: add render_inv_bugids, needed to add html link to bug IDs, paint does not work (like suggestion) -# (https://bst.cloudapps.cisco.com/bugsearch/bug/CSCuh91645) -# +# 2021-07-25: removed inv_cisco_suggestion +# rework painter section -# import random # needed for quickinfo tables import time from cmk.gui.plugins.views.inventory import ( declare_invtable_view, decorate_inv_paint, ) -from cmk.gui.plugins.visuals.inventory import ( - FilterInvtableText, -) + from cmk.gui.i18n import _ from cmk.gui.plugins.views import ( inventory_displayhints, ) - - - +from cmk.gui.htmllib import HTML # # ToDo: move painters to local tree # painters are at the moment hard coded in lib/python/cmk/gui/plugins/views/inventory.py # - -# from cmk.gui.plugins.views.inventory import ( -# declare_invtable_view, -# decorate_inv_paint, -# ) -# -# import time -# -# from cmk.utils.regex import regex -# import cmk.utils.defines as defines -# import cmk.utils.render -# -# import cmk.gui.pages -# import cmk.gui.config as config -# import cmk.gui.sites as sites -# import cmk.gui.inventory as inventory -# from cmk.gui.i18n import _ -# from cmk.gui.globals import html, current_app -# from cmk.gui.htmllib import HTML -# from cmk.gui.valuespec import Dictionary, Checkbox, Hostname -# from cmk.gui.exceptions import MKUserError -# -# from cmk.gui.plugins.visuals import ( -# filter_registry, -# VisualInfo, -# visual_info_registry, -# ) -# from cmk.gui.plugins.visuals.inventory import ( -# FilterInvText, -# FilterInvBool, -# FilterInvFloat, -# FilterInvtableText, -# FilterInvtableIDRange, -# ) -# -# from cmk.gui.plugins.views import ( -# data_source_registry, -# DataSource, -# RowTable, -# painter_registry, -# Painter, -# register_painter, -# register_sorter, -# display_options, -# painter_option_registry, -# PainterOption, -# PainterOptions, -# inventory_displayhints, -# multisite_builtin_views, -# view_is_enabled, -# paint_age, -# declare_1to1_sorter, -# cmp_simple_number, -# render_labels, -# ) - -# @decorate_inv_paint -# def inv_paint_date_status(date_string): -# -# warn_days = -90 -# crit_days = -30 -# -# # check if date_sting not None, if so return no CSS Class and None -# if date_string is None: -# return '', '' -# -# try: -# days = int((time.time() - time.mktime(time.strptime(date_string, '%Y-%m-%d'))) / 86400) -# except ValueError: -# return '', date_string -# -# if days > crit_days: -# css_class = 'date_crit' -# elif days > warn_days: -# css_class = 'date_warn' -# else: -# css_class = 'date_default' -# -# return css_class, '%s' % date_string - - -# @decorate_inv_paint -# def inv_paint_last_checked_status(date_string): -# warn_days = 32 -# crit_days = 40 -# if date_string is None: -# return '', '' -# try: -# days = int((time.time() - time.mktime(time.strptime(date_string, '%Y-%m-%d'))) / 86400) -# except ValueError: -# return '', date_string -# if days <= warn_days: -# css_class = '' -# elif days >= crit_days: -# css_class = 'date_crit' -# else: -# css_class = 'date_warn' -# return css_class, ' %s' % date_string - - -# @decorate_inv_paint -# def inv_paint_psirt_advisoryId(advisoryId): -# psirt_url = '<a class="href_blue" target="_blank" href="https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/%s">%s</a>' % (advisoryId, advisoryId) -# return '', psirt_url - - -# @decorate_inv_paint -# def inv_paint_eox_eolid(eolid): -# if eolid is not None: -# search_eolid_url = '<a class="href_blue" target="_blank" href="https://search.cisco.com/search?query=%s">%s</a>' % (eolid, eolid) -# else: -# search_eolid_url = '' -# return '', search_eolid_url - - -# @decorate_inv_paint -# def inv_paint_bug_bugid(bugid): -# if bugid is not None: -# search_bugid_url = '<a class="href_blue" target="_blank" href="https://bst.cloudapps.cisco.com/bugsearch/bug/%s">%s</a>' % (bugid, bugid) -# else: -# search_bugid_url = '' -# return '', search_bugid_url - - -# def render_inv_dicttable_suggestion_noqf(hostname, tree_id, invpath, node): -# # In delta mode node is a pair of (old_items, new_items) -# if type(node) == tuple: -# html.write(_("Removed entries") + ":") -# html.write("<span class=invold>") -# render_inv_dicttable_suggestion_noqf(hostname, tree_id, invpath, node[0]) -# html.write("</span>") -# -# html.write(_("New entries") + ":") -# html.write("<span class=invnew>") -# render_inv_dicttable_suggestion_noqf(hostname, tree_id, invpath, node[1]) -# html.write("</span>") -# return -# -# hint = inv_display_hint(invpath) -# keyorder = hint.get("keyorder", []) # well known keys -# -# # Add titles for those keys -# titles = [] -# for key in keyorder: -# invpath_sub = invpath + "0." + key -# icon, title = inv_titleinfo(invpath_sub, None) -# sub_hint = inv_display_hint(invpath_sub) -# short_title = sub_hint.get("short", title) -# titles.append((short_title, key)) -# -# # Determine *all* keys, in order to find unknown ones -# keys = set([]) -# for entry in node: -# keys.update(entry.keys()) -# -# # Order not well-known keys alphabetically -# extratitles = [] -# for key in keys: -# if key not in keyorder: -# icon, title = inv_titleinfo(invpath + "0." + key, None) -# extratitles.append((title, key)) -# extratitles.sort() -# titles += extratitles -# -# # Link to Multisite view with exactly this table -# if "view" in hint: -# url = html.makeuri_contextless([ -# ("view_name", hint["view"] ), -# ("host", hostname)], -# filename="view.py") -# html.write('<div class=invtablelink><a href="%s">%s</a></div>' % -# (url, _("Open this table for filtering / sorting"))) -# -# # We cannot use table here, since html.plug() does not work recursively -# html.write('<table class=data>') -# html.write('<tr>') -# for title, key in titles: -# html.write('<th>%s</th>' % title) -# html.write('</tr>') -# -# for nr, entry in enumerate(node): -# html.write('<tr class=even0>') -# for title, key in titles: -# value = entry.get(key) -# invpath_sub = invpath + "%d.%s" % (nr, key) -# if type(value) == dict: -# invpath_sub += "." -# elif type(value) == list or (type(value) == tuple and type(value[0]) == list): -# invpath_sub += ":" -# -# hint = inv_display_hint(invpath_sub) -# if "paint_function" in hint: -# td_class, text = hint["paint_function"](value) -# classtext = ' class="%s"' % td_class -# else: -# classtext = "" -# -# html.write('<td%s>' % classtext) -# # render_inv_subtree(hostname, tree_id, invpath_sub, value) -# # render suggestions as not foldable -# if key == 'suggestion' and type(value) == list: -# render_inv_subtree_container(hostname, tree_id, invpath_sub, value) -# else: -# render_inv_subtree(hostname, tree_id, invpath_sub, value) -# html.write('</td>') -# html.write('</tr>') -# html.write('</table>') -# -# -# def render_inv_dicttable_suggestion(hostname, tree_id, invpath, node): -# # In delta mode node is a pair of (old_items, new_items) -# if type(node) == tuple: -# html.write(_("Removed entries") + ":") -# html.write("<span class=invold>") -# render_inv_dicttable_suggestion(hostname, tree_id, invpath, node[0]) -# html.write("</span>") -# -# html.write(_("New entries") + ":") -# html.write("<span class=invnew>") -# render_inv_dicttable_suggestion(hostname, tree_id, invpath, node[1]) -# html.write("</span>") -# return -# -# hint = inv_display_hint(invpath) -# keyorder = hint.get("keyorder", []) # well known keys -# -# # Add titles for those keys -# titles = [] -# for key in keyorder: -# invpath_sub = invpath + "0." + key -# icon, title = inv_titleinfo(invpath_sub, None) -# sub_hint = inv_display_hint(invpath_sub) -# short_title = sub_hint.get("short", title) -# titles.append((short_title, key)) -# -# # Determine *all* keys, in order to find unknown ones -# keys = set([]) -# for entry in node: -# keys.update(entry.keys()) -# -# # Order not well-known keys alphabetically -# extratitles = [] -# for key in keys: -# if key not in keyorder: -# icon, title = inv_titleinfo(invpath + "0." + key, None) -# extratitles.append((title, key)) -# extratitles.sort() -# titles += extratitles +# to enable painters you must add the painter functions to ~/lib/python/cmk/gui/plugins/views/inventory.py +# and set ENABLE_PAINTERS to True # -# # Link to Multisite view with exactly this table -# if "view" in hint: -# url = html.makeuri_contextless([ -# ("view_name", hint["view"] ), -# ("host", hostname)], -# filename="view.py") -# html.write('<div class=invtablelink><a href="%s">%s</a></div>' % -# (url, _("Open this table for filtering / sorting"))) -# -# # -# # Th.L.: insert jscript for quickfilter -# # -# qfurl = html.makeuri([],filename="TableFilter/tablefilter.js", delvars=["host","selection","site","view_name"]) -# html.write('<script language="javascript" type="text/javascript" src="%s"></script>' % qfurl) -# -# # Th.L.: create random table id -# qf_table_id = "qf_id_" + "".join(random.SystemRandom().choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for _ in range(10)) -# -# # We cannot use table here, since html.plug() does not work recursively -# # html.write('<table class=data>') -# html.write('<table id=%s class=data>' % qf_table_id) -# # html.write('<tr>') -# html.write('<thead><tr>') # Th.L.: added thead for quickfilter (sort) -# for title, key in titles: -# html.write('<th>%s</th>' % title) -# #html.write('</tr>') -# html.write('</tr></thead><tbody>') # Th.L.: added thead and tbody for quickfilter (sort) -# -# for nr, entry in enumerate(node): -# html.write('<tr class=even0>') -# for title, key in titles: -# value = entry.get(key) -# invpath_sub = invpath + "%d.%s" % (nr, key) -# if type(value) == dict: -# invpath_sub += "." -# elif type(value) == list or (type(value) == tuple and type(value[0]) == list): -# invpath_sub += ":" -# -# hint = inv_display_hint(invpath_sub) -# if "paint_function" in hint: -# td_class, text = hint["paint_function"](value) -# classtext = ' class="%s"' % td_class -# else: -# classtext = "" + +ENABLE_PAINTERS = False + +# ################################################################################# # -# html.write('<td%s>' % classtext) -# # render_inv_subtree(hostname, tree_id, invpath_sub, value) -# # render suggestions as not foldable -# if key == 'suggestion' and type(value) == list: -# render_inv_subtree_container(hostname, tree_id, invpath_sub, value) -# else: -# render_inv_subtree(hostname, tree_id, invpath_sub, value) -# html.write('</td>') -# html.write('</tr>') -# #html.write('</table>') -# html.write('</tbody></table>') # Th.L.: added tbody for quickfilter (sort) +# Painter functions START # -# # -# # Th.L.: add jscript for quickfilter -# # -# html.write('<script data-config>\n') -# html.write(' var filtersConfig = {\n') -# html.write(' base_path: "TableFilter/",\n') -# html.write(' alternate_rows: true,\n') -# html.write(' rows_counter: true,\n') -# html.write(' btn_reset: true,\n') -# html.write(' bnt_reset_text: "Clear all",\n') -# html.write(' loader: true,\n') -# html.write(' status_bar: true,\n') -# html.write(' status_bar_text : "status:",\n') -# html.write(' loader : true,\n') -# html.write(' mark_active_columns: true,\n') -# html.write(' highlight_keywords: true,\n') -# html.write(' auto_filter: true,\n') -# html.write(' auto_filter_delay: 100,\n') -# html.write(' paging: true,\n') -# html.write(' mark_active_columns: true,\n') -# html.write(' results_per_page: [" Results per page",[10,25,50,100,250,500,1000]],\n') -# html.write(' no_results_message: true,\n') -# html.write(' extensions:[{ name: "sort"},\n') -# html.write(' { name: "colsVisibility",\n') -# html.write(' tick_to_hide: false,\n') -# html.write(' at_start: [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65],\n') -# html.write(' text: "Displayed columns: ",\n') -# html.write(' enable_tick_all: true,\n') -# html.write(' btn_html: "<button>Columns manager ▼</button>",\n') -# html.write(' btn_close_html: "<button>Close</button>",\n') -# html.write(' enable_hover: false,\n') -# html.write(' },\n') -# # html.write(' {name: "filtersVisibility"} -# html.write(' ]\n') -# html.write(' };\n') -# html.write('\n') -# html.write(' var tf = new TableFilter("%s", filtersConfig);\n' % qf_table_id) -# html.write(' tf.init();\n') -# html.write('\n') -# html.write('</script>\n') - - -# def inv_paint_bug_status(bug_status): -# _bug_status = { -# 'F': 'Fixed', -# 'O': 'Open', -# 'T': 'Terminated' -# } -# return '', _bug_status.get(bug_status, bug_status) + + +@decorate_inv_paint() +def inv_paint_date_status(date_string): + + warn_days = -90 + crit_days = -30 + + # check if date_sting not None, if so return no CSS Class and None + if date_string is None: + return '', '' + + try: + days = int((time.time() - time.mktime(time.strptime(date_string, '%Y-%m-%d'))) / 86400) + except ValueError: + return '', date_string + + if days > crit_days: + css_class = 'date_crit' + elif days > warn_days: + css_class = 'date_warn' + else: + css_class = 'date_default' + + return css_class, '%s' % date_string + + +@decorate_inv_paint() +def inv_paint_last_checked_status(date_string): + warn_days = 32 + crit_days = 40 + if date_string is None: + return '', '' + try: + days = int((time.time() - time.mktime(time.strptime(date_string, '%Y-%m-%d'))) / 86400) + except ValueError: + return '', date_string + if days <= warn_days: + css_class = '' + elif days >= crit_days: + css_class = 'date_crit' + else: + css_class = 'date_warn' + return css_class, ' %s' % date_string + + +@decorate_inv_paint() +def inv_paint_psirt_advisoryid(advisoryId): + psirt_url = HTML( + f'<a class="href_blue" target="_blank" ' + f'href="https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/{advisoryId}">{advisoryId}</a>') + return '', psirt_url + + +@decorate_inv_paint() +def inv_paint_eox_eolid(eolid): + if eolid is not None: + search_eolid_url = HTML( + f'<a class="href_blue" target="_blank" ' + f'href="https://search.cisco.com/search?query={eolid}%s">{eolid}</a>') + else: + search_eolid_url = '' + return '', search_eolid_url + + +@decorate_inv_paint() +def inv_paint_bug_bugid(bugid): + if bugid is not None: + search_bugid_url = HTML( + f'<a class="href_blue" target="_blank" ' + f'href="https://bst.cloudapps.cisco.com/bugsearch/bug/{bugid}">{bugid}</a>') + else: + search_bugid_url = '' + return '', search_bugid_url + + +@decorate_inv_paint() +def inv_paint_psirt_bugid(bugids): + search_bugid_url = '' + bugids = bugids.split(',') + if bugids: + search_bugid_url = [] + for bugid in bugids: + bugid = bugid.strip(' ') + search_bugid_url.append(f'<a class="href_blue" target="_blank" href="https://bst.cloudapps.cisco.com/bugsearch/bug/{bugid}">{bugid}</a>') + search_bugid_url = HTML(', '.join(search_bugid_url)) + return '', search_bugid_url + # +# Painter functions END # -# def inv_paint_bug_behavior_changed(behavior_changed): -# _behavior_changed = { -# 'Y': 'yes', -# 'N': 'no', -# } -# return '', _behavior_changed.get(behavior_changed, behavior_changed) +# ################################################################################# + # EoX display hints inventory_displayhints.update({ - '.hardware.support.cisco_eox:': {'title': _('Cisco EoX'), - 'keyorder': ['pid', 'serial_number', 'ProductIDDescription', 'Last_checked', - 'EOXExternalAnnouncementDate', 'EndOfSaleDate', - 'LastDateOfSupport', 'EndOfSvcAttachDate', 'UpdatedTimeStamp', - 'ProductBulletinNumber', - ], - 'view': 'invciscoeox_of_host', - }, + '.hardware.support.cisco_eox:': { + 'title': _('Cisco EoX'), + 'keyorder': + [ + 'pid', 'serial_number', 'ProductIDDescription', 'Last_checked', 'ProductBulletinNumber', + 'EOXExternalAnnouncementDate', 'EndOfSaleDate', 'LastDateOfSupport', 'EndOfSvcAttachDate', + 'UpdatedTimeStamp', + ], + 'view': 'invciscoeox_of_host', + }, '.hardware.support.cisco_eox:*.pid': {'title': _('PID (EoX)'), }, '.hardware.support.cisco_eox:*.serial_number': {'title': _('Serial number'), }, '.hardware.support.cisco_eox:*.ProductIDDescription': {'title': _('Description'), }, - '.hardware.support.cisco_eox:*.EOXExternalAnnouncementDate': {'title': _('EOL Announcement'), 'filter': FilterInvtableText,}, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.EndOfSaleDate': {'title': _('End of sale'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.EndOfSvcAttachDate': {'title': _('End of service attachment'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.LastDateOfSupport': {'title': _('End of support'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.ProductBulletinNumber': {'title': _('EOL bulletin ID'), }, # 'filter': FilterInvtableText, 'paint': 'eox_eolid', '.hardware.support.cisco_eox:*.LinkToProductBulletinURL': {'title': _('EOL bulletin URL'), }, '.hardware.support.cisco_eox:*.UpdatedTimeStamp': {'title': _('EOL bulletin last update'), }, - '.hardware.support.cisco_eox:*.EndOfSecurityVulSupportDate': {'title': _('End of service vulnerability support'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.EndOfSWMaintenanceReleases': {'title': _('End of software maintenace releases'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', - '.hardware.support.cisco_eox:*.EndOfRoutineFailureAnalysisDate': {'title': _('End of routine failure analysis'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', '.hardware.support.cisco_eox:*.MigrationProductId': {'title': _('Migration PID'), }, '.hardware.support.cisco_eox:*.MigrationInformation': {'title': _('Migration information'), }, '.hardware.support.cisco_eox:*.MigrationProductInfoURL': {'title': _('Migration PID URL'), }, '.hardware.support.cisco_eox:*.MigrationProductName': {'title': _('Migration product name'), }, - '.hardware.support.cisco_eox:*.Last_checked': {'title': _('Last checked'), }, # 'filter': FilterInvtableText, 'paint': 'last_checked_status', + '.hardware.support.cisco_eox:*.Last_checked': {'title': _('Last checked'), 'paint': 'last_checked_status'}, # }) # SN2Info (contract) display hints inventory_displayhints.update({ - '.hardware.support.cisco_contract:': {'title': _('Cisco contract status'), - 'keyorder': ['pid', 'serial_number', 'ProductIDDescription', - 'Last_checked', 'is_covered', 'service_contract_number', - 'covered_product_line_end_date', - ], - 'view': 'invciscocontract_of_host', - }, + '.hardware.support.cisco_contract:': { + 'title': _('Cisco contract status'), + 'keyorder': [ + 'pid', 'serial_number', 'ProductIDDescription', 'Last_checked', 'is_covered', 'service_contract_number', + 'covered_product_line_end_date', + ], + 'view': 'invciscocontract_of_host', + }, '.hardware.support.cisco_contract:*.pid': {'title': _('PID (contract)'), }, '.hardware.support.cisco_contract:*.serial_number': {'title': _('Serial number'), }, '.hardware.support.cisco_contract:*.ProductIDDescription': {'title': _('Description'), }, - '.hardware.support.cisco_contract:*.Last_checked': {'title': _('Last checked'), }, # 'filter': FilterInvtableText,'paint': 'last_checked_status', '.hardware.support.cisco_contract:*.is_covered': {'title': _('is covered'), }, '.hardware.support.cisco_contract:*.contract_site_customer_name': {'title': _('Customer name'), }, '.hardware.support.cisco_contract:*.contract_site_address1': {'title': _('Address'), }, @@ -455,7 +182,6 @@ inventory_displayhints.update({ '.hardware.support.cisco_contract:*.contract_site_country': {'title': _('Country'), }, '.hardware.support.cisco_contract:*.service_line_descr': {'title': _('Service description'), }, '.hardware.support.cisco_contract:*.service_contract_number': {'title': _('Contract number'), }, - '.hardware.support.cisco_contract:*.covered_product_line_end_date': {'title': _('Contract end date'), }, # 'filter': FilterInvtableText, 'paint': 'date_status', '.hardware.support.cisco_contract:*.parent_sr_no': {'title': _('Parent S/N'), }, '.hardware.support.cisco_contract:*.warranty_type': {'title': _('Warranty type'), }, '.hardware.support.cisco_contract:*.warranty_type_description': {'title': _('Warranty Description'), }, @@ -469,20 +195,22 @@ inventory_displayhints.update({ '.software.support.cisco_bug.missing_records': {'title': _('Records missing'), }, '.software.support.cisco_bug.PID': {'title': _('PID'), }, '.software.support.cisco_bug.os_version': {'title': _('OS version'), }, - '.software.support.cisco_bug.bugs:': {'title': _('Cisco BUG IDs'), - 'keyorder': ['bug_id', 'last_modified_date', 'headline', 'severity', 'status', 'support_case_count', 'behavior_changed', ], - 'view': 'invciscobugs_of_host', - }, - '.software.support.cisco_bug.bugs:*.status': {'title': _('Status'), }, # 'filter': FilterInvtableText, + '.software.support.cisco_bug.bugs:': { + 'title': _('Cisco BUG IDs'), + 'keyorder': [ + 'bug_id', 'severity', 'status', 'last_modified_date', 'headline', 'support_case_count', 'behavior_changed', + ], + 'view': 'invciscobugs_of_host', + }, + '.software.support.cisco_bug.bugs:*.status': {'title': _('Status'), }, '.software.support.cisco_bug.bugs:*.product': {'title': _('Product'), }, '.software.support.cisco_bug.bugs:*.description': {'title': _('Description'), }, '.software.support.cisco_bug.bugs:*.headline': {'title': _('Headline'), }, '.software.support.cisco_bug.bugs:*.support_case_count': {'title': _('Support case count'), }, '.software.support.cisco_bug.bugs:*.last_modified_date': {'title': _('Last modified date'), }, - '.software.support.cisco_bug.bugs:*.behavior_changed': {'title': _('Behavior changed'), }, # 'filter': FilterInvtableText, - '.software.support.cisco_bug.bugs:*.bug_id': {'title': _('Bug ID'), }, # 'paint': 'bug_bugid', + '.software.support.cisco_bug.bugs:*.behavior_changed': {'title': _('Behavior changed'), }, '.software.support.cisco_bug.bugs:*.base_pid': {'title': _('Base PID'), }, - '.software.support.cisco_bug.bugs:*.known_fixed_releases': {'title': _('Known fixed releases'), }, # 'filter': FilterInvtableText, + '.software.support.cisco_bug.bugs:*.known_fixed_releases': {'title': _('Known fixed releases'), }, '.software.support.cisco_bug.bugs:*.id': {'title': _('ID'), }, '.software.support.cisco_bug.bugs:*.known_affected_releases': {'title': _('known affected releases'), }, '.software.support.cisco_bug.bugs:*.severity': {'title': _('Severity'), }, @@ -491,16 +219,17 @@ inventory_displayhints.update({ # PSIRT display hints inventory_displayhints.update({ '.software.support.cisco_psirt.dont_show_older_than': {'title': _('Don\'t show advisories not updated since'), }, - '.software.support.cisco_psirt.dont_show_not_updated_since': {'title': _('Don\'t show advisories not updated for X days'), }, + '.software.support.cisco_psirt.dont_show_not_updated_since': { + 'title': _('Don\'t show advisories not updated for X days'), }, '.software.support.cisco_psirt.removed_advisories': {'title': _('Advisories removed'), }, - '.software.support.cisco_psirt.advisories:': {'title': _('Cisco PSIRT advisories'), - 'keyorder': ['advisoryId', 'sir', 'cvssBaseScore', 'advisoryTitle', - ], - 'view': 'invciscopsirt_of_host', - }, - '.software.support.cisco_psirt.advisories:*.advisoryId': {'title': _('Advisory ID'), }, # 'filter': FilterInvtableText, , 'paint': 'psirt_advisoryId', + '.software.support.cisco_psirt.advisories:': { + 'title': _('Cisco PSIRT advisories'), + 'keyorder': [ + 'advisoryId', 'sir', 'cvssBaseScore', 'advisoryTitle', + ], + 'view': 'invciscopsirt_of_host', + }, '.software.support.cisco_psirt.advisories:*.advisoryTitle': {'title': _('Advisory Title'), }, - '.software.support.cisco_psirt.advisories:*.bugIDs': {'title': _('Bug IDs'), }, # 'filter': FilterInvtableText, , 'paint': 'psirt_bugid', '.software.support.cisco_psirt.advisories:*.cvssBaseScore': {'title': _('CVSS base Score'), }, '.software.support.cisco_psirt.advisories:*.firstFixed': {'title': _('First fixed in'), }, '.software.support.cisco_psirt.advisories:*.firstPublished': {'title': _('First Published'), }, @@ -510,51 +239,68 @@ inventory_displayhints.update({ '.software.support.cisco_psirt.advisories:*.sir': {'title': _('Severity'), }, '.software.support.cisco_psirt.advisories:*.summary': {'title': _('Summary'), }, '.software.support.cisco_psirt.advisories:*.cwe': {'title': _('CWE'), }, - '.software.support.cisco_psirt.advisories:*.cves': {'title': _('CVEs'),}, + '.software.support.cisco_psirt.advisories:*.cves': {'title': _('CVEs'), }, '.software.support.cisco_psirt.advisories:*.productNames': {'title': _('Product names'), }, - '.software.support.cisco_psirt.advisories:*.ipsSignatures': {'title': _('IPS signatures'), }, - '.software.support.cisco_psirt.advisories:*.cvrfUrl': {'title': _('CVRF URL'), }, - '.software.support.cisco_psirt.advisories:*.ovalUrl': {'title': _('OVAL URL'), }, - '.software.support.cisco_psirt.os_version': {'title': _('OS version'), }, - '.software.support.cisco_psirt.Last_checked': {'title': _('Last checked'), }, # 'filter': FilterInvtableText,, 'paint': 'last_checked_status', - '.software.support.cisco_psirt.not_updated_for_x_days': {'title': _('don\'t show advisories not updated for X days'), }, - '.software.support.cisco_psirt.dont_show_older_then': {'title': _('don\'t show advisories not updated after'), }, + '.software.support.cisco_psirt.advisories:*.ipsSignatures': {'title': _('IPS signatures')}, + '.software.support.cisco_psirt.advisories:*.cvrfUrl': {'title': _('CVRF URL')}, + '.software.support.cisco_psirt.advisories:*.ovalUrl': {'title': _('OVAL URL')}, + '.software.support.cisco_psirt.os_version': {'title': _('OS version')}, + '.software.support.cisco_psirt.not_updated_for_x_days': {'title': _('don\'t show advisories not updated for X days')}, + '.software.support.cisco_psirt.dont_show_older_then': {'title': _('don\'t show advisories not updated after')}, }) -# SUGGESTION display hints -# inventory_displayhints.update({ -# '.software.support.cisco_suggestion:': {'title': _('Cisco suggested software'), -# # 'render': render_inv_dicttable_suggestion, -# 'keyorder': ['pid', 'ProductIDDescription', 'Last_checked', -# ], -# 'view' : 'invciscosuggestion_of_host', -# }, -# '.software.support.cisco_suggestion:*.pid': {'title': _('PID (suggestion)'), }, -# '.software.support.cisco_suggestion:*.ProductIDDescription': {'title': _('Description'), }, -# '.software.support.cisco_suggestion:*.Last_checked': {'title': _('Last checked'), 'filter': FilterInvtableText, 'paint': 'last_checked_status',}, # -# '.software.support.cisco_suggestion:*.suggestion': {'title': _('Suggestion(s)'), }, -# # '.software.support.cisco_suggestion:*.suggestion:': {'render': render_inv_dicttable_suggestion_noqf, 'keyorder': ['productName', 'softwareType']}, -# '.software.support.cisco_suggestion:*.suggestion:': {'keyorder': ['productName', 'softwareType']}, -# '.software.support.cisco_suggestion:*.suggestion:*.productName': {'title': _('Product name'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.softwareType': {'title': _('Software type'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion': {'title': _('Suggestion(s)'), }, -# # '.software.support.cisco_suggestion:*.suggestion:*.suggestion:': {'render': render_inv_dicttable_suggestion_noqf, 'keyorder': ['id', 'releaseFormat2', 'releaseDate']}, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:': {'keyorder': ['id', 'releaseFormat2', 'releaseDate']}, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.id': {'title': _('ID'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.releaseDate': {'title': _('Release date'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.releaseFormat2': {'title': _('Version'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.releaseLifeCycle': {'title': _('Life cycle'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.isSuggested': {'title': _('is suggested'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.majorRelease': {'title': _('major release'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.relDispName': {'title': _('release display name'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.releaseFormat1': {'title': _('release format1'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.releaseTrain': {'title': _('release train'), }, -# '.software.support.cisco_suggestion:*.suggestion:*.suggestion:*.trainDispName': {'title': _('train display name'), } -# }) + +if ENABLE_PAINTERS: + inventory_displayhints.update({ + # EoX + '.hardware.support.cisco_eox:*.EOXExternalAnnouncementDate': {'title': _('EOL Announcement'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.EndOfSvcAttachDate': {'title': _('End of service attachment'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.EndOfSecurityVulSupportDate': {'title': _('End of service vulnerability support'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.EndOfSWMaintenanceReleases': {'title': _('End of software maintenace releases'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.EndOfRoutineFailureAnalysisDate': {'title': _('End of routine failure analysis'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.EndOfSaleDate': {'title': _('End of sale'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.LastDateOfSupport': {'title': _('End of support'), 'paint': 'date_status'}, + '.hardware.support.cisco_eox:*.ProductBulletinNumber': {'title': _('EOL bulletin ID'), 'paint': 'eox_eolid'}, + + # SN2Info + '.hardware.support.cisco_contract:*.Last_checked': {'title': _('Last checked'), 'paint': 'last_checked_status'}, + '.hardware.support.cisco_contract:*.covered_product_line_end_date': {'title': _('Contract end date'), 'paint': 'date_status'}, + + # Bug + '.software.support.cisco_bug.bugs:*.bug_id': {'title': _('Bug ID'), 'paint': 'bug_bugid'}, + + # Psirt + '.software.support.cisco_psirt.advisories:*.advisoryId': {'title': _('Advisory ID'), 'paint': 'psirt_advisoryid'}, + '.software.support.cisco_psirt.advisories:*.bugIDs': {'title': _('Bug IDs'), 'paint': 'psirt_bugid'}, + '.software.support.cisco_psirt.Last_checked': {'title': _('Last checked'), 'paint': 'last_checked_status'}, + }) +else: + inventory_displayhints.update(({ + # EoX + '.hardware.support.cisco_eox:*.EOXExternalAnnouncementDate': {'title': _('EOL Announcement')}, + '.hardware.support.cisco_eox:*.EndOfSvcAttachDate': {'title': _('End of service attachment')}, + '.hardware.support.cisco_eox:*.EndOfSecurityVulSupportDate': {'title': _('End of service vulnerability support')}, + '.hardware.support.cisco_eox:*.EndOfSWMaintenanceReleases': {'title': _('End of software maintenace releases')}, + '.hardware.support.cisco_eox:*.EndOfRoutineFailureAnalysisDate': {'title': _('End of routine failure analysis')}, + '.hardware.support.cisco_eox:*.EndOfSaleDate': {'title': _('End of sale')}, + '.hardware.support.cisco_eox:*.LastDateOfSupport': {'title': _('End of support')}, + '.hardware.support.cisco_eox:*.ProductBulletinNumber': {'title': _('EOL bulletin ID')}, + + # SN2Info + '.hardware.support.cisco_contract:*.Last_checked': {'title': _('Last checked')}, + '.hardware.support.cisco_contract:*.covered_product_line_end_date': {'title': _('Contract end date')}, + + # Bug + '.software.support.cisco_bug.bugs:*.bug_id': {'title': _('Bug ID')}, + + # Psirt + '.software.support.cisco_psirt.advisories:*.advisoryId': {'title': _('Advisory ID')}, + '.software.support.cisco_psirt.advisories:*.bugIDs': {'title': _('Bug IDs')}, + '.software.support.cisco_psirt.Last_checked': {'title': _('Last checked')}, + })) + declare_invtable_view('invciscoeox', '.hardware.support.cisco_eox:', _('Cisco EoX status'), _('Cisco EoX status')) declare_invtable_view('invciscocontract', '.hardware.support.cisco_contract:', _('Cisco contract status'), _('Cisco contract status')) declare_invtable_view('invciscopsirt', '.software.support.cisco_psirt.advisories:', _('Cisco PSIRT advisories'), _('Cisco PSIRT advisories')) declare_invtable_view('invciscobugs', '.software.support.cisco_bug.bugs:', _('Cisco BUG IDs'), _('Cisco Bug IDs')) -##declare_invtable_view('invciscosuggestion', '.software.support.cisco_suggestion:', _('Cisco suggested software'), _('Cisco suggested software')) - diff --git a/web/plugins/wato/inv_cisco_bug.py b/web/plugins/wato/inv_cisco_bug.py index e9ce8413de7bcdd4b99da6d02b37fdf23b133912..4d4a75453fd68ff123fa76c9d3efb30b9d654ffa 100644 --- a/web/plugins/wato/inv_cisco_bug.py +++ b/web/plugins/wato/inv_cisco_bug.py @@ -25,39 +25,32 @@ from cmk.gui.plugins.wato.inventory import ( RulespecGroupInventory, ) -_removecolumns = [ - # ('status', 'Status'), +_removecolumns_inv_cisco_bug = [ + # ('status', 'Status'), ('product', 'Product'), ('description', 'Description'), - ('headline', 'Headline'), - ('support_case_count', 'Support case count'), - ('last_modified_date', 'Last modified date'), - ('behavior_changed', 'Behavior changed'), - # ('bug_id', 'Bug ID'), + # ('headline', 'Headline'), + # ('support_case_count', 'Support case count'), + # ('last_modified_date', 'Last modified date'), + # ('behavior_changed', 'Behavior changed'), + # ('bug_id', 'Bug ID'), ('base_pid', 'Base PID'), ('known_fixed_releases', 'Known fixed releases'), ('id', 'ID'), ('known_affected_releases', 'known affected releases'), - ('severity', 'Severity'), + # ('severity', 'Severity'), ] def _valuespec_inv_cisco_bug(): return Dictionary( - title=_('Cisco bug advisories'), + title=_('Cisco bugs'), elements=[ - ('disable_bug', - FixedValue( - True, - title=_('disable Cisco bug information'), - help=_('if true, CMK will not request bug information from Cisco'), - default_value=False, - )), ('removecolumns', ListChoice( title=_('remove columns'), help=_('remove information from report'), - choices=_removecolumns, + choices=_removecolumns_inv_cisco_bug, default_value=[ 'base_pid', 'description', diff --git a/web/plugins/wato/inv_cisco_contract.py b/web/plugins/wato/inv_cisco_contract.py index 1627896da15ba6a41efc66e57aff3817cafbe2a0..4c71f6ea4b2440c86a94219f8fabc9d27375fcac 100644 --- a/web/plugins/wato/inv_cisco_contract.py +++ b/web/plugins/wato/inv_cisco_contract.py @@ -18,13 +18,14 @@ from cmk.gui.plugins.wato import ( from cmk.gui.valuespec import ( Dictionary, ListChoice, + ListOfStrings, ) from cmk.gui.plugins.wato.inventory import ( RulespecGroupInventory, ) -_removecolumns = [ +_removecolumns_inv_cisco_contract = [ ('contract_site_address1', 'Address'), ('contract_site_city', 'City'), ('contract_site_country', 'Country'), @@ -46,7 +47,7 @@ def _valuespec_inv_cisco_contract(): ListChoice( title=_('remove columns'), help=_('remove information from report'), - choices=_removecolumns, + choices=_removecolumns_inv_cisco_contract, default_value=[ 'contract_site_state_province', 'warranty_type_description', diff --git a/web/plugins/wato/inv_cisco_eox.py b/web/plugins/wato/inv_cisco_eox.py index aae882888da7a6e652d5220214b386eb8ee89826..b0f775aadbbf9a23b4aa8203c6405a5a5089bdc9 100644 --- a/web/plugins/wato/inv_cisco_eox.py +++ b/web/plugins/wato/inv_cisco_eox.py @@ -26,7 +26,7 @@ from cmk.gui.plugins.wato.inventory import ( RulespecGroupInventory, ) -_removecolumns = [ +_removecolumns_inv_cisco_eox = [ # ('ProductIDDescription', 'PID Description'), ('LinkToProductBulletinURL', 'EOL bulletin URL'), ('EndOfSecurityVulSupportDate', 'End of service vulnerability support'), @@ -54,7 +54,7 @@ def _valuespec_inv_cisco_eox(): ListChoice( title=_('remove columns'), help=_('remove information from EoX report'), - choices=_removecolumns, + choices=_removecolumns_inv_cisco_eox, default_value=[ 'EndOfSecurityVulSupportDate', 'EndOfSWMaintenanceReleases', diff --git a/web/plugins/wato/inv_cisco_psirt.py b/web/plugins/wato/inv_cisco_psirt.py index 95772b296167bfe856b93cee145cc31982640287..5674516f1ec3d9e680bba0698172a18a092482de 100644 --- a/web/plugins/wato/inv_cisco_psirt.py +++ b/web/plugins/wato/inv_cisco_psirt.py @@ -28,7 +28,7 @@ from cmk.gui.plugins.wato.inventory import ( RulespecGroupInventory, ) -_removecolumns = [ +_removecolumns_inv_cisco_psirt = [ ('bugIDs', 'Cisco Bug IDs'), ('firstFixed', 'First fixed in'), ('firstPublished', 'First Published'), @@ -54,7 +54,7 @@ def _valuespec_inv_cisco_psirt(): ListChoice( title=_('remove columns'), help=_('remove information from report'), - choices=_removecolumns, + choices=_removecolumns_inv_cisco_psirt, default_value=[ 'publicationUrl', 'summary',