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

cleanup

parents
No related branches found
No related tags found
No related merge requests found
# Cisco BGP Peers
Monitors status of Cisco BGP peers
Check Info:
* *service*: this check creates one service for each peer/address family (IPv4 and IPv6)
* *state*: [WHEN WILL THE CHECK be **critical** or **warning** or **ok** or **unknown**]
* *wato*:
* **min uptime**: minimum time before a bgp peer connection is consinderd as stable, default 86400 seconds (1 day)
* **Local AS**: use AS as local AS, if SNMP *cbgpPeer2LocalAs* is not valid
* **HTML output**: enable HTML Output for long output of check plugin (multiline)
* **Infotext values**: select which information is shown in the check output
* **BGP Peer object name**: The configured value must match a BGP peer reported by the monitored device
* **BGP Peer Alias**: You can configure an individual alias here for the BGP peer matching the IP-Address configured in the field above.
* **MonitoringState**: State if the above BGP peer is not found (default is critical)
* *perfdata*:
* Prefixes accepted (count)
* Prefixes denied (/s)
* Prefixes advertised (/s)
* Prefixes withdrawn (/s)
* Prefixes suppressed (/s)
* Updates received (/s)
* Updates send (/s)
* Total messages send (/s)
* FMS transitions (count)
* FMS last change (s)
* Last update received (s)
Sample output
![sample output](/doc/sample.png?raw=true "sample [SHORT TITLE]")
This diff is collapsed.
File added
doc/sample.png

55.2 KiB

