Skip to content

Commit

Permalink
work in progress. Unsure of corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
nforsg committed Aug 7, 2023
1 parent e7803c6 commit 7fe54ba
Showing 1 changed file with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def start_monitoring_threads(self) -> None:
"""
self.aggregated_host_metrics_thread = AggregatedHostMetricsThread(
host_metrics=self.aggregated_host_metrics,
sleep_time=self.kafka_config.time_step_len_seconds,
sleep_time=self.kafka_config.time_step_len_seconds if self.kafka_config is not None else -1,
machines=self.machines
)
self.docker_stats_consumer_thread = DockerStatsConsumerThread(
Expand Down Expand Up @@ -137,14 +137,22 @@ def start_monitoring_threads(self) -> None:
kafka_port=self.kafka_config.kafka_port_external,
defender_actions=self.defender_actions
)
self.aggregated_host_metrics_thread.start()
self.docker_stats_consumer_thread.start()
self.client_population_consumer_thread.start()
self.aggregated_snort_ids_log_consumer_thread.start()
self.aggregated_snort_ids_rule_log_consumer_thread.start()
self.aggregated_ossec_ids_log_consumer_thread.start()
self.attacker_actions_consumer_thread.start()
self.defender_actions_consumer_thread.start()
if self.aggregated_host_metrics is not None:
self.aggregated_host_metrics.start()
if self.docker_stats_consumer_thread is not None:
self.docker_stats_consumer_thread.start()
if self.client_population_consumer_thread is not None:
self.client_population_consumer_thread.start()
if self.aggregated_snort_ids_log_consumer_thread is not None:
self.aggregated_snort_ids_log_consumer_thread.start()
if self.aggregated_snort_ids_rule_log_consumer_thread is not None:
self.aggregated_snort_ids_rule_log_consumer_thread.start()
if self.aggregated_ossec_ids_log_consumer_thread is not None:
self.aggregated_ossec_ids_log_consumer_thread.start()
if self.attacker_actions_consumer_thread is not None:
self.attacker_actions_consumer_thread.start()
if self.defender_actions_consumer_thread is not None:
self.defender_actions_consumer_thread.start()
for m in self.machines:
m.start_monitor_threads()

Expand Down Expand Up @@ -253,12 +261,18 @@ def reset_metric_lists(self) -> None:
:return: None
"""
self.aggregated_snort_ids_log_consumer_thread.snort_ids_alert_counters_list = []
self.aggregated_snort_ids_rule_log_consumer_thread.snort_ids_rule_counters_list = []
self.aggregated_ossec_ids_log_consumer_thread.ossec_ids_alert_counters_list = []
self.docker_stats_consumer_thread.docker_stats_list = []
self.client_population_consumer_thread.client_population_metrics_list = []
self.aggregated_host_metrics_thread.host_metrics_list = []
if self.aggregated_snort_ids_log_consumer_thread is not None:
self.aggregated_snort_ids_log_consumer_thread.snort_ids_alert_counters_list = []
if self.aggregated_snort_ids_rule_log_consumer_thread is not None:
self.aggregated_snort_ids_rule_log_consumer_thread.snort_ids_rule_counters_list = []
if self.aggregated_ossec_ids_log_consumer_thread is not None:
self.aggregated_ossec_ids_log_consumer_thread.ossec_ids_alert_counters_list = []
if self.docker_stats_consumer_thread is not None:
self.docker_stats_consumer_thread.docker_stats_list = []
if self.client_population_consumer_thread is not None:
self.client_population_consumer_thread.client_population_metrics_list = []
if self.aggregated_host_metrics_thread is not None:
self.aggregated_host_metrics_thread.host_metrics_list = []

def average_metric_lists(self):
"""
Expand Down

0 comments on commit 7fe54ba

Please sign in to comment.