Fix syslog config regeneration and reset MDSDSyslogPort on removal#2187
Merged
Conversation
- In generate_localsyslog_configs, do not return early when syslog_port equals MDSDSyslogPort if none of the syslog config files exist, ensuring configs are regenerated when missing. - In remove_localsyslog_configs, reset MDSDSyslogPort to 0 so the next call to generate_localsyslog_configs will not short-circuit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jaytripath
previously approved these changes
Jun 18, 2026
- Test generate_localsyslog_configs does not return early when port matches but no config files exist (covers the regeneration fix) - Test generate_localsyslog_configs returns early when port matches and config files are present - Test remove_localsyslog_configs resets MDSDSyslogPort to 0 - Test port reset enables subsequent config regeneration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jaytripath
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ICM Incident
10-azuremonitoragent-omfwd.confis not recreated — Syslog collection stops while Heartbeat continues working.generate_localsyslog_configs(), the early returnif syslog_port == MDSDSyslogPortfires becauseMDSDSyslogPortremains cached from the first generation.remove_localsyslog_configs()deletes the conf file but never resetsMDSDSyslogPort, so within the same long-lived watcher process, re-association is a no-op.MDSDSyslogPortwas introduced in 1.40.0)Changes
generate_localsyslog_configs: Do not return early whensyslog_port == MDSDSyslogPortif none of the syslog config files exist (/etc/rsyslog.d/10-azuremonitoragent-omfwd.conf,/etc/rsyslog.d/10-azuremonitoragent.conf,/etc/syslog-ng/conf.d/azuremonitoragent-tcp.conf,/etc/syslog-ng/conf.d/azuremonitoragent.conf). This ensures configs are regenerated when missing.remove_localsyslog_configs: ResetMDSDSyslogPortto 0 so subsequent calls togenerate_localsyslog_configswill not short-circuit.Related Work Items