diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py index 2abd9269..920e0205 100755 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py @@ -374,20 +374,31 @@ def create_analyzer(parsed_args, full_extracted_logs_list, pdf = PDFCreator(pdf_path, pdf_header, png_images, text_to_show_in_pdf) # Adding telemetry stats to the PDF dataframes_for_pdf = [] - fabric_info = ibdiagnet_analyzer.get_fabric_size() if ibdiagnet_analyzer else "No Fabric Info found" + fabric_info = ibdiagnet_analyzer.get_fabric_size() \ + if ibdiagnet_analyzer else "No Fabric Info found" dataframes_for_pdf.append(("Fabric info", fabric_info)) if links_flapping_analyzer: - dataframes_for_pdf.append(("Link Flapping past week", links_flapping_analyzer.get_link_flapping_last_week())) + dataframes_for_pdf.append(("Link Flapping past week", + links_flapping_analyzer.get_link_flapping_last_week())) lists_to_add = [] critical_events_headers = ["timestamp", "event_type", "event", "count"] - lists_to_add.append((event_log_analyzer.get_critical_event_bursts(), "More than 5 events burst over a minute", critical_events_headers)) + lists_to_add.append((event_log_analyzer.get_critical_event_bursts(), + "More than 5 events burst over a minute", + critical_events_headers)) for cur_telemetry in \ [ibdianget_2_ports_primary_analyzer, ibdianget_2_ports_secondary_analyzer]: - dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} Telemetry iteration time", cur_telemetry.get_last_iterations_time_stats())) - dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} Telemetry iteration first and last timestamps", cur_telemetry.get_first_last_iteration_timestamp())) - dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} Telemetry fabric size", cur_telemetry.get_number_of_switches_and_ports())) - lists_to_add.append(([cur_telemetry.get_number_of_core_dumps()], f"{cur_telemetry.telemetry_type} number of core dumps found in the logs",["Amount"])) + dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} Telemetry iteration time", + cur_telemetry.get_last_iterations_time_stats())) + dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} " + "Telemetry iteration first and last timestamps", + cur_telemetry.get_first_last_iteration_timestamp())) + dataframes_for_pdf.append((f"{cur_telemetry.telemetry_type} Telemetry fabric size", + cur_telemetry.get_number_of_switches_and_ports())) + lists_to_add.append(([cur_telemetry.get_number_of_core_dumps()], + f"{cur_telemetry.telemetry_type} " + "number of core dumps found in the logs", + ["Amount"])) # PDF creator gets all the images and to add to the report diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/ibdiagnet2_port_counters_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/ibdiagnet2_port_counters_analyzer.py index 5ee0de4d..a59713de 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/ibdiagnet2_port_counters_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/ibdiagnet2_port_counters_analyzer.py @@ -10,7 +10,6 @@ # provided with the software product. # -import os from typing import List import warnings import pandas as pd @@ -113,7 +112,7 @@ def analyze_iteration_time(self, threshold=0.15): filtered_data = filtered_data[filtered_data['data'] >= threshold] filtered_data['timestamp'] = pd.to_datetime(filtered_data['timestamp'], errors='coerce') filtered_data = filtered_data.dropna(subset=['timestamp']) - + filtered_data = filtered_data.sort_values(by='timestamp').reset_index(drop=True) if not filtered_data['data'].empty: diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/pdf_creator.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/pdf_creator.py index 087bbcf9..71b9025e 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/pdf_creator.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/pdf_creator.py @@ -130,5 +130,5 @@ def create_pdf(self, data_frames_with_titles, lists_to_add): # Output the final PDF # Add text section self.add_text() - + self.output(self._pdf_path)