{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u"Monitors Cisco BGP Peers (CISCO-BGP4-MIB). \n\n- creates one service for each peer/address family (IPv4 and IPv6)\n- performance data include: peer uptime, prefixes accepted, advertised, denied, suppressed and withdrawn\n\nv0.2: added support for more then one address family per peer\n changed item from peer address to peer address + address family\n changed package name from 'cisco_bgp' to 'cisco_bgp_peer'\n",
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['cisco_bgp_peer'],
'web': ['plugins/wato/cisco_bgp_peer.py',
'plugins/metrics/cisco_bgp_peer.py']},
'name': 'cisco_bgp_peer',
'num_files': 3,
'title': u'Cisco BGP Peer',
'version': '20190218.v.0.2b',
'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p35'}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Cisco BGP Peer metrics plugin
#
# Author: Th.L.
# Date : 2017-12-26
#
# 25.05.2018: cleanup
#
#####################################################################################################################
#
# define units for bgp peer perfdata
#
#####################################################################################################################
#####################################################################################################################
#
# define metrics for bgp peer perfdata
#
#####################################################################################################################
metric_info['cisco_bgp_peer_acceptedprefixes'] = {
'title': _('Prefixes accepted'),
'help': _('number of accepted prefixes'),
'unit': 'count',
'color': '11/a',
}
metric_info['cisco_bgp_peer_deniedprefixes'] = {
'title': _('Prefixes denied'),
'unit': '1/s',
'color': '21/a',
}
metric_info['cisco_bgp_peer_advertisedprefixes'] = {
'title': _('Prefixes advertised'),
'unit': '1/s',
'color': '31/a',
}
metric_info['cisco_bgp_peer_withdrawnprefixes'] = {
'title': _('Prefixes withdrawn'),
'unit': '1/s',
'color': '41/a',
}
metric_info['cisco_bgp_peer_suppressedprefixes'] = {
'title': _('Prefixes suppressed'),
'unit': '1/s',
'color': '12/a',
}
metric_info['cisco_bgp_peer_inupdates'] = {
'title': _('Updates received'),
'unit': '1/s',
'color': '22/a',
}
metric_info['cisco_bgp_peer_outupdates'] = {
'title': _('Updates send'),
'unit': '1/s',
'color': '32/a',
}
metric_info['cisco_bgp_peer_intotalmessages'] = {
'title': _('Total messages received'),
'unit': '1/s',
'color': '42/a',
}
metric_info['cisco_bgp_peer_outtotalmessages'] = {
'title': _('Total messages send'),
'unit': '1/s',
'color': '13/a',
}
metric_info['cisco_bgp_peer_fsmestablishedtransitions'] = {
'title': _('FMS transitions'),
'unit': 'count',
'color': '23/a',
}
metric_info['cisco_bgp_peer_fsmestablishedtime'] = {
'title': _('FMS last change'),
'unit': 's',
'color': '26/a', # 26
}
metric_info['cisco_bgp_peer_inupdateelapsedtime'] = {
'title': _('Last update received'),
'unit': 's',
'color': '43/a',
}
######################################################################################################################
#
# map bgp peer perfdata to metric, not really necessary but makes sure to use the right metrics
#
######################################################################################################################
check_metrics['check_mk-cisco_bgp_peer'] = {
'acceptedprefixes': {'name': 'cisco_bgp_peer_acceptedprefixes', },
'deniedprefixes': {'name': 'cisco_bgp_peer_deniedprefixes', },
'advertisedprefixes': {'name': 'cisco_bgp_peer_advertisedprefixes', },
'withdrawnprefixes': {'name': 'cisco_bgp_peer_withdrawnprefixes', },
'suppressedprefixes': {'name': 'cisco_bgp_peer_suppressedprefixes', },
'inupdates': {'name': 'cisco_bgp_peer_inupdates', },
'outupdates': {'name': 'cisco_bgp_peer_outupdates', },
'intotalmessages': {'name': 'cisco_bgp_peer_intotalmessages', },
'outtotalmessages': {'name': 'cisco_bgp_peer_outtotalmessages', },
'fsmestablishedtransitions': {'name': 'cisco_bgp_peer_fsmestablishedtransitions', },
'fsmestablishedtime': {'name': 'cisco_bgp_peer_fsmestablishedtime', },
'inupdateelapsedtime': {'name': 'cisco_bgp_peer_inupdateelapsedtime', },
}
######################################################################################################################
#
# how to graph perdata for bgp peer
#
######################################################################################################################
graph_info.append({
'title': _('Accepted Prefixes'),
'metrics': [
('cisco_bgp_peer_acceptedprefixes', 'line'),
],
'scalars': [
('cisco_bgp_peer_acceptedprefixes:crit', _('crit')),
('cisco_bgp_peer_acceptedprefixes:warn', _('warn')),
],
})
graph_info.append({
'title': _('Prefixes/s'),
'metrics': [
('cisco_bgp_peer_deniedprefixes', 'line'),
('cisco_bgp_peer_advertisedprefixes', 'line'),
('cisco_bgp_peer_withdrawnprefixes', 'line'),
('cisco_bgp_peer_suppressedprefixes', 'line'),
],
})
graph_info.append({
'title': _('Updates'),
'metrics': [
('cisco_bgp_peer_inupdates', 'area'),
('cisco_bgp_peer_outupdates', '-area'),
]
})
graph_info.append({
'title': _('Total messages'),
'metrics': [
('cisco_bgp_peer_intotalmessages', 'area'),
('cisco_bgp_peer_outtotalmessages', '-area'),
]
})
graph_info.append({
'title': _('FMS transitions from/to established'),
'metrics': [
('cisco_bgp_peer_fsmestablishedtransitions', 'line'),
],
})
graph_info.append({
'title': _('FMS established last change'),
'metrics': [
('cisco_bgp_peer_fsmestablishedtime', 'line'),
]
})
graph_info.append({
'title': _('Time since last update received'),
'metrics': [
('cisco_bgp_peer_inupdateelapsedtime', 'line'),
]
})
######################################################################################################################
#
# define perf-o-meter for bgp peer uptime + prefixes accepted/advertised
#
######################################################################################################################
perfometer_info.append(('stacked', [
{
'type': 'logarithmic',
'metric': 'cisco_bgp_peer_fsmestablishedtime',
'half_value': 2592000.0,
'exponent': 2,
},
{
'type': 'linear',
'segments': ['cisco_bgp_peer_acceptedprefixes',
],
'total': 1000000,
}
]))
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Check_MK cisco_bgp_peers WATO plugin
#
# Author: Th.L.
# Date: 2017-12-25
#
#
#
#
infotext_values = [
('remoteid', 'Remote router ID'),
('remoteas', 'Remote autonomous system'),
('localaddr', 'Local peer IP address'),
('localid', 'Local router ID'),
('localas', 'Local autonomous system'),
]
register_check_parameters(
subgroup_networking,
'cisco_bgp_peer',
_('Cisco BGP peer'),
Dictionary(
help=_(''),
elements=[
('minuptime',
Integer(
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.'),
title=_('Minimum uptime for peer. If uptime less, set check outcome to warning. Default is 1 day.'),
default_value=86400,
allow_empty=False,
unit='seconds',
minvalue=1,
),
),
('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,
allow_empty=False,
),
),
('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'),
title=_('enable HTML Output for long output of check plugin (multiline)'),
#label=_('enable'),
)),
('infotext_values',
ListChoice(
title=_('Infotext values'),
label=_('Infotext values'),
help=_('Values to show in Infotext'),
choices=infotext_values,
default_value=[],
)),
('peer_list',
ListOf(
Tuple(
title=('BGP Peers'),
elements=[
TextUnicode(
title=_('BGP Peer object name'),
help=_('The configured value must match a BGP peer reported by the monitored '
'device.'),
allow_empty=False,
),
TextUnicode(
title=_('BGP Peer Alias'),
help=_('You can configure an individual alias here for the BGP peer matching '
'the IP-Address configured in the field above.'),
),
MonitoringState(
default_value=2,
title=_('State if BGP peer is not found'),
)]),
add_label=_('Add BGP peer'),
movable=False,
title=_('BGP peer specific configuration'),
)),
],
),
TextAscii(title=_('Cisco BGP peer')),
match_type='dict',
)
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