From 7b85e42543f103bca6a4fe5c6f486793ebcdd474 Mon Sep 17 00:00:00 2001 From: thl-cmk <thl-cmk@outlook.com> Date: Mon, 12 Jun 2023 15:29:07 +0000 Subject: [PATCH] Delete inv_bgp_peer.py --- gui/wato/inv_bgp_peer.py | 107 --------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 gui/wato/inv_bgp_peer.py diff --git a/gui/wato/inv_bgp_peer.py b/gui/wato/inv_bgp_peer.py deleted file mode 100644 index f4832c6..0000000 --- a/gui/wato/inv_bgp_peer.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Author: thl-cmk[at]outlook[dot]com -# URL : https://thl-cmk.hopto.org -# Date : 2022-04-24 -# -# 2022-04-24: added option for BGP down time -# added option to remove some columns from inventory -# 2022-04-28: added Whois options - -from cmk.gui.i18n import _ -from cmk.gui.plugins.wato.utils import ( - HostRulespec, - rulespec_registry, -) -from cmk.gui.valuespec import ( - Dictionary, - ListChoice, - Age, - DropdownChoice, - Integer, -) - -from cmk.gui.plugins.wato.inventory import ( - RulespecGroupInventory, -) - - -def _valuespec_inv_bgp_peer(): - removecolumns = [ - # ('remote_as', 'Remote AS'), - # ('remote_id', 'Remote ID'), - # ('local_addr', 'Local address'), - # ('local_as', 'Local AS'), - # ('local_id', 'Local ID'), - ('address_family', 'Address family'), - ('last_error', 'Last error'), - ('last_error_code', 'Last error code'), - # ('prev_state', 'Previous state'), - ('as_name', 'Remote AS name'), - ('as_org_name', 'Remote AS Org Name'), - ('bgp_type', 'Type'), - ('version', 'Version'), - ] - - return Dictionary( - title=_('BGP peer'), - elements=[ - ('not_in_service_time', - Age( - title=_('Time peer is not up until considered not in service'), - default_value=2592000, # 30 days in seconds, - )), - ('remove_columns', - ListChoice( - title=_('List of columns to remove'), - help=_('Information to remove from inventory'), - choices=removecolumns, - default_value=[], - )), - ('whois_enable', - Dictionary( - title=_('Add whois data to the inventory'), - help=_( - 'The whois data will be fetched via RDAP from the registries. For this the the plugin tries to' - 'find the best registry via the RDAP bootstrap data from https://data.iana.org/rdap/asn.json.' - 'The query it self will go to the found registry via http(s). Note: the request might be get ' - 'redirected if there a different authoritative registry for the ASn' - ), - elements=[ - ('whois_rir', - DropdownChoice( - title='Preferred RIR to fetch whois data', - help=_( - 'This registry will be used if the plugin can not determine the authoritative registry ' - 'based on the bootstrap data.' - ), - choices=[ - ('afrinic', _('AFRINIC (https://rdap.afrinic.net/rdap)')), - ('apnic', _('APNIC (https://rdap.apnic.net)')), - ('arin', _('ARIN (https://rdap.arin.net/registry)')), - ('ripe', _('RIPE (https://rdap.db.ripe.net)')), - ('lacnic', _('LACNIC (https://rdap.apnic.net)')), - ] - )), - ('whois_timeout', - Integer( - title='Timeout for connections to RIRs', - help=_('The connection timeout for each whois request.'), - default_value=5, - minvalue=1, - unit=_('seconds'), - )), - ] - )), - ], - ) - - -rulespec_registry.register( - HostRulespec( - group=RulespecGroupInventory, - match_type='dict', - name='inv_parameters:inv_bgp_peer', - valuespec=_valuespec_inv_bgp_peer, - )) -- GitLab