Skip to content

Commit

Permalink
Merge pull request #147 from mssonicbld/sonicbld/202205-merge
Browse files Browse the repository at this point in the history
[code sync] Merge code from sonic-net/sonic-buildimage:202205 to 202205
  • Loading branch information
mssonicbld authored Oct 27, 2023
2 parents 7eef394 + 5be27df commit 5478059
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function updateSyslogConf()
{%- if docker_container_name == "database" %}
python -c "import jinja2, os; paths=['/usr/share/sonic/templates']; loader = jinja2.FileSystemLoader(paths); env = jinja2.Environment(loader=loader, trim_blocks=True); template_file='/usr/share/sonic/templates/rsyslog-container.conf.j2'; template = env.get_template(os.path.basename(template_file)); data=template.render({\"target_ip\":\"$TARGET_IP\",\"container_name\":\"$CONTAINER_NAME\"}); print(data)" > $TMP_FILE
{%- else %}
sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\" }" > $TMP_FILE
sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\", \"platform\": \"$PLATFORM\" }" > $TMP_FILE
{%- endif %}
docker cp $TMP_FILE ${DOCKERNAME}:/etc/rsyslog.conf
rm -rf $TMP_FILE
Expand Down
11 changes: 11 additions & 0 deletions files/image_config/rsyslog/rsyslog-container.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ $SystemLogRateLimitBurst 20000
###########################
#### GLOBAL DIRECTIVES ####
###########################
{% if container_name == 'pmon' %}
{% if platform == 'x86_64-mlnx_msn2700-r0' or platform == 'x86_64-mlnx_msn2700a1-r0' %}

# This rsyslog configuration is intended to resolve the following error message that only appears on the MSN2700 platform:
# "ERR pmon#sensord: Error getting sensor data: dps460/#10: Can't read"
# This error is because of firmware issue with some type of PSU, we are not able to upgrade the FW online.
# Since there is no functional impact, this error log can be ignored safely.

if $programname contains "sensord" and $msg contains "Error getting sensor data: dps460/#" then stop

{% endif %}
{% endif %}
# Set remote syslog server
template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% {{container_name}}#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%")
*.* action(type="omfwd" target="{{target_ip}}" port="514" protocol="udp" Template="ForwardFormatInContainer")
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-telemetry

0 comments on commit 5478059

Please sign in to comment.