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/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,
},
},
{