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

Delete inv_bgp_peer.py

parent a7c628c3
No related branches found
No related tags found
No related merge requests found
#!/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,
))
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