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

Delete bgp_peer.py

parent 1f6046ed
No related branches found
No related tags found
No related merge requests found
#!/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 : 2021-08-21
#
# BGP Peer metrics plugin
#
#
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics import (
metric_info,
graph_info,
perfometer_info
)
#####################################################################################################################
#
# define metrics for bgp peer perfdata
#
#####################################################################################################################
metric_info['bgp_peer_inupdates'] = {
'title': _('Updates received'),
'unit': '1/s',
'color': '22/a',
}
metric_info['bgp_peer_outupdates'] = {
'title': _('Updates send'),
'unit': '1/s',
'color': '32/a',
}
metric_info['bgp_peer_intotalmessages'] = {
'title': _('Messages received'),
'unit': '1/s',
'color': '42/a',
}
metric_info['bgp_peer_outtotalmessages'] = {
'title': _('Messages send'),
'unit': '1/s',
'color': '13/a',
}
metric_info['bgp_peer_fsmestablishedtransitions'] = {
'title': _('FSM transitions'),
'unit': 'count',
'color': '23/a',
}
metric_info['bgp_peer_fsmestablishedtime'] = {
'title': _('FSM last change'),
'unit': 's',
'color': '26/a',
}
metric_info['bgp_peer_inupdateelapsedtime'] = {
'title': _('Last update received'),
'unit': 's',
'color': '43/a',
}
metric_info['bgp_peer_acceptedprefixes'] = {
'title': _('Prefixes accepted'),
'help': _('number of accepted prefixes'),
'unit': 'count',
'color': '11/a',
}
metric_info['bgp_peer_deniedprefixes'] = {
'title': _('Prefixes denied'),
'unit': '1/s',
'color': '21/a',
}
metric_info['bgp_peer_advertisedprefixes'] = {
'title': _('Prefixes advertised'),
'unit': '1/s',
'color': '31/a',
}
metric_info['bgp_peer_withdrawnprefixes'] = {
'title': _('Prefixes withdrawn'),
'unit': '1/s',
'color': '41/a',
}
metric_info['bgp_peer_suppressedprefixes'] = {
'title': _('Prefixes suppressed'),
'unit': '1/s',
'color': '12/a',
}
# Juniper specific metrics
metric_info['bgp_peer_in_prefixes'] = {
'title': _('Prefixes in'),
'unit': 'count',
'color': '11/a',
}
metric_info['bgp_peer_in_prefixes_rejected'] = {
'title': _('Prefixes in rejected'),
'unit': 'count',
'color': '21/a',
}
metric_info['bgp_peer_in_prefixes_active'] = {
'title': _('Prefixes in active'),
'unit': 'count',
'color': '31/a',
}
metric_info['bgp_peer_out_prefixes'] = {
'title': _('Prefixes out'),
'unit': 'count',
'color': '41/a',
}
######################################################################################################################
#
# how to graph perdata for bgp peer
#
######################################################################################################################
graph_info['bgp_peer.fms_transitions_last_change'] = {
'title': _('FSM established last change'),
'metrics': [
('bgp_peer_fsmestablishedtime', 'area'),
],
'range': (0, 'bgp_peer_fsmestablishedtime:max'),
}
graph_info['bgp_peer.prefixes_accepted'] = {
'title': _('Accepted Prefixes'),
'metrics': [
('bgp_peer_acceptedprefixes', 'area'),
],
'scalars': [
('bgp_peer_acceptedprefixes:crit', _('crit')),
('bgp_peer_acceptedprefixes:warn', _('warn')),
],
'range': (0, 'bgp_peer_acceptedprefixes:max'),
}
graph_info['bgp_peer.prefixes_per_second'] = {
'title': _('Prefixes/s'),
'metrics': [
('bgp_peer_withdrawnprefixes', 'line'),
('bgp_peer_suppressedprefixes', 'line'),
('bgp_peer_deniedprefixes', 'line'),
('bgp_peer_advertisedprefixes', 'line'),
],
'optional_metrics': [
'bgp_peer_withdrawnprefixes',
'bgp_peer_suppressedprefixes',
'bgp_peer_deniedprefixes',
'bgp_peer_advertisedprefixes',
],
}
graph_info['bgp_peer.updates_in_out'] = {
'title': _('Updates'),
'metrics': [
('bgp_peer_outupdates', '-area'),
('bgp_peer_inupdates', 'area'),
]
}
graph_info['bgp_peer.messages_in_out'] = {
'title': _('Total messages'),
'metrics': [
('bgp_peer_outtotalmessages', '-area'),
('bgp_peer_intotalmessages', 'area'),
]
}
graph_info['bgp_peer.fms_transitions_from_to'] = {
'title': _('FSM transitions from/to established'),
'metrics': [
('bgp_peer_fsmestablishedtransitions', 'area'),
],
'range': (0, 'bgp_peer_fsmestablishedtransitions:max'),
}
graph_info['bgp_peer.time_since_last_update'] = {
'title': _('Time since last update received'),
'metrics': [
('bgp_peer_inupdateelapsedtime', 'area'),
],
'range': (0, 'bgp_peer_inupdateelapsedtime:mac'),
}
# juniper prefixes
graph_info['bgp_peer.juniper_prefixes'] = {
'title': _('Prefixes in/out'),
'metrics': [
('bgp_peer_out_prefixes', '-line'),
('bgp_peer_in_prefixes_rejected', 'line'),
('bgp_peer_in_prefixes_active', 'line'),
('bgp_peer_in_prefixes', 'line'),
],
}
######################################################################################################################
#
# define perf-o-meter for bgp peer uptime + prefixes accepted/advertised
#
######################################################################################################################
perfometer_info.append(('stacked', [
{
'type': 'logarithmic',
'metric': 'bgp_peer_fsmestablishedtime',
'half_value': 2592000.0, # ome month
'exponent': 2,
},
{
'type': 'logarithmic',
'metric': 'bgp_peer_acceptedprefixes',
'half_value': 500000.0,
'exponent': 2,
}
]))
perfometer_info.append({
'type': 'logarithmic',
'metric': 'bgp_peer_fsmestablishedtime',
'half_value': 2592000.0, # ome month
'exponent': 2,
})
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