From 265a79f30f91b4be3a26bd53bd5892456a631f0a Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:28:18 -0700 Subject: [PATCH] Add back publish events (#20306) ### Why I did it https://github.com/sonic-net/sonic-buildimage/pull/19179 removed call to publish_events when memory usage container exceeds threshold, causing test_events to fail. ### How I did it Add back call to publish_events #### How to verify it Manual test --- files/image_config/monit/memory_checker | 1 + 1 file changed, 1 insertion(+) diff --git a/files/image_config/monit/memory_checker b/files/image_config/monit/memory_checker index 74779ffb3abc..6ea00cbc5e35 100755 --- a/files/image_config/monit/memory_checker +++ b/files/image_config/monit/memory_checker @@ -219,6 +219,7 @@ def check_memory_usage(container_name, threshold_value): if total_memory_usage > threshold_value: print("[{}]: Memory usage ({} Bytes) is larger than the threshold ({} Bytes)!" .format(container_name, total_memory_usage, threshold_value)) + publish_events(container_name, "{:.2f}".format(total_memory_usage), str(threshold_value)) sys.exit(EXCEED_THRESHOLD) def is_service_active(service_name):