Add preserve_fqdn to SYSLOG_CONFIG and toggle long/short hostname#25523
Add preserve_fqdn to SYSLOG_CONFIG and toggle long/short hostname#25523spandan-nexthop wants to merge 1 commit intosonic-net:masterfrom
preserve_fqdn to SYSLOG_CONFIG and toggle long/short hostname#25523Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
91e61ff to
6e76376
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6e76376 to
f197086
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
f197086 to
0761628
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
0761628 to
745242a
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
Retrying failed(or canceled) jobs... |
|
/azpw retry |
|
Retrying failed(or canceled) jobs... |
|
/azpw retry |
|
Retrying failed(or canceled) jobs... |
|
Build not found. Please close and reopen the PR or rebase your branch to trigger a new build. |
|
Hi @spandan-nexthop, your build was triggered one month ago. The build has been cleaned already. Please close and reopen the PR or rebase your branch to trigger a new build. Thanks |
745242a to
471bc79
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw ms_conflict |
1 similar comment
|
/azpw ms_conflict |
471bc79 to
4f4413c
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
4f4413c to
634b532
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…log-config.sh` such that the remote syslog messages have the long/short hostname accordingly Signed-off-by: Spandan Chowdhury <spandan@nexthop.ai>
634b532 to
fb524fc
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw retry |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1101788: ✅Stage Test:
|
Add
preserve_fqdntoSYSLOG_CONFIGand updatehostnameinrsyslog-config.shsuch that the remote syslog messages have the long/short hostname accordingly.Fixes #23863
[CLOSED] Original PR was #23864.
Why I did it
The original PR was #23864.
This was closed since the changes for hardcoding the
hostnamegot committed as part of #24394Currently, in SONiC, syslog messages are only sent with the shortened hostname, not the FQDN. It would be good to conditionally be able to toggle the hostname to the long (FQDN) or short form in remote syslog messages.
Work item tracking
How I did it
preseve_fqdn- toSYSLOG_CONFIGinsonic-syslog.yangSYSLOG_CONFIG|GLOBALautomatically triggers anrsyslog-configrestart, I just added a check forpreserve_fqdninrsyslog-config.shsuch that it sets thehostnameto the long/short form correctly.PreserveFQDN on|offin the syslog config would have been an alternate solution, but that approach requires an update and restart of rsyslog in the host AS WELL AS all the containers separately since each run their own syslog daemon. This was a more disruptive solution and we chose to not go down that path.How to verify it
Enabling
preserve_fqdnand doing a tcpdump for the syslog messages shows the correct FQDN.Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Adding
preserve_fqdntoSYSLOG_CONFIGto conditionally toggle the full/short hostname sent in syslog messages.Link to config_db schema for YANG module changes
https://github.com/spandan-nexthop/sonic-buildimage/blob/spandan-nexthop.add-fqdn-syslog/src/sonic-yang-models/yang-models/sonic-syslog.yang#L184
A picture of a cute animal (not mandatory but encouraged)