diff --git a/Changelog.md b/Changelog.md index eaaa81f543aa7f4e15584cb10a873974603204ab..3d762455daee6ef5b6774d28039cdbcf2537a420 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,14 @@ # Changelog All notable changes to this project will be documented in this file. + +## [0.12] - 2025-01-13 +- POL1-876: Add additional Nokia error counters to influx and error report + +## [0.11] - 2024-05-27 +- POL1-826: reintroduce snmp check for ipv6 counters on juniper ae subinterfaces +- get-interface-stats: error code 1 for warning, 2 for error + ## [0.10] - 2024-05-07 - Poll netconf only once for both brian and error counters diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..ff5ccdd0a35056ce613efae39482dd4e49414c5d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,12 @@ +// https://gitlab.geant.net/live-projects/jenkins-pipeline/-/tree/master/vars +library 'SWDPipeline' + +// Parameters: +// project_name (must match the name of the project in GitLab/SWD release jenkins) +// extra_recipients (optional, list of email addresses to always receive notifications, in addition to the default in jenkins) +// python_test_versions (list of python versions, resolving to docker tags, to test against) +String name = 'brian-polling-manager' +List<String> extraRecipients = ['bjarke@nordu.net', 'erik.reid@geant.org'] +List<String> pythonTestVersions = ['3.11'] + +SimplePythonBuild(name, extraRecipients, pythonTestVersions) diff --git a/brian_polling_manager/error_report/cli.py b/brian_polling_manager/error_report/cli.py index eb3f1c775a5eb0aaadc5443d442d8d56e667d4f4..73cea102eae25d08fc807830ebe09da5bee9b4c1 100644 --- a/brian_polling_manager/error_report/cli.py +++ b/brian_polling_manager/error_report/cli.py @@ -21,7 +21,9 @@ errors are checked: * ``input-drops`` (Juniper) * ``output-discards`` (Nokia) * ``output-drops`` (Juniper) - * ``output-total-errors`` (Nokia) + * ``oper-state-change-count`` (Nokia) + * ``crc-align-errors`` (Nokia) + * ``fcs errors`` (Nokia) For every interface with new errors is added to a summary report. This report is then sent to the OC. @@ -76,6 +78,9 @@ ERROR_FIELDS = { "last_output_discards": "output-discards", "last_output_drops": "output-drops", "last_output_total_errors": "output-total-errors", + "last_oper_state_change_count": "oper-state-change-count", + "last_crc_align_errors": "crc-align-errors", + "last_fcs_errors": "fcs-errors", } INFLUX_TIME_WINDOW_TODAY = "time > now() - 1d" @@ -97,6 +102,9 @@ PROCESSED_ERROR_COUNTERS_SCHEMA = { "output-discards": {"type": "integer"}, "output-drops": {"type": "integer"}, "output-total-errors": {"type": "integer"}, + "oper-state-change-count": {"type": "integer"}, + "crc-align-errors": {"type": "integer"}, + "fcs-errors": {"type": "integer"}, }, "additionalProperties": False, }, diff --git a/brian_polling_manager/interface_stats/vendors/common.py b/brian_polling_manager/interface_stats/vendors/common.py index 6ee44e4f6aabf4bc87a5e7cf72a6334180638ba2..79ed6dec8987d05d6c1e9ec14d4bca79677eb86d 100644 --- a/brian_polling_manager/interface_stats/vendors/common.py +++ b/brian_polling_manager/interface_stats/vendors/common.py @@ -56,6 +56,9 @@ ERROR_POINT_FIELDS_SCHEMA = { "output_fifo_errors": {"type": "integer"}, "output_resource_errors": {"type": "integer"}, "output_total_errors": {"type": "integer"}, + "oper_state_change_count": {"type": "integer"}, + "crc_align_errors": {"type": "integer"}, + "fcs_errors": {"type": "integer"}, }, "additionalProperties": False, } diff --git a/brian_polling_manager/interface_stats/vendors/nokia.py b/brian_polling_manager/interface_stats/vendors/nokia.py index 9d54bbd93258c739768ca962fc72cc03c357abe7..0dbe6f9e7f559793a63cf53b8255d3d2b7d8e39b 100644 --- a/brian_polling_manager/interface_stats/vendors/nokia.py +++ b/brian_polling_manager/interface_stats/vendors/nokia.py @@ -44,6 +44,9 @@ INTERFACE_COUNTERS = { "input_total_errors": {"path": "./statistics/in-errors"}, "input_discards": {"path": "./statistics/in-discards"}, "output_discards": {"path": "./statistics/out-discards"}, + "crc_align_errors": {"path": "./ethernet/statistics/crc-align-errors"}, + "fcs_errors": {"path": "./ethernet/statistics/ethernet-like-medium/error/fcs"}, + "oper_state_change_count": {"path": "./ethernet/oper-state-change-count"}, }, } diff --git a/setup.py b/setup.py index 3326323a7b2195de287ab00393b27b357535e7b3..48f7deb65a93831bc213caa04d7950495022f783 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='brian-polling-manager', - version="0.11", + version="0.12", author='GEANT', author_email='swd@geant.org', description='service for managing BRIAN polling checks', diff --git a/test/error_report/test_error_report.py b/test/error_report/test_error_report.py index b1d286283142f3ab693f62dd056409d0311d0399..6ada1829bf00ce2467763c7c597121eda47c5174 100644 --- a/test/error_report/test_error_report.py +++ b/test/error_report/test_error_report.py @@ -103,7 +103,8 @@ def create_error_point(mock_influx_client): :param kwargs: one or more error fields with integer value: ``input_framing_errors``, ``bit_error_seconds``,``errored_blocks_seconds``, ``input_crc_errors``, ``input_total_errors``,``input_discards``,``input_drops``, - ``output_drops`` + ``output_drops``, ``oper_state_change_count`` ,``crc_align_errors``, + ``fcs_errors`` The created error points will be returned by ``mock_influx_client`` fixture """ @@ -241,6 +242,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro input_discards=6, input_drops=7, output_drops=8, + oper_state_change_count=9, + crc_align_errors=10, + fcs_errors=11, ) errors = get_interface_errors() assert errors == { @@ -258,6 +262,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro "input-discards": 6, "input-drops": 7, "output-drops": 8, + "oper-state-change-count": 9, + "crc-align-errors": 10, + "fcs-errors": 11, }, "diff": { "framing-errors": 1, @@ -268,6 +275,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro "input-discards": 6, "input-drops": 7, "output-drops": 8, + "oper-state-change-count": 9, + "crc-align-errors": 10, + "fcs-errors": 11, }, "errors_yesterday": DEFAULT_ERRORS_YESTERDAY, } diff --git a/test/interface_stats/test_nokia.py b/test/interface_stats/test_nokia.py index 28e3dc4fe333215e47fc91506e2986626f17388b..e29b97fbdf14621d5e7de87e7b56971f91db06a3 100644 --- a/test/interface_stats/test_nokia.py +++ b/test/interface_stats/test_nokia.py @@ -34,11 +34,44 @@ NOKIA_PORT_XML = """\ <out-errors>7</out-errors> <out-discards>8</out-discards> </statistics> + <ethernet> + <oper-state-change-count>20</oper-state-change-count> + <statistics> + <crc-align-errors>21</crc-align-errors> + <ethernet-like-medium> + <error> + <fcs>22</fcs> + </error> + </ethernet-like-medium> + </statistics> + </ethernet> </port> </state> </data> </rpc-reply>""" +NOKIA_LAG_XML = """\ +<rpc-reply> + <data> + <state> + <lag> + <lag-name>lag-1</lag-name> + <oper-state>up</oper-state> + <statistics> + <in-octets>1</in-octets> + <in-packets>2</in-packets> + <out-octets>3</out-octets> + <out-packets>4</out-packets> + <in-errors>5</in-errors> + <in-discards>6</in-discards> + <out-errors>7</out-errors> + <out-discards>8</out-discards> + </statistics> + </lag> + </state> + </data> +</rpc-reply>""" + NOKIA_ROUTER_INTERFACE_XML = """ <rpc-reply> <data> @@ -71,33 +104,10 @@ NOKIA_ROUTER_INTERFACE_XML = """ """ -@pytest.fixture -def nokia_port_doc_containing_every_field(): - return etree.fromstring(NOKIA_PORT_XML) - - -@pytest.fixture -def nokia_lag_doc_containing_every_field(): - return etree.fromstring( - NOKIA_PORT_XML.replace("port>", "lag>").replace( - "<port-id>1/1/c1</port-id>", "<lag-name>lag-1</lag-name>" - ) - ) - - -@pytest.fixture -def nokia_router_interface_doc_containing_every_field(): - return etree.fromstring(NOKIA_ROUTER_INTERFACE_XML) - - def nokia_docs_containing_every_field(): return { "port": etree.fromstring(NOKIA_PORT_XML), - "lag": etree.fromstring( - NOKIA_PORT_XML.replace("port>", "lag>").replace( - "<port-id>1/1/c1</port-id>", "<lag-name>lag-1</lag-name>" - ) - ), + "lag": etree.fromstring(NOKIA_LAG_XML), "router-interface": etree.fromstring(NOKIA_ROUTER_INTERFACE_XML), } @@ -121,6 +131,9 @@ def test_nokia_counters(): "input_discards": 6, "output_total_errors": 7, "output_discards": 8, + "oper_state_change_count": 20, + "crc_align_errors": 21, + "fcs_errors": 22, }, }, { diff --git a/tox.ini b/tox.ini index a0c8412c0f808e4c1744b4a40c2b9cee8e33e762..9646bc5e661f32194ba6b0301cf25ebcd2300809 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36 +envlist = py310 [flake8] max-line-length = 120