From b1be99c3e7a5712dae0bcbdc59dcc3193d59404b Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Fri, 9 Sep 2022 19:10:57 +0000 Subject: [PATCH 1/9] Add conf to host, move plugin to sbin --- dockers/docker-fpm-frr/Dockerfile.j2 | 6 +++--- files/build_templates/events_info.json | 7 +++++++ files/build_templates/host_regex.json | 0 files/build_templates/rsyslog_plugin.conf.j2 | 2 +- files/build_templates/sonic_debian_extension.j2 | 7 +++++++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 files/build_templates/events_info.json create mode 100644 files/build_templates/host_regex.json diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index 25e191bc338f..fd7ad0f08ed4 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -56,14 +56,14 @@ COPY ["TS", "/usr/bin/TS"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["zsocket.sh", "/usr/bin/"] COPY ["*.json", "/etc/rsyslog.d/"] -# COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] +COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] RUN chmod a+x /usr/bin/TSA && \ chmod a+x /usr/bin/TSB && \ chmod a+x /usr/bin/TSC && \ chmod a+x /usr/bin/zsocket.sh -# RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf -# RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2* +RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf +RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2* RUN rm -f /etc/rsyslog.d/events_info.json* ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/files/build_templates/events_info.json b/files/build_templates/events_info.json new file mode 100644 index 000000000000..97d9bd69dac5 --- /dev/null +++ b/files/build_templates/events_info.json @@ -0,0 +1,7 @@ +{ + "yang_module": "sonic-events-host", + "proclist": [ + "name": "host", + "parse_json": "host_regex.json" + ] +} diff --git a/files/build_templates/host_regex.json b/files/build_templates/host_regex.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/files/build_templates/rsyslog_plugin.conf.j2 b/files/build_templates/rsyslog_plugin.conf.j2 index ec19c62a78f6..948fbd50119e 100644 --- a/files/build_templates/rsyslog_plugin.conf.j2 +++ b/files/build_templates/rsyslog_plugin.conf.j2 @@ -12,7 +12,7 @@ $ModLoad omprog {% for proc in proclist %} if re_match($programname, "{{ proc.name }}") then { action(type="omprog" - binary="/usr/share/sonic/scripts/rsyslog_plugin -r /etc/rsyslog.d/{{ proc.parse_json }} -m {{ yang_module }}" + binary="/usr/sbin/rsyslog_plugin -r /etc/rsyslog.d/{{ proc.parse_json }} -m {{ yang_module }}" output="/var/log/rsyslog_plugin.log" template="prog_msg") } diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index c29d74e33fb0..7151a9de735a 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -323,6 +323,13 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-db-cli_*.deb || \ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +# Generate host conf for rsyslog_plugin +sudo cp $BUILD_TEMPLATES/events_info.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ +sudo cp $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $FILESYSTEM_ROOT_ETC/rsyslog.d/ +j2 -f json $FILESYSTEM_ROOT_ETC/rsyslog.d/rsyslog_plugin.conf.j2 $FILESYSTEM_ROOT_ETC/rsyslog.d/events_info.json > $FILESYSTEM_ROOT_ETC/rsyslog.d/host_events.conf +sudo rm -f $FILESYSTEM_ROOT_ETC/rsyslog.d/rsyslog_plugin.conf.j2 +sudo rm -f $FILESYSTEM_ROOT_ETC/rsyslog.d/events_info.json + # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f From ffd6f50f1d760575ac72f2ebe739fec439c2c983 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Fri, 9 Sep 2022 21:32:04 +0000 Subject: [PATCH 2/9] Add missing comma in dependencies --- src/sonic-eventd/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-eventd/debian/control b/src/sonic-eventd/debian/control index 9c6355e5d9d2..9ee3d9a563e9 100644 --- a/src/sonic-eventd/debian/control +++ b/src/sonic-eventd/debian/control @@ -2,7 +2,7 @@ Source: sonic-eventd Section: devel Priority: optional Maintainer: Renuka Manavalan -Build-Depends: debhelper (>= 12.0.0), libevent-dev, libboost-thread-dev, libboost-system-dev, libswsscommon-dev liblua5.1-0 +Build-Depends: debhelper (>= 12.0.0), libevent-dev, libboost-thread-dev, libboost-system-dev, libswsscommon-dev, liblua5.1-0 Standards-Version: 3.9.3 Homepage: https://github.com/Azure/sonic-buildimage XS-Go-Import-Path: github.com/Azure/sonic-buildimage From ab80c1bfe26e990d192ba5af0f7d455bd4ec885d Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Fri, 9 Sep 2022 21:35:47 +0000 Subject: [PATCH 3/9] Correct flag to -p --- src/sonic-eventd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-eventd/Makefile b/src/sonic-eventd/Makefile index 199f8a381023..f3f32d728e47 100644 --- a/src/sonic-eventd/Makefile +++ b/src/sonic-eventd/Makefile @@ -72,7 +72,7 @@ rsyslog-plugin-tests: $(RSYSLOG-PLUGIN-TEST_OBJS) install: $(MKDIR) -p $(DESTDIR)/usr/sbin - $(MKDIR) -P $(DESTDIR)/etc/monit/conf.d + $(MKDIR) -p $(DESTDIR)/etc/monit/conf.d $(CP) $(EVENTD_TARGET) $(DESTDIR)/usr/sbin $(CP) $(EVENTD_TOOL) $(DESTDIR)/usr/sbin $(CP) $(EVENTD_PUBLISH_TOOL) $(DESTDIR)/usr/sbin From 13d03a6b3c03cc799a11986cd8f4402993b80359 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Sat, 10 Sep 2022 00:41:47 +0000 Subject: [PATCH 4/9] Fix events_info and j2 --- files/build_templates/events_info.json | 6 ++++-- files/build_templates/sonic_debian_extension.j2 | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/files/build_templates/events_info.json b/files/build_templates/events_info.json index 97d9bd69dac5..8e7b76d185d7 100644 --- a/files/build_templates/events_info.json +++ b/files/build_templates/events_info.json @@ -1,7 +1,9 @@ { "yang_module": "sonic-events-host", "proclist": [ - "name": "host", - "parse_json": "host_regex.json" + { + "name": "host", + "parse_json": "host_regex.json" + } ] } diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 7151a9de735a..825f678622ba 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -324,11 +324,8 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f # Generate host conf for rsyslog_plugin -sudo cp $BUILD_TEMPLATES/events_info.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ -sudo cp $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $FILESYSTEM_ROOT_ETC/rsyslog.d/ -j2 -f json $FILESYSTEM_ROOT_ETC/rsyslog.d/rsyslog_plugin.conf.j2 $FILESYSTEM_ROOT_ETC/rsyslog.d/events_info.json > $FILESYSTEM_ROOT_ETC/rsyslog.d/host_events.conf -sudo rm -f $FILESYSTEM_ROOT_ETC/rsyslog.d/rsyslog_plugin.conf.j2 -sudo rm -f $FILESYSTEM_ROOT_ETC/rsyslog.d/events_info.json +j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $BUILD_TEMPLATES/host_events.conf +sudo mv $BUILD_TEMPLATES/host_events.conf $FILESYSTEM_ROOT_ETC/rsyslog.d/ # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ From 009f68cfce55c2ea4c3f976c324501ed055fd6c1 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Mon, 12 Sep 2022 19:03:33 +0000 Subject: [PATCH 5/9] Add host event --- files/build_templates/host_regex.json | 17 +++++++++++++++++ files/build_templates/sonic_debian_extension.j2 | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/files/build_templates/host_regex.json b/files/build_templates/host_regex.json index e69de29bb2d1..0ac27100fc83 100644 --- a/files/build_templates/host_regex.json +++ b/files/build_templates/host_regex.json @@ -0,0 +1,17 @@ +[ + { + "tag": "disk-usage", + "regex": ".([a-zA-Z0-9-_]*). space usage (\d+\.\d+)% matches resource limit .space usage.(\d+\.\d+)%.", + "params": [ "fs", "usage", "limit" ] + }, + { + "tag": "memory-usage", + "regex": "(?:mem|cpu user) usage of (\d+\.\d+)% matches resource limit .(?:mem|cpu user) usage>(\d+\.\d+)%.", + "params": [ "usage", "limit" ] + }, + { + "tag": "event-sshd", + "regex": "auth fail: ([a-zA-Z0-9-_\s]*).", + "params": [ "fail_type" ] + } +] diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 825f678622ba..64f92ff31537 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -324,8 +324,8 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f # Generate host conf for rsyslog_plugin -j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $BUILD_TEMPLATES/host_events.conf -sudo mv $BUILD_TEMPLATES/host_events.conf $FILESYSTEM_ROOT_ETC/rsyslog.d/ +j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $FILESYSTEM_ROOT_ETC/rsyslog.d/host_events.conf +sudo cp $BUILD_TEMPLATES/host_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ From 2dc07d35f67a405d5694f6c974db6dce693a4bec Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Mon, 12 Sep 2022 21:16:04 +0000 Subject: [PATCH 6/9] Revert back to creating and moving --- files/build_templates/sonic_debian_extension.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 64f92ff31537..1076bb5d886e 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -324,7 +324,8 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f # Generate host conf for rsyslog_plugin -j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $FILESYSTEM_ROOT_ETC/rsyslog.d/host_events.conf +j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $BUILD_TEMPLATES/host_events.conf +sudo mv $BUILD_TEMPLATES/host_events.conf $FILESYSTEM_ROOT_ETC/rsyslog.d/ sudo cp $BUILD_TEMPLATES/host_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ # Install custom-built monit package and SONiC configuration files From 4d7e8c4b92aae354f962a72356bb006fabcd293c Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Mon, 12 Sep 2022 22:07:31 +0000 Subject: [PATCH 7/9] Split into multiple regex for each process --- files/build_templates/events_info.json | 8 ++++++-- .../build_templates/{host_regex.json => monit_regex.json} | 8 ++++---- files/build_templates/sonic_debian_extension.j2 | 3 ++- files/build_templates/sshd_regex.json | 7 +++++++ 4 files changed, 19 insertions(+), 7 deletions(-) rename files/build_templates/{host_regex.json => monit_regex.json} (53%) create mode 100644 files/build_templates/sshd_regex.json diff --git a/files/build_templates/events_info.json b/files/build_templates/events_info.json index 8e7b76d185d7..6d1e019fb85e 100644 --- a/files/build_templates/events_info.json +++ b/files/build_templates/events_info.json @@ -2,8 +2,12 @@ "yang_module": "sonic-events-host", "proclist": [ { - "name": "host", - "parse_json": "host_regex.json" + "name": "monit", + "parse_json": "monit_regex.json" + }, + { + "name": "sshd", + "parse_json": "sshd_regex.json" } ] } diff --git a/files/build_templates/host_regex.json b/files/build_templates/monit_regex.json similarity index 53% rename from files/build_templates/host_regex.json rename to files/build_templates/monit_regex.json index 0ac27100fc83..d28ea4e9052c 100644 --- a/files/build_templates/host_regex.json +++ b/files/build_templates/monit_regex.json @@ -6,12 +6,12 @@ }, { "tag": "memory-usage", - "regex": "(?:mem|cpu user) usage of (\d+\.\d+)% matches resource limit .(?:mem|cpu user) usage>(\d+\.\d+)%.", + "regex": "mem usage of (\d+\.\d+)% matches resource limit .mem usage>(\d+\.\d+)%.", "params": [ "usage", "limit" ] }, { - "tag": "event-sshd", - "regex": "auth fail: ([a-zA-Z0-9-_\s]*).", - "params": [ "fail_type" ] + "tag": "cpu-usage", + "regex": "cpu user usage of (\d+\.\d+)% matches resource limit .cpu user usage>(\d+\.\d+)%.", + "params": [ "usage", "limit" ] } ] diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 1076bb5d886e..6e2768ce1104 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -326,7 +326,8 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ # Generate host conf for rsyslog_plugin j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json > $BUILD_TEMPLATES/host_events.conf sudo mv $BUILD_TEMPLATES/host_events.conf $FILESYSTEM_ROOT_ETC/rsyslog.d/ -sudo cp $BUILD_TEMPLATES/host_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ +sudo cp $BUILD_TEMPLATES/monit_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ +sudo cp $BUILD_TEMPLATES/sshd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ diff --git a/files/build_templates/sshd_regex.json b/files/build_templates/sshd_regex.json new file mode 100644 index 000000000000..dd664bd1ea75 --- /dev/null +++ b/files/build_templates/sshd_regex.json @@ -0,0 +1,7 @@ +[ + { + "tag": "event-sshd", + "regex": "auth fail: Password Incorrect. user:.([a-zA-Z0-9-_]*)", + "params": [ "username" ] + } +] From b5814537a5b8e8f1cc7fe96bef95db56462a6f48 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Tue, 13 Sep 2022 01:06:28 +0000 Subject: [PATCH 8/9] Modify regex and set .py to sbin in monit_events --- files/build_templates/monit_regex.json | 6 +++--- src/sonic-eventd/tools/monit_events | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/build_templates/monit_regex.json b/files/build_templates/monit_regex.json index d28ea4e9052c..e7384a5434d4 100644 --- a/files/build_templates/monit_regex.json +++ b/files/build_templates/monit_regex.json @@ -1,17 +1,17 @@ [ { "tag": "disk-usage", - "regex": ".([a-zA-Z0-9-_]*). space usage (\d+\.\d+)% matches resource limit .space usage.(\d+\.\d+)%.", + "regex": ".([a-zA-Z0-9-_]*). space usage (\\d+\\.\\d+)% matches resource limit .space usage.(\\d+\\.\\d+)%.", "params": [ "fs", "usage", "limit" ] }, { "tag": "memory-usage", - "regex": "mem usage of (\d+\.\d+)% matches resource limit .mem usage>(\d+\.\d+)%.", + "regex": "mem usage of (\\d+\\.\\d+)% matches resource limit .mem usage>(\\d+\\.\\d+)%.", "params": [ "usage", "limit" ] }, { "tag": "cpu-usage", - "regex": "cpu user usage of (\d+\.\d+)% matches resource limit .cpu user usage>(\d+\.\d+)%.", + "regex": "cpu user usage of (\\d+\\.\\d+)% matches resource limit .cpu user usage>(\\d+\\.\\d+)%.", "params": [ "usage", "limit" ] } ] diff --git a/src/sonic-eventd/tools/monit_events b/src/sonic-eventd/tools/monit_events index 3a1bb32e0b22..267c36568f4d 100644 --- a/src/sonic-eventd/tools/monit_events +++ b/src/sonic-eventd/tools/monit_events @@ -1,6 +1,6 @@ ############################################################################### ## Monit configuration for telemetry container ############################################################################### -check program container_eventd with path "/usr/local/bin/events_monit_test.py" +check program container_eventd with path "/usr/sbin/events_monit_test.py" every 5 cycles if status != 0 for 3 cycle then alert repeat every 1 cycles From 23c1ab418fe687b44637d291948670ef40824303 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 14 Sep 2022 18:56:04 +0000 Subject: [PATCH 9/9] Change log level from err to notice --- src/sonic-eventd/tools/events_monit_test.py | 31 +++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/sonic-eventd/tools/events_monit_test.py b/src/sonic-eventd/tools/events_monit_test.py index ee89b885e646..118028b22e97 100755 --- a/src/sonic-eventd/tools/events_monit_test.py +++ b/src/sonic-eventd/tools/events_monit_test.py @@ -41,10 +41,11 @@ def _log_msg(lvl, pfx, msg): def log_err(m): _log_msg(syslog.LOG_ERR, "Err", m) - def log_info(m): _log_msg(syslog.LOG_INFO, "Info", m) +def log_notice(m): + _log_msg(syslog.LOG_NOTICE, "Notice", m) def log_debug(m): _log_msg(syslog.LOG_DEBUG, "Debug", m) @@ -74,11 +75,11 @@ def test_receiver(event_obj, cnt): rc = event_receive(sh, p) if (rc != 0): - log_err("Failed to receive. {}/{} rc={}".format(i, cnt, rc)) + log_notice("Failed to receive. {}/{} rc={}".format(i, cnt, rc)) break if test_event_key != p.key: - log_err("key mismatch {} != {} {}/{}".format(test_event_key, + log_notice("key mismatch {} != {} {}/{}".format(test_event_key, p.key, i, cnt)) break @@ -89,23 +90,23 @@ def test_receiver(event_obj, cnt): for k, v in exp_params.items(): if k in rcv_params: if (rcv_params[k] != v): - log_err("key:{} exp:{} != exist:{}".format( + log_notice("key:{} exp:{} != exist:{}".format( k, v, rcv_params[k])) rc = -1 else: - log_err("key:{} is missing", k) + log_notice("key:{} is missing", k) rc = -1 if (rc != 0): - log_err("params mismatch {}/{}".format(i,cnt)) + log_notice("params mismatch {}/{}".format(i,cnt)) break if p.missed_cnt != 0: - log_err("Expect missed_cnt {} == 0 {}/{}".format(p.missed_cnt,i,cnt)) + log_notice("Expect missed_cnt {} == 0 {}/{}".format(p.missed_cnt,i,cnt)) break if p.publish_epoch_ms == 0: - log_err("Expect publish_epoch_ms != 0 {}/{}".format(i,cnt)) + log_notice("Expect publish_epoch_ms != 0 {}/{}".format(i,cnt)) break cnt_done += 1 @@ -114,7 +115,7 @@ def test_receiver(event_obj, cnt): if (cnt_done == cnt): rc_test_receive = 0 else: - log_err("test receive abort {}/{}".format(cnt_done, cnt)) + log_notice("test receive abort {}/{}".format(cnt_done, cnt)) # wait for a max of 5 secs for main thread to clear the event. tout = 5000 @@ -125,7 +126,7 @@ def test_receiver(event_obj, cnt): time.sleep(t_sleep / 1000) tout -= t_sleep else: - log_err("test_receiver:Internal err: event not cleared by main") + log_notice("test_receiver:Internal err: event not cleared by main") break event_obj.set() @@ -137,7 +138,7 @@ def publish_events(cnt): rc = -1 ph = events_init_publisher(test_source) if not ph: - log_err("Failed to get publisher handle") + log_notice("Failed to get publisher handle") return rc # Sleep ASYNC_CONN_WAIT to ensure async connectivity is complete. @@ -153,7 +154,7 @@ def publish_events(cnt): rc = event_publish(ph, test_event_tag, pd) if (rc != 0): - log_err("Failed to publish. {}/{} rc={}".format(i, cnt, rc)) + log_notice("Failed to publish. {}/{} rc={}".format(i, cnt, rc)) break log_debug("published: {}/{}".format(i+1, cnt)) @@ -185,12 +186,12 @@ def run_test(cnt): rc_pub = publish_events(cnt) if (rc_pub != 0): - log_err("Failed in publish_events") + log_notice("Failed in publish_events") else: # Wait for subscriber to complete with 1 sec timeout. event_sub.wait(1) if (rc_test_receive != 0): - log_err("Failed to receive events") + log_notice("Failed to receive events") log_debug("run_test_DONE rc_pub={} rc_test_receive={}".format( rc_pub, rc_test_receive)) @@ -221,7 +222,7 @@ def main(): if(rc == 0): log_info("eventd test succeeded") else: - log_err("eventd monit test failed rc={}".format(rc)) + log_notice("eventd monit test failed rc={}".format(rc)) if __name__ == "__main__":