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

update project

parent d6664d53
No related branches found
No related tags found
No related merge requests found
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
......@@ -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)
......
......@@ -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,
......
......@@ -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 = []
......
No preview for this file type
......@@ -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
/* 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;
}
This diff is collapsed.
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
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