diff --git a/web/plugins/wato/cisco_api_status.py b/web/plugins/wato/cisco_api_status.py deleted file mode 100644 index 357c61be56af00e4f66c89f6588c9d96006c2c18..0000000000000000000000000000000000000000 --- a/web/plugins/wato/cisco_api_status.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# License: GNU General Public License v2 -# -# Author: thl-cmk[at]outlook[dot]com -# URL : https://thl-cmk.hopto.org -# -# 2021-07-23: rewritten for CMK 2.0 -# - -from cmk.gui.i18n import _ -from cmk.gui.valuespec import ( - Dictionary, - Integer, - DropdownChoice, -) - -from cmk.gui.plugins.wato import ( - CheckParameterRulespecWithItem, - rulespec_registry, - RulespecGroupCheckParametersNetworking, -) - -_psirt_severity = [ - (1, _('Critical')), - (2, _('High')), - (3, _('Medium')), - (4, _('Low')), - (0, _('All')), -] - -_not_active = [ - (0, _('Ok')), - (1, _('Warning')), - (2, _('Critical')), -] - - -def _parameter_valuespec_cisco_api_status(): - return Dictionary( - title=_('Check status of Cisco support API'), - help=_('help .....'), - elements=[ - ('psirt', - Dictionary( - title=_('PSIRT API options'), - elements=[ - ('crit-days', - Integer( - title=_('set outcome to critical is new/updated advisory not older then days'), - default_value=7, - )), - ('warn-days', - Integer( - title=_('set outcome to warning is new/updated advisory not older then days'), - default_value=31, - )), - ('crit-severity', DropdownChoice( - choices=_psirt_severity, - title=_('set outcome to critical if new/updated advisory equal or above severity'), - default_value=2 - )), - ('warn-severity', DropdownChoice( - choices=_psirt_severity, - title=_('set outcome to warning if new/updated advisory equal or above severity'), - default_value=3 - )), - ('not-active', DropdownChoice( - choices=_not_active, - title=_('set status if PSIRT API is not active'), - )), - - ] - )), - ('eox', - Dictionary( - title=_('EoX API options'), - elements=[ - ('crit-new', - Integer( - title=_('set outcome to warning is new/updated EoL announcement not older then days'), - default_value=7, - )), - ('warn-new', - Integer( - title=_('set outcome to warning is new/updated EoL announcement not older then days'), - default_value=30, - )), - ('crit-change', - Integer( - title=_('set outcome to critical is EoL announcement is about to change in days'), - default_value=30, - )), - ('warn-change', - Integer( - title=_('set outcome to warning is EoL announcement is about to change in days'), - default_value=90, - )), - ('not-active', DropdownChoice( - choices=_not_active, - title=_('set status if EoX API is not active'), - )), - ] - )), - # ('suggestion', - # Dictionary( - # title=_('SUGGESTION API options'), - # elements=[ - # ('not-active', DropdownChoice( - # choices=not_active, - # title=_('set status if SUGGESTION is API not active'), - # )), - # - # ] - # )), - ('sn2info', - Dictionary( - title=_('SN2INFO (contract) API options'), - elements=[ - ('crit-change', - Integer( - title=_('set outcome to critical is contract is about to change in days'), - default_value=30, - )), - ('warn-change', - Integer( - title=_('set outcome to warning is contract is about to change in days'), - default_value=90, - )), - ('not-active', DropdownChoice( - choices=_not_active, - title=_('set status if SN2INFO API is not active'), - )), - - ] - )), - ]) - -# ToDo: move to active checks -rulespec_registry.register( - CheckParameterRulespecWithItem( - check_group_name='cisco_api_status', - group=RulespecGroupCheckParametersNetworking, - match_type='dict', - parameter_valuespec=_parameter_valuespec_cisco_api_status, - title=lambda: _('Cisco support API'), - ))