diff --git a/agent_based/cisco_eigrp_as_info.py b/agent_based/cisco_eigrp_as_info.py index dbb2b158e32c65c8ce9b249bc6691b1a5f2a9ca1..97d25a2e74ff5002a0530fba31fe75ac40d11244 100644 --- a/agent_based/cisco_eigrp_as_info.py +++ b/agent_based/cisco_eigrp_as_info.py @@ -12,8 +12,9 @@ # 2018-02-11: removed unnecessary OIDs # 2018-08-06: modified scan function # 2019-10-16: added support for IPv6 and VRFs, added parser function +# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/... # -# + # snmpwalk sample # # thl@surfbox-ii:~$ snmpwalk -v2c -c router-01 -ObentU simulant .1.3.6.1.4.1.9.9.449.1.2.1.1 @@ -43,20 +44,18 @@ # # sample info # [ -# [u'65536.10', u'1', u'7081', u'6637', u'37', u'45', u'0', u'0', u'0', u'0', u'26', u'32', u'2', u'0', u'0', u'0', u'1', u'\n\xa7\xdc\xfd', u'10', u'0'] +# ['65536.10', '1', '7081', '6637', '37', '45', '0', '0', '0', '0', '26', '32', '2', '0', '0', '0', '1', '\n\xa7\xdc\xfd', '10', '0'] # ] # # from time import time -from dataclasses import dataclass -from typing import Optional, List +from typing import List from cmk.base.plugins.agent_based.agent_based_api.v1 import ( register, Service, Result, - check_levels, State, SNMPTree, all_of, @@ -75,13 +74,14 @@ from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( StringTable, ) -_InetAddressType = {0: 'unknown', - 1: 'ipv4', - 2: 'ipv6', - 3: 'ipv4z', - 4: 'ipv6z', - 16: 'dns', - } +_InetAddressType = { + 0: 'unknown', + 1: 'ipv4', + 2: 'ipv6', + 3: 'ipv4z', + 4: 'ipv6z', + 16: 'dns', +} def _render_ip_address(bytestring): @@ -99,9 +99,10 @@ def parse_cisco_eigrp_as_info(string_table: List[StringTable]): ASTable = {} ASInfo, VrfInfo = string_table - for OID_END, cEigrpNbrCount, cEigrpHellosSent, cEigrpHellosRcvd, cEigrpUpdatesSent, cEigrpUpdatesRcvd, cEigrpQueriesSent, \ - cEigrpQueriesRcvd, cEigrpRepliesSent, cEigrpRepliesRcvd, cEigrpAcksSent, cEigrpAcksRcvd, cEigrpInputQHighMark, cEigrpInputQDrops, \ - cEigrpSiaQueriesSent, cEigrpSiaQueriesRcvd, cEigrpAsRouterIdType, cEigrpAsRouterId, cEigrpTopoRoutes, cEigrpXmitPendReplies in ASInfo: + for OID_END, cEigrpNbrCount, cEigrpHellosSent, cEigrpHellosRcvd, cEigrpUpdatesSent, cEigrpUpdatesRcvd, \ + cEigrpQueriesSent, cEigrpQueriesRcvd, cEigrpRepliesSent, cEigrpRepliesRcvd, cEigrpAcksSent, cEigrpAcksRcvd, \ + cEigrpInputQHighMark, cEigrpInputQDrops, cEigrpSiaQueriesSent, cEigrpSiaQueriesRcvd, cEigrpAsRouterIdType, \ + cEigrpAsRouterId, cEigrpTopoRoutes, cEigrpXmitPendReplies in ASInfo: cEigrpVrfId = int(OID_END.split('.')[0]) cEigrpAS = OID_END.split('.')[1] @@ -147,11 +148,13 @@ def parse_cisco_eigrp_as_info(string_table: List[StringTable]): if cEigrpVrfName == 'default' and cEigrpAddrFammily == 'IPv4': ASTable.update({cEigrpVrfId: {'ServiceText': cEigrpAS, 'cEigrpVrfId': cEigrpVrfId}}) elif cEigrpVrfName == 'default' and cEigrpAddrFammily == 'IPv6': - ASTable.update({cEigrpVrfId:{'ServiceText': '%s IPv6' % cEigrpAS, 'cEigrpVrfId': cEigrpVrfId}}) + ASTable.update({cEigrpVrfId: {'ServiceText': f'{cEigrpAS} IPv6', 'cEigrpVrfId': cEigrpVrfId}}) elif cEigrpVrfName != 'default' and cEigrpAddrFammily == 'IPv4': - ASTable.update({cEigrpVrfId:{'ServiceText': '%s VRF %s' % (cEigrpAS, cEigrpVrfName), 'cEigrpVrfId': cEigrpVrfId}}) + ASTable.update({cEigrpVrfId: {'ServiceText': f'{cEigrpAS} VRF {cEigrpVrfName}', + 'cEigrpVrfId': cEigrpVrfId}}) elif cEigrpVrfName != 'default' and cEigrpAddrFammily == 'IPv6': - ASTable.update({cEigrpVrfId:{'ServiceText': '%s IPv6 VRF %s' % (cEigrpAS, cEigrpVrfName), 'cEigrpVrfId': cEigrpVrfId}}) + ASTable.update({cEigrpVrfId: {'ServiceText': f'{cEigrpAS} IPv6 VRF {cEigrpVrfName}', + 'cEigrpVrfId': cEigrpVrfId}}) return [ASTable, ASInfoTable] ########################################################################### diff --git a/agent_based/cisco_eigrp_interface.py b/agent_based/cisco_eigrp_interface.py index fcf25df36023a3f19f9034d1547d152747817ebc..53d3d44342ddf0b7648abe0490be56677de3e17b 100644 --- a/agent_based/cisco_eigrp_interface.py +++ b/agent_based/cisco_eigrp_interface.py @@ -15,7 +15,9 @@ # 2019-10-14: added support for hamc-sha-256 authentication, md5 moved to warn, none moved to crit # 2019-10-16: added support for IPv6 and VRFs, added data parser function # 2019-10-31: changed item from interface long-name to interface short name +# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/... # + # snmpwalk sample # # OMD[mysite]:~$ snmpwalk -ObentU -v2c -c router-01 simulant .1.3.6.1.4.1.9.9.449.1.5.1.1 @@ -107,34 +109,32 @@ # sample info # [ # [ -# [u'65536.10.1', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'5', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'1', u''], -# [u'65536.10.7', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'5', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'1', u''], -# [u'65536.10.8', u'1', u'0', u'0', u'1', u'0', u'0', u'50', u'0', u'1', u'0', u'0', u'0', u'64', u'66', u'0', u'0', u'1', u'0', u'0', u'2', u'KEY-EIGRP-10'], -# [u'65536.10.9', u'1', u'0', u'0', u'19', u'23', u'0', u'84', u'0', u'1', u'0', u'0', u'18', u'40', u'27', u'1', u'2', u'0', u'5', u'3', u'2', u'KEY-EIGRP-10'] +# ['65536.10.1', '0', '0', '0', '0', '0', '0', '0', '0', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', ''], +# ['65536.10.7', '0', '0', '0', '0', '0', '0', '0', '0', '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', ''], +# ['65536.10.8', '1', '0', '0', '1', '0', '0', '50', '0', '1', '0', '0', '0', '64', '66', '0', '0', '1', '0', '0', '2', 'KEY-EIGRP-10'], +# ['65536.10.9', '1', '0', '0', '19', '23', '0', '84', '0', '1', '0', '0', '18', '40', '27', '1', '2', '0', '5', '3', '2', 'KEY-EIGRP-10'] # ], # [ -# [u'1', u'GigabitEthernet0/0/0'], -# [u'2', u'GigabitEthernet0/0/1'], -# [u'3', u'GigabitEthernet0/0/2'], -# [u'4', u'GigabitEthernet0/0/3'], -# [u'5', u'GigabitEthernet0'], -# [u'6', u'Null0'], -# [u'7', u'Loopback0'], -# [u'8', u'Tunnel10'], -# [u'9', u'Tunnel101'] +# ['1', 'GigabitEthernet0/0/0'], +# ['2', 'GigabitEthernet0/0/1'], +# ['3', 'GigabitEthernet0/0/2'], +# ['4', 'GigabitEthernet0/0/3'], +# ['5', 'GigabitEthernet0'], +# ['6', 'Null0'], +# ['7', 'Loopback0'], +# ['8', 'Tunnel10'], +# ['9', 'Tunnel101'] # ] # ] # -from time import mktime, gmtime from dataclasses import dataclass -from typing import Optional, List, Dict +from typing import List, Dict from cmk.base.plugins.agent_based.agent_based_api.v1 import ( register, Service, Result, - check_levels, State, SNMPTree, all_of, @@ -226,7 +226,7 @@ def parse_cisco_eigrp_interface(string_table: List[StringTable]) -> Dict[str, Ei cEigrpHelloInterval, cEigrpUMcasts, cEigrpRMcasts, cEigrpUUcasts, cEigrpRUcasts, cEigrpMcastExcepts, \ cEigrpCRpkts, cEigrpAcksSuppressed, cEigrpRetransSent, cEigrpOOSrvcd, cEigrpAuthMode, \ cEigrpAuthKeyChain in EigrpInterfaces: - + cEigrpVrfId = int(OID_END.split('.')[0]) cEigrpAS = OID_END.split('.')[1] cEigrpIfIndex = int(OID_END.split('.')[2]) @@ -235,7 +235,7 @@ def parse_cisco_eigrp_interface(string_table: List[StringTable]) -> Dict[str, Ei if int(ifindex) == cEigrpIfIndex: # compare interface index if not int(iftype) == 24: # skip Loopback interfaces cEigrpIfName = _get_short_if_name(ifname) - + if cEigrpIfName != '': cEigrpVrfName = '' for VrfId, VrfName in VrfInfo: @@ -246,7 +246,7 @@ def parse_cisco_eigrp_interface(string_table: List[StringTable]) -> Dict[str, Ei cEigrpAddrFammily = 'IPv4' else: cEigrpAddrFammily = 'IPv6' - + ServiceText = '' if cEigrpVrfName == 'default' and cEigrpAddrFammily == 'IPv4': ServiceText = f'{cEigrpIfName} on AS {cEigrpAS}' @@ -278,7 +278,7 @@ def parse_cisco_eigrp_interface(string_table: List[StringTable]) -> Dict[str, Ei cEigrpOOSrvcd=int(cEigrpOOSrvcd), cEigrpAuthMode=_eigrp_authmode(int(cEigrpAuthMode)), cEigrpAuthKeyChain=cEigrpAuthKeyChain, - ) + ) return EigrpIfTable diff --git a/agent_based/cisco_eigrp_peers.py b/agent_based/cisco_eigrp_peers.py index 4183fb412389a5e6c57809716790ae623d96e210..fb573075988ceef8a4b10cb4d5e50a69dfe34d51 100644 --- a/agent_based/cisco_eigrp_peers.py +++ b/agent_based/cisco_eigrp_peers.py @@ -16,7 +16,9 @@ # 2019-10-15: added initial support for IPv6, code cleanup (parser function) # 2019-10-16: added VRF support, fixed ipv4 address rendering # 2021-08-02: rewritten for CMK 2.0 +# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/... # + # ToDo: state_peer_not_found, alias, min_uptime_levels in WATO # # snmpwalk sample @@ -62,19 +64,19 @@ # sample info # [ # [ -# [u'65536.10.0', u'1', u'\n\xa7\xdd7', u'10', u'2', u'01:05:34', u'1', u'100', u'0', u'147', u'23.0/2.0', u'0', u'0'] +# ['65536.10.0', '1', '\n\xa7\xdd7', '10', '2', '01:05:34', '1', '100', '0', '147', '23.0/2.0', '0', '0'] # ], # [ -# [u'1', u'FastEthernet0', u'6'], -# [u'2', u'FastEthernet1', u'6'], -# [u'3', u'FastEthernet2', u'6'], -# [u'4', u'FastEthernet3', u'6'], -# [u'5', u'FastEthernet4', u'6'], -# [u'6', u'VoIP-Null0', u'1'], -# [u'7', u'Null0', u'1'], -# [u'8', u'Vlan1', u'53'], -# [u'9', u'Loopback0', u'24'], -# [u'10', u'Tunnel100', u'131'] +# ['1', 'FastEthernet0', '6'], +# ['2', 'FastEthernet1', '6'], +# ['3', 'FastEthernet2', '6'], +# ['4', 'FastEthernet3', '6'], +# ['5', 'FastEthernet4', '6'], +# ['6', 'VoIP-Null0', '1'], +# ['7', 'Null0', '1'], +# ['8', 'Vlan1', '53'], +# ['9', 'Loopback0', '24'], +# ['10', 'Tunnel100', '131'] # ] # ] # diff --git a/agent_based/cisco_eigrp_topology_table.py b/agent_based/cisco_eigrp_topology_table.py index 73211765ea8f90ad3512157d99d8aea34ec03024..d675c4b75ed1ad72f6893e1b866b1b73e2f3bb9a 100644 --- a/agent_based/cisco_eigrp_topology_table.py +++ b/agent_based/cisco_eigrp_topology_table.py @@ -12,7 +12,9 @@ # 2018-02-11: removed unnecessary OIDs # 2018-08-06: modified scan function # 2019-10-16: added initial IPv6 support, added parser function +# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/... # + # # snmpwalk sample # @@ -152,23 +154,22 @@ # # sample info # [ -# [u'65536.10.1.4.0.0.0.0.0', u'2', u'2', u'External', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd7', u'Tunnel100'], -# [u'65536.10.1.4.10.167.220.0.28', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd7', u'Tunnel100'], -# [u'65536.10.1.4.10.167.220.249.32', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd:', u'Tunnel100'], -# [u'65536.10.1.4.10.167.220.252.32', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd<', u'Tunnel100'], -# [u'65536.10.1.4.10.167.220.253.32', u'2', u'2', u'Connected', u'1', u'\x00\x00\x00\x00', u'1', u'\x00\x00\x00\x00', u'Loopback0'], -# [u'65536.10.1.4.10.167.220.255.32', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd7', u'Tunnel100'], -# [u'65536.10.1.4.10.167.221.0.24', u'2', u'2', u'Connected', u'1', u'\x00\x00\x00\x00', u'1', u'\x00\x00\x00\x00', u'Tunnel100'], -# [u'65536.10.1.4.192.168.57.0.24', u'2', u'2', u'Connected', u'1', u'\x00\x00\x00\x00', u'1', u'\x00\x00\x00\x00', u'Vlan1'], -# [u'65536.10.1.4.192.168.58.0.24', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd:', u'Tunnel100'], -# [u'65536.10.1.4.192.168.60.0.24', u'2', u'2', u'Internal', u'1', u'\n\xa7\xdd7', u'1', u'\n\xa7\xdd<', u'Tunnel100'] +# ['65536.10.1.4.0.0.0.0.0', '2', '2', 'External', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd7', 'Tunnel100'], +# ['65536.10.1.4.10.167.220.0.28', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd7', 'Tunnel100'], +# ['65536.10.1.4.10.167.220.249.32', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd:', 'Tunnel100'], +# ['65536.10.1.4.10.167.220.252.32', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd<', 'Tunnel100'], +# ['65536.10.1.4.10.167.220.253.32', '2', '2', 'Connected', '1', '\x00\x00\x00\x00', '1', '\x00\x00\x00\x00', 'Loopback0'], +# ['65536.10.1.4.10.167.220.255.32', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd7', 'Tunnel100'], +# ['65536.10.1.4.10.167.221.0.24', '2', '2', 'Connected', '1', '\x00\x00\x00\x00', '1', '\x00\x00\x00\x00', 'Tunnel100'], +# ['65536.10.1.4.192.168.57.0.24', '2', '2', 'Connected', '1', '\x00\x00\x00\x00', '1', '\x00\x00\x00\x00', 'Vlan1'], +# ['65536.10.1.4.192.168.58.0.24', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd:', 'Tunnel100'], +# ['65536.10.1.4.192.168.60.0.24', '2', '2', 'Internal', '1', '\n\xa7\xdd7', '1', '\n\xa7\xdd<', 'Tunnel100'] # ] # import re -from dataclasses import dataclass -from typing import Optional, List +from typing import List from cmk.base.plugins.agent_based.agent_based_api.v1 import ( register, diff --git a/cisco_eigrp-0.3.0-20230607.mkp b/cisco_eigrp-0.3.0-20230607.mkp new file mode 100644 index 0000000000000000000000000000000000000000..8d4ee446a86e32292281946bc1a3e2eb5d16bdd4 Binary files /dev/null and b/cisco_eigrp-0.3.0-20230607.mkp differ diff --git a/cisco_eigrp.mkp b/cisco_eigrp.mkp index 1bc7b5846fbb3f1832c4d6111adc7afd5698b8fb..8d4ee446a86e32292281946bc1a3e2eb5d16bdd4 100644 Binary files a/cisco_eigrp.mkp and b/cisco_eigrp.mkp differ diff --git a/gui/metrics/cisco_eigrp.py b/gui/metrics/cisco_eigrp.py new file mode 100644 index 0000000000000000000000000000000000000000..68155648dab3b73ff2292c6889511f19a7ed607a --- /dev/null +++ b/gui/metrics/cisco_eigrp.py @@ -0,0 +1,500 @@ +#!/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-26 +# +# Cisco EIGRP Peer metrics plugin +# +# missing a way to include hostname and service description +# + +from cmk.gui.i18n import _ + +from cmk.gui.plugins.metrics.utils import ( + metric_info, + graph_info, + perfometer_info, + unit_info, +) + +##################################################################################################################### +# +# define units for cisco_eigrp_* perfdata +# +##################################################################################################################### + + +unit_info['milliseconds'] = { + 'title': _('Milliseconds'), + 'symbol': 'ms', + 'render': lambda v: '%d' % v, + 'stepping': 'integer', # for vertical graph labels +} + +##################################################################################################################### +# +# define metrics for eigrp peer perfdata +# +##################################################################################################################### + +# define metrics for cisco_eigrp_peer perfdata + +metric_info['cisco_eigrp_peers_cEigrpUpTime'] = { + 'title': _('Peer uptime'), + 'unit': 's', + 'color': '26/a', +} +metric_info['cisco_eigrp_peers_cEigrpPktsEnqueued'] = { + 'title': _('Packets enqueued'), + 'unit': 'count', + 'color': '11/a', +} +metric_info['cisco_eigrp_peers_cEigrpRetrans'] = { + 'title': _('Retransmissions'), + 'unit': 'count', + 'color': '21/a', +} +metric_info['cisco_eigrp_peers_cEigrpRetries'] = { + 'title': _('Retries'), + 'unit': 'count', + 'color': '31/a', +} +metric_info['cisco_eigrp_peers_cEigrpSrtt'] = { + 'title': _('Smooth round trip time'), + 'unit': 'milliseconds', + 'color': '41/a', +} +metric_info['cisco_eigrp_peers_cEigrpRto'] = { + 'title': _('Retransmission timeout'), + 'unit': 'milliseconds', + 'color': '12/a', +} + +# define metrics for cisco_eigrp_interface perfdata + +metric_info['cisco_eigrp_interface_cEigrpPeerCount'] = { + 'title': _('Peer count'), + 'unit': 'count', + 'color': '26/a', +} +metric_info['cisco_eigrp_interface_cEigrpXmitReliableQ'] = { + 'title': _('Reliable queue length'), + 'unit': 'count', + 'color': '11/a', +} +metric_info['cisco_eigrp_interface_cEigrpXmitUnreliableQ'] = { + 'title': _('Unreliable queue length'), + 'unit': 'count', + 'color': '21/a', +} +metric_info['cisco_eigrp_interface_cEigrpMeanSrtt'] = { + 'title': _('Average smooth round trip time'), + 'unit': 'milliseconds', + 'color': '31/a', +} +metric_info['cisco_eigrp_interface_cEigrpPendingRoutes'] = { + 'title': _('Routing updates awaiting transmission'), + 'unit': 'count', + 'color': '41/a', +} +metric_info['cisco_eigrp_interface_cEigrpRMcasts'] = { + 'title': _('Reliable multicasts send'), + 'unit': 'count', + 'color': '12/a', +} +metric_info['cisco_eigrp_interface_cEigrpUMcasts'] = { + 'title': _('Unreliable multicasts send'), + 'unit': 'count', + 'color': '22/a', +} +metric_info['cisco_eigrp_interface_cEigrpUUcasts'] = { + 'title': _('Unreliable unicasts send'), + 'unit': 'count', + 'color': '32/a', +} +metric_info['cisco_eigrp_interface_cEigrpRUcasts'] = { + 'title': _('Reliable unicasts send'), + 'unit': 'count', + 'color': '42/a', +} +metric_info['cisco_eigrp_interface_cEigrpMcastExcepts'] = { + 'title': _('Multicast exceptions received'), + 'unit': 'count', + 'color': '25/a', +} +metric_info['cisco_eigrp_interface_cEigrpCRpkts'] = { + 'title': _('Conditional-Receive packets'), + 'unit': 'count', + 'color': '35/a', +} +metric_info['cisco_eigrp_interface_cEigrpAcksSuppressed'] = { + 'title': _('Suppressed acknowledgements'), + 'unit': 'count', + 'color': '45/a', +} +metric_info['cisco_eigrp_interface_cEigrpRetransSent'] = { + 'title': _('Retransmissions send'), + 'unit': 'count', + 'color': '16/a', +} +metric_info['cisco_eigrp_interface_cEigrpOOSrvcd'] = { + 'title': _('Out-of-sequence packets received'), + 'unit': 'count', + 'color': '26/b', +} + +# define metrics for cisco_eigrp_topology_table perfdata + +metric_info['cisco_eigrp_topology_table_routes'] = { + 'title': _('All routes'), + 'unit': 'count', + 'color': '26/a', +} +metric_info['cisco_eigrp_topology_table_activeroutes'] = { + 'title': _('Active routes'), + 'unit': 'count', + 'color': '11/a', +} +metric_info['cisco_eigrp_topology_table_siaroutes'] = { + 'title': _('Stuck in active (SIA) routes'), + 'unit': 'count', + 'color': '21/a', +} +metric_info['cisco_eigrp_topology_table_Connected'] = { + 'title': _('Connected'), + 'unit': 'count', + 'color': '31/a', +} +metric_info['cisco_eigrp_topology_table_Internal'] = { + 'title': _('Internal'), + 'unit': 'count', + 'color': '41/a', +} +metric_info['cisco_eigrp_topology_table_External'] = { + 'title': _('External'), + 'unit': 'count', + 'color': '12/a', +} +metric_info['cisco_eigrp_topology_table_Summary'] = { + 'title': _('Summary'), + 'unit': 'count', + 'color': '22/a', +} +metric_info['cisco_eigrp_topology_table_Static_redistributed'] = { + 'title': _('Static redistributed'), + 'unit': 'count', + 'color': '24/a', +} +metric_info['cisco_eigrp_topology_table_Inetaddress'] = { + 'title': _('Inet address'), + 'unit': 'count', + 'color': '15/a', +} + +# define metrics for cisco_eigrp_as_info perfdata + +metric_info['cisco_eigrp_as_info_cEigrpNbrCount'] = { + 'title': _('Neighbour count'), + 'unit': 'count', + 'color': '26/a', +} +metric_info['cisco_eigrp_as_info_cEigrpHellosSent'] = { + 'title': _('Hellos send'), + 'unit': '1/s', + 'color': '11/a', +} +metric_info['cisco_eigrp_as_info_cEigrpHellosRcvd'] = { + 'title': _('Hellos received'), + 'unit': '1/s', + 'color': '21/a', +} +metric_info['cisco_eigrp_as_info_cEigrpUpdatesSent'] = { + 'title': _('Updates send'), + 'unit': 'count', + 'color': '31/a', +} +metric_info['cisco_eigrp_as_info_cEigrpUpdatesRcvd'] = { + 'title': _('Updates received'), + 'unit': 'count', + 'color': '41/a', +} +metric_info['cisco_eigrp_as_info_cEigrpQueriesSent'] = { + 'title': _('Alternate route queries send'), + 'unit': 'count', + 'color': '12/a', +} +metric_info['cisco_eigrp_as_info_cEigrpQueriesRcvd'] = { + 'title': _('Alternate route queries received'), + 'unit': 'count', + 'color': '22/a', +} +metric_info['cisco_eigrp_as_info_cEigrpRepliesSent'] = { + 'title': _('Reply packets send'), + 'unit': 'count', + 'color': '32/a', +} +metric_info['cisco_eigrp_as_info_cEigrpRepliesRcvd'] = { + 'title': _('Reply packets received'), + 'unit': 'count', + 'color': '42/a', +} +metric_info['cisco_eigrp_as_info_cEigrpAcksSent'] = { + 'title': _('Acknowledgements send'), + 'unit': 'count', + 'color': '13/a', +} +metric_info['cisco_eigrp_as_info_cEigrpAcksRcvd'] = { + 'title': _('Acknowledgements received'), + 'unit': 'count', + 'color': '23/a', +} +metric_info['cisco_eigrp_as_info_cEigrpInputQHighMark'] = { + 'title': _('Highest number of packets in the input queue'), + 'unit': 'count', + 'color': '33/a', +} +metric_info['cisco_eigrp_as_info_cEigrpInputQDrops'] = { + 'title': _('Packets dropped from the input queue'), + 'unit': 'count', + 'color': '43/a', +} +metric_info['cisco_eigrp_as_info_cEigrpSiaQueriesSent'] = { + 'title': _('Stuck in active (SIA) queries sent'), + 'unit': 'count', + 'color': '14/a', +} +metric_info['cisco_eigrp_as_info_cEigrpSiaQueriesRcvd'] = { + 'title': _('Stuck in active (SIA) queries received'), + 'unit': 'count', + 'color': '24/a', +} +metric_info['cisco_eigrp_as_info_cEigrpTopoRoutes'] = { + 'title': _('Routes in the topology table'), + 'unit': 'count', + 'color': '34/a', +} +metric_info['cisco_eigrp_as_info_cEigrpXmitPendReplies'] = { + 'title': _('Outstanding replies expected to queries send'), + 'unit': 'count', + 'color': '44/a', +} + +###################################################################################################################### +# +# how to graph perdata for ciso_eigrp +# +###################################################################################################################### + +# graphs for cisco_eigrp_peer + +graph_info['cisco_eigrp_peer_uptime'] = { + 'title': _('Uptime'), + 'metrics': [ + ('cisco_eigrp_peers_cEigrpUpTime', 'area'), + ], +} + +graph_info['cisco_eigrp_peer_enqued'] = { + 'title': _('Packets enqueued'), + 'metrics': [ + ('cisco_eigrp_peers_cEigrpPktsEnqueued', 'line'), + ], +} + +graph_info['cisco_eigrp_peer_retransmission'] = { + 'title': _('Smooth round trip time / retransmission timeout'), + 'metrics': [ + ('cisco_eigrp_peers_cEigrpSrtt', 'line'), + ('cisco_eigrp_peers_cEigrpRto', 'line'), + ], +} +graph_info['cisco_eigrp_peer_error'] = { + 'title': _('Retransmissions / Retries'), + 'metrics': [ + ('cisco_eigrp_peers_cEigrpRetrans', 'line'), + ('cisco_eigrp_peers_cEigrpRetries', 'line'), + ], +} + +# graphs for cisco_eigrp_as_info + +graph_info['cisco_eigrp_as_info_neighbour_count'] = { + 'title': _('Neighbour count'), + 'metrics': [ + ('cisco_eigrp_as_info_cEigrpNbrCount', 'line'), + ], +} + +graph_info['cisco_eigrp_as_info_route_count'] = { + 'title': _('Routes in the topology table'), + 'metrics': [ + ('cisco_eigrp_as_info_cEigrpTopoRoutes', 'line'), + ], +} + +graph_info['cisco_eigrp_as_info_hellos'] = { + 'title': _('Hellos send/received'), + 'metrics': [ + ('cisco_eigrp_as_info_cEigrpHellosSent', 'line'), + ('cisco_eigrp_as_info_cEigrpHellosRcvd', '-line'), + ], +} + +graph_info['cisco_eigrp_as_info_packets'] = { + 'title': _('Packets send/received'), + 'metrics': [ + ('cisco_eigrp_as_info_cEigrpQueriesSent', 'line'), + ('cisco_eigrp_as_info_cEigrpUpdatesSent', 'line'), + ('cisco_eigrp_as_info_cEigrpRepliesSent', 'line'), + ('cisco_eigrp_as_info_cEigrpAcksSent', 'line'), + ('cisco_eigrp_as_info_cEigrpSiaQueriesSent', 'line'), + ('cisco_eigrp_as_info_cEigrpQueriesRcvd', '-line'), + ('cisco_eigrp_as_info_cEigrpUpdatesRcvd', '-line'), + ('cisco_eigrp_as_info_cEigrpRepliesRcvd', '-line'), + ('cisco_eigrp_as_info_cEigrpAcksRcvd', '-line'), + ('cisco_eigrp_as_info_cEigrpSiaQueriesRcvd', '-line'), + ], +} + +graph_info['cisco_eigrp_as_info_drops'] = { + 'title': _('Input queue drops / Queue hi mark'), + 'metrics': [ + ('cisco_eigrp_as_info_cEigrpInputQDrops', 'line'), + ('cisco_eigrp_as_info_cEigrpInputQHighMark', 'line'), + ], +} + +# graphs for cisco_eigrp_interface + +graph_info['cisco_eigrp_interface_peer_count'] = { + 'title': _('Peer count'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpPeerCount', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_queue_length'] = { + 'title': _('Queue length'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpXmitReliableQ', 'line'), + ('cisco_eigrp_interface_cEigrpXmitUnreliableQ', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_multicasts'] = { + 'title': _('Multicasts send'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpRMcasts', 'line'), + ('cisco_eigrp_interface_cEigrpUMcasts', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_unicasts'] = { + 'title': _('Unicasts send'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpUUcasts', 'line'), + ('cisco_eigrp_interface_cEigrpRUcasts', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_pendinf_routes'] = { + 'title': _('Pending Routes'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpPendingRoutes', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_packets'] = { + 'title': _('Various packets'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpMcastExcepts', 'line'), + ('cisco_eigrp_interface_cEigrpCRpkts', 'line'), + ('cisco_eigrp_interface_cEigrpRetransSent', 'line'), + ('cisco_eigrp_interface_cEigrpOOSrvcd', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_rtt'] = { + 'title': _('Average smooth round trip time'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpMeanSrtt', 'line'), + ], +} + +graph_info['cisco_eigrp_interface_ack_suppressed'] = { + 'title': _('Suppressed acknowledgements'), + 'metrics': [ + ('cisco_eigrp_interface_cEigrpAcksSuppressed', 'line'), + ], +} + +# define metrics for cisco_eigrp_topology_table perfdata + +graph_info['cisco_eigrp_topology_table_routes'] = { + 'title': _('Routes by origin type'), + 'metrics': [ + ('cisco_eigrp_topology_table_Inetaddress', 'line'), + ('cisco_eigrp_topology_table_Static_redistributed', 'line'), + ('cisco_eigrp_topology_table_Summary', 'line'), + ('cisco_eigrp_topology_table_External', 'line'), + ('cisco_eigrp_topology_table_Internal', 'line'), + ('cisco_eigrp_topology_table_Connected', 'line'), + ('cisco_eigrp_topology_table_routes', 'line'), + ], + 'optional_metrics': [ + 'cisco_eigrp_topology_table_Inetaddress', + 'cisco_eigrp_topology_table_Static_redistributed', + 'cisco_eigrp_topology_table_Summary', + 'cisco_eigrp_topology_table_External', + 'cisco_eigrp_topology_table_Internal', + 'cisco_eigrp_topology_table_Connected', + ] + # 'range': (0, 'cisco_eigrp_topology_table_routes:max') +} + +graph_info['cisco_eigrp_topology_table_active_sia'] = { + 'title': _('Stuck in active (SIA) / active routes'), + 'metrics': [ + ('cisco_eigrp_topology_table_siaroutes', 'line'), + ('cisco_eigrp_topology_table_activeroutes', 'line'), + ], +} + +###################################################################################################################### +# +# define perf-o-meter for cisco_eigrp +# +###################################################################################################################### + +# cisco_eigrp_peers peer uptime +perfometer_info.append({ + 'type': 'logarithmic', + 'metric': 'cisco_eigrp_peers_cEigrpUpTime', + 'half_value': 2592000.0, + 'exponent': 2, +}) + +# cisco_eigrp_interface send packets +perfometer_info.append({ + 'type': 'linear', + 'segments': ['cisco_eigrp_interface_cEigrpPeerCount'], + 'total': 50, +}) + +# cisco_eigrp_topology_table +perfometer_info.append({ + 'type': 'linear', + 'segments': ['cisco_eigrp_topology_table_routes'], + 'total': 1000, +}) + +# cisco_eigrp_as_info +perfometer_info.append({ + 'type': 'linear', + 'segments': ['cisco_eigrp_as_info_cEigrpNbrCount'], + 'total': 30, +}) diff --git a/gui/wato/cisco_eigrp_interface.py b/gui/wato/cisco_eigrp_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..d5bff84cdd1ba9c285b50312e43b2e312d597381 --- /dev/null +++ b/gui/wato/cisco_eigrp_interface.py @@ -0,0 +1,76 @@ +#!/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-27 +# +# Check_MK cisco_eigrp_peer WATO plugin +# +from cmk.gui.i18n import _ +from cmk.gui.valuespec import ( + Dictionary, + TextAscii, + MonitoringState, + ListChoice, +) + +from cmk.gui.plugins.wato.utils import ( + CheckParameterRulespecWithItem, + rulespec_registry, + RulespecGroupCheckParametersNetworking, +) + +_ignore_interfaces_auth = [ + (6, 'Ethernet CSMAD'), + (24, 'Loopback'), + (53, 'Proprietary Virtual (Cisco VLAN L3)'), + (131, 'Tunnel'), + (135, 'Layer 2 VLAN',), + (136, 'Layer 3 IP VLAN'), +] + + +def _parameter_valuespec_cisco_eigrp_interface(): + return Dictionary( + help=_(''), + elements=[ + ('ignore_interfaces_auth', + ListChoice( + title=_('no warning if EIRGP authentication not configured on selected interface types'), + help=_('no warning if EIRGP authentication not configured on selected interface types'), + choices=_ignore_interfaces_auth, + default_value=[], + )), + ('no_auth_state', + MonitoringState( + title=_('State to report when interface has no authentication configured'), + help=_( + 'State if an EIGRP enabled interface has no authentication configured. Default is critical'), + default_value=2, + ), + ), + + ('md5_auth_state', + MonitoringState( + title=_('State to report when interface uses MD5 authentication'), + help=_('State if an EIGRP enabled interface uses an MD5 hash as authentication method. ' + 'Default is warning'), + default_value=1, + ), + ), + ], + ) + + +rulespec_registry.register( + CheckParameterRulespecWithItem( + check_group_name='cisco_eigrp_interface', + group=RulespecGroupCheckParametersNetworking, + item_spec=lambda: TextAscii(title=_('Cisco EIGRP interface'), ), + match_type='dict', + parameter_valuespec=_parameter_valuespec_cisco_eigrp_interface, + title=lambda: _('Cisco EIGRP interface'), + )) diff --git a/gui/wato/cisco_eigrp_peers.py b/gui/wato/cisco_eigrp_peers.py new file mode 100644 index 0000000000000000000000000000000000000000..00b6566b7f1e90009f8c582b6e81477804296395 --- /dev/null +++ b/gui/wato/cisco_eigrp_peers.py @@ -0,0 +1,63 @@ +#!/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_eigrp_peer WATO plugin +# +from cmk.gui.i18n import _ +from cmk.gui.valuespec import ( + Dictionary, + Integer, + TextAscii, + Tuple, +) + +from cmk.gui.plugins.wato.utils import ( + CheckParameterRulespecWithItem, + rulespec_registry, + RulespecGroupCheckParametersNetworking, +) + + +def _parameter_valuespec_cisco_eigrp_peers(): + return Dictionary( + help=_(''), + elements=[ + ('minuptime', + Tuple( + title=_('Minimum uptime for peer. Default is 1/2 hours.'), + help=_('Set the time in seconds, a peer must be up before the peer is considered stable.' + 'If the peer uptime less then X, the check outcome is set to warning/critical.'), + elements=[ + Integer( + title=_('Warning below'), + unit='seconds', + default_value=7200, + help=_('The uptime in seconds below which a warning state is triggered. Default is 7200s'), + ), + Integer( + title=_('Critical below'), + unit='seconds', + default_value=3600, + help=_('The uptime in seconds below which a critical state is triggered. default is 3600s'), + ) + ], + )), + ], + ) + + +rulespec_registry.register( + CheckParameterRulespecWithItem( + check_group_name='cisco_eigrp_peers', + group=RulespecGroupCheckParametersNetworking, + item_spec=lambda: TextAscii(title=_('Cisco EIGRP peer'), ), + match_type='dict', + parameter_valuespec=_parameter_valuespec_cisco_eigrp_peers, + title=lambda: _('Cisco EIGRP peer'), + )) diff --git a/gui/wato/cisco_eigrp_topology_table.py b/gui/wato/cisco_eigrp_topology_table.py new file mode 100644 index 0000000000000000000000000000000000000000..4cad6e851d468ec4ed13af7207c01ffcfbb7ac07 --- /dev/null +++ b/gui/wato/cisco_eigrp_topology_table.py @@ -0,0 +1,54 @@ +#!/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-27 +# +# +# Check_MK cisco_eigrp_topology_table WATO plugin +# +from cmk.gui.i18n import _ +from cmk.gui.valuespec import ( + Dictionary, + ListChoice, + TextAscii, +) + +from cmk.gui.plugins.wato.utils import ( + CheckParameterRulespecWithItem, + rulespec_registry, + RulespecGroupCheckParametersNetworking, +) + +_nowarnon = [('siaroutes', 'Stuck in active (SIA) routes'), + ('activeroutes', 'Active routes')] + + +def _parameter_valuespec_cisco_eigrp_topology_table(): + return Dictionary( + help=_(''), + elements=[ + ('nowarnon', + ListChoice( + title=_('no warning if EIRGP SIA/active route found'), + help=_('no warning if EIRGP Stuck in active (SIA) / active route found'), + choices=_nowarnon, + default_value=[], + ), + ) + ], + ) + + +rulespec_registry.register( + CheckParameterRulespecWithItem( + check_group_name='cisco_eigrp_topology_table', + group=RulespecGroupCheckParametersNetworking, + item_spec=lambda: TextAscii(title=_('Cisco EIGRP topology table'), ), + match_type='dict', + parameter_valuespec=_parameter_valuespec_cisco_eigrp_topology_table, + title=lambda: _('Cisco EIGRP topology table'), + )) diff --git a/packages/cisco_eigrp b/packages/cisco_eigrp index 2439a4c8646e5b915e3c53db7d65e58e09221fea..912a9d0735d09223e9695fb6e368297fa6a78e0e 100644 --- a/packages/cisco_eigrp +++ b/packages/cisco_eigrp @@ -13,14 +13,13 @@ 'cisco_eigrp_interface.py', 'cisco_eigrp_peers.py', 'cisco_eigrp_topology_table.py'], - 'web': ['plugins/wato/cisco_eigrp_peers.py', - 'plugins/wato/cisco_eigrp_interface.py', - 'plugins/wato/cisco_eigrp_topology_table.py', - 'plugins/metrics/cisco_eigrp.py']}, + 'gui': ['metrics/cisco_eigrp.py', + 'wato/cisco_eigrp_interface.py', + 'wato/cisco_eigrp_peers.py', + 'wato/cisco_eigrp_topology_table.py']}, 'name': 'cisco_eigrp', - 'num_files': 8, 'title': 'Cisco EIGRP checks', - 'version': '20210803.v.0.3', - 'version.min_required': '2.0.0', - 'version.packaged': '2021.09.20', + 'version': '0.3.0-20230607', + 'version.min_required': '2.1.0b1', + 'version.packaged': '2.1.0p21', 'version.usable_until': None} \ No newline at end of file