Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not pass the option "device" in rsyslog.conf by default when syslog server's source address is configured #17616

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

stephenxs
Copy link
Collaborator

Why I did it

An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because eth0 is always specified as the device of a syslog server and the syslog packets will be sent to eth0 regardless of its destination IP address.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF

How to verify it

Manually test:

  1. Configuring a syslog server without VRF specified or with default as the VRF: no device passed in rsyslog.conf
  2. Configuring a syslog server with non-default VRF: the configured VRF passed as device in rsyslog.conf

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

fastiuk and others added 3 commits December 25, 2023 05:25
Signed-off-by: Stephen Sun <stephens@nvidia.com>
Signed-off-by: Stephen Sun <stephens@nvidia.com>
@stephenxs stephenxs requested a review from lguohan as a code owner December 25, 2023 13:17
@mssonicbld
Copy link
Collaborator

@StormLiangMS,@liushilongbuaa PR: #17616 is conflict with MS internal repo
Please complete the following PR by pushing fix commit to sonicbld/conflict_prefix/17616-fix
https://msazure.visualstudio.com/One/_git/Networking-acs-buildimage/pullrequest/9283703
Then comment "/azpw ms_conflict" to rerun PR checker.

@StormLiangMS
Copy link
Contributor

/azp run ms_conflict

Copy link

No pipelines are associated with this pull request.

@StormLiangMS
Copy link
Contributor

/azpw ms_conflict

@StormLiangMS
Copy link
Contributor

hi @qiluo-msft could you have expert to take a look at this PR? And there is an internal conflict.

@wen587
Copy link
Contributor

wen587 commented Dec 26, 2023

/azpw ms_conflict

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Jan 10, 2024

Is it covered by sonic-mgmt testcases? #Closed

@stephenxs
Copy link
Collaborator Author

Is it covered by sonic-mgmt testcases?

I do not think so. this was found by our internal QA test.

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Jan 14, 2024

Is it covered by sonic-mgmt testcases?

I do not think so. this was found by our internal QA test.

Could you add a test for the behavior "an in-band syslog server will not receive any syslog if it is configured without a VRF specified"? #Closed

@stephenxs
Copy link
Collaborator Author

Is it covered by sonic-mgmt testcases?

I do not think so. this was found by our internal QA test.

Could you add a test for the behavior "an in-band syslog server will not receive any syslog if it is configured without a VRF specified"?

I'm not sure whether there is infra for such test cases. So, I need to check the details and get back to you
Is it possible to merge it first because it's a blocker to our 202305 release and then we will add the test case later?
Thanks

@qiluo-msft
Copy link
Collaborator

@prsunny Could you help review?

@qiluo-msft
Copy link
Collaborator

This is still applicable. We could not approve this PR if testcase is not implemented.


In reply to: 1890853775

@stephenxs
Copy link
Collaborator Author

This is still applicable. We could not approve this PR if testcase is not implemented.

In reply to: 1890853775

Test plan ready for review sonic-net/sonic-mgmt#11803

@qiluo-msft qiluo-msft merged commit 610685d into sonic-net:master Mar 24, 2024
20 checks passed
@stephenxs stephenxs deleted the fix-log-sintf branch March 24, 2024 09:34
@qiluo-msft
Copy link
Collaborator

ADO 27353460
@StormLiangMS Please help backport.

@StormLiangMS
Copy link
Contributor

hi @stephenxs @wen587 pls have test with 202305 on brcm/mellanox/cisco/marvell platform, would like to avoid regression.

@stephenxs
Copy link
Collaborator Author

hi @stephenxs @wen587 pls have test with 202305 on brcm/mellanox/cisco/marvell platform, would like to avoid regression.

@StormLiangMS this is platform independent feature. It was tested on 202305 on mellanox platform.

@wen587
Copy link
Contributor

wen587 commented Mar 29, 2024

Hi @StormLiangMS , I tested the rsyslog.conf generation in 202305 PROD. I tried with one MGMTdevice and one non-MGMTdevice patching the PR.
Both devices show the same difference as below:

action(type="omfwd" Target="some_ip" Port="514" Protocol="udp" Device="eth0")
Changed to
action(type="omfwd" Target="some_ip" Port="514" Protocol="udp" Template="SONiCFileFormat")
Since SONiCFileFormat is the default template. So it just eliminates the Device variable. There should be no regression.

StormLiangMS pushed a commit to StormLiangMS/sonic-buildimage that referenced this pull request Mar 30, 2024
…g server's source address is configured (sonic-net#17616)

### Why I did it

An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because `eth0` is always specified as the `device` of a syslog server and the syslog packets will be sent to `eth0` regardless of its destination IP address.

### How I did it

Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF

#### How to verify it

Manually test:
1. Configuring a syslog server without VRF specified or with `default` as the VRF: no `device` passed in `rsyslog.conf`
2. Configuring a syslog server with non-default VRF: the configured VRF passed as `device` in `rsyslog.conf`
StormLiangMS added a commit that referenced this pull request Mar 31, 2024
…g server's source address is configured (#17616) (#18514)

### Why I did it

An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because `eth0` is always specified as the `device` of a syslog server and the syslog packets will be sent to `eth0` regardless of its destination IP address.

### How I did it

Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF

#### How to verify it

Manually test:
1. Configuring a syslog server without VRF specified or with `default` as the VRF: no `device` passed in `rsyslog.conf`
2. Configuring a syslog server with non-default VRF: the configured VRF passed as `device` in `rsyslog.conf`

Co-authored-by: Stephen Sun <5379172+stephenxs@users.noreply.github.com>
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Apr 1, 2024
…g server's source address is configured (sonic-net#17616)

### Why I did it

An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because `eth0` is always specified as the `device` of a syslog server and the syslog packets will be sent to `eth0` regardless of its destination IP address.

### How I did it

Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF

#### How to verify it

Manually test:
1. Configuring a syslog server without VRF specified or with `default` as the VRF: no `device` passed in `rsyslog.conf`
2. Configuring a syslog server with non-default VRF: the configured VRF passed as `device` in `rsyslog.conf`
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #18518

mssonicbld pushed a commit that referenced this pull request Apr 1, 2024
…g server's source address is configured (#17616)

### Why I did it

An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because `eth0` is always specified as the `device` of a syslog server and the syslog packets will be sent to `eth0` regardless of its destination IP address.

### How I did it

Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF

#### How to verify it

Manually test:
1. Configuring a syslog server without VRF specified or with `default` as the VRF: no `device` passed in `rsyslog.conf`
2. Configuring a syslog server with non-default VRF: the configured VRF passed as `device` in `rsyslog.conf`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants