diff --git a/web/plugins/wato/cisco_bgp_peer.py b/web/plugins/wato/cisco_bgp_peer.py deleted file mode 100644 index ec67803b89be78f3155f8ca62cd9fe74d10c0b74..0000000000000000000000000000000000000000 --- a/web/plugins/wato/cisco_bgp_peer.py +++ /dev/null @@ -1,139 +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 -# Date : 2017-12-25 -# -# Check_MK cisco_bgp_peers WATO plugin -# -# 2021-03-27: rewrite for CMK 2.0 -# - -from cmk.gui.i18n import _ -from cmk.gui.valuespec import ( - Dictionary, - Integer, - TextAscii, - FixedValue, - ListChoice, - ListOf, - Tuple, - TextUnicode, - MonitoringState, -) - -from cmk.gui.plugins.wato import ( - CheckParameterRulespecWithItem, - rulespec_registry, - RulespecGroupCheckParametersNetworking, -) - -_cisco_bgp_peer_infotext_values = [ - ('remoteid', 'Remote router ID'), - ('remoteas', 'Remote autonomous system'), - ('localaddr', 'Local peer IP address'), - ('localid', 'Local router ID'), - ('localas', 'Local autonomous system'), -] - - -def _parameter_valuespec_cisco_bgp_peer(): - return Dictionary(elements=[ - ('minuptime', - Tuple( - title=_('Minimum uptime for peer'), - help=_('Set the time in seconds, a peer must be up before the peer is considered sable.' - 'If the peer uptime less then X, the check outcome is set to warning.'), - elements=[ - Integer(title=_('Warning if below'), unit='seconds', default_value=7200, minvalue=0), - Integer(title=_('Critical if below'), unit='seconsa', default_value=3600, minvalue=0) - ], - )), - ('peernotfound', - MonitoringState( - default_value=2, - title=_('State if peer is no not found.'), - help=_('Default monitoring state if the peer is not found in the SNMP data') - )), - ('admindown', - MonitoringState( - default_value=1, - title=_('State if peer is admin shutdown.'), - help=_('Monitoring state if the peer is admin shutdown') - )), - ('noprefixlimit', - MonitoringState( - default_value=1, - title=_('State if no admin prefix limit/warn threshold configured.'), - help=_('The admin prefix limit and warn threshold needs to be configured on the device. ' - 'For example: neighbor 172.17.10.10 maximum-prefix 10000 80. The threshold is in percentage ' - 'of the prefix limit') - )), - ('useaslocalas', - Integer( - help=_('Use this AS number if the SNMP Value for CISCO-BGP4-MIB::cbgpPeer2LocalAs is \'0\'.'), - title=_('Use AS as local AS, if SNMP cbgpPeer2LocalAs is not valid.'), - default_value=0, - minvalue=0, - maxvalue=4294967295, - )), - ('htmloutput', - FixedValue( - True, - help=_('render long output of check plugin (multiline) as HTML table. ' - 'Needs \'Escape HTML codes in plugin output\' in wato --> global settings disabled or ' - 'add a Rule to the \'Cisco BGP peer\' service (Setup - Services - Service monitoring rules - ' - 'Escape HTML in service output.'), - title=_('enable HTML Output for long output of check plugin (multiline)'), - totext=_('enable HTML Output for long output of check plugin (multiline)'), - default_value=False, - )), - ('infotext_values', - ListChoice( - title=_('Add values to check info'), - help=_('Select values to add to the check output.'), - choices=_cisco_bgp_peer_infotext_values, - default_value=[], - )), - ('peer_list', - ListOf( - Tuple( - elements=[ - TextUnicode( - title=_('BGP Peer item name (without "Cisco BGP peer")'), - help=_('The configured value must match a BGP item reported by the monitored ' - 'device. For example: "10.194.115.98 IPv4 Unicast"'), - allow_empty=False, - ), - TextUnicode( - title=_('BGP Peer Alias'), - help=_('You can configure an individual alias here for the BGP peer matching ' - 'the text configured in the "BGP Peer item name" field. The alias will ' - 'be shown in the check info'), - ), - MonitoringState( - default_value=2, - title=_('State if not found'), - help=_('You can configure an individual state if the BGP peer matching the text ' - 'configured in the "BGP Peer item name" field is not found') - ), - ]), - add_label=_('Add BGP peer'), - movable=False, - title=_('BGP Peers'), - )), - ]) - - -rulespec_registry.register( - CheckParameterRulespecWithItem( - check_group_name='cisco_bgp_peer', - group=RulespecGroupCheckParametersNetworking, - item_spec=lambda: TextAscii(title=_('BGP peer specific configuration'), ), - match_type='dict', - parameter_valuespec=_parameter_valuespec_cisco_bgp_peer, - title=lambda: _('Cisco BGP peer'), - ))