Skip to content

Commit 5cf0482

Browse files
thperappCopilot
andcommitted
AzureMonitorAgent: support Azure Linux 4 (gate + rsyslog install)
Adds Azure Linux 4 (x86_64 + aarch64) support: - supported_distros.py: add '4' to the 'azurelinux' key in supported_dists_x86_64 and supported_dists_aarch64 so the extension no longer rejects Azure Linux 4 with 'Unsupported operating system'. - agent.py install(): Azure Linux 4 ships journald-only with no rsyslog pre-installed, so AMA's Syslog collection produces no data until rsyslog is present. Mirror the existing Debian 12/13 and Amazon Linux 2023 handling by installing rsyslog via dnf when missing. Validated end-to-end on a real Azure Linux 4.0 VM (AMA 1.42.0): uninstall AMA + rsyslog, then reinstall -> rsyslog is auto-installed by install() and Heartbeat/Syslog/Perf/InsightsMetrics/*_CL all flow to the LAW. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc6e1b08-7800-4f61-826c-89e0a7b928d9
1 parent cceb34f commit 5cf0482

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

AzureMonitorAgent/agent.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,15 @@ def install():
473473
if rsyslog_exit_code != 0:
474474
return rsyslog_exit_code, rsyslog_output
475475

476+
# Check if Azure Linux 4+ VMs have rsyslog package (Azure Linux 4 ships journald-only, no rsyslog by default)
477+
if (vm_dist.startswith('azurelinux')) and int(vm_ver.split('.')[0]) >= 4:
478+
check_rsyslog, _ = run_command_and_log("rpm -q rsyslog")
479+
if check_rsyslog != 0:
480+
hutil_log_info("'rsyslog' package missing from Azure Linux {0} machine, installing to allow AMA to run.".format(vm_ver))
481+
rsyslog_exit_code, rsyslog_output = run_command_and_log("dnf install -y rsyslog")
482+
if rsyslog_exit_code != 0:
483+
return rsyslog_exit_code, rsyslog_output
484+
476485
# Check if SLES 16+ VMs have 'which' package (changed from Requires to Recommends in spec, may not be installed)
477486
if (vm_dist.startswith('suse') or vm_dist.startswith('sles')) and int(vm_ver.split('.')[0]) >= 16:
478487
check_which, _ = run_command_and_log("rpm -q which")

AzureMonitorAgent/ama_tst/modules/install/supported_distros.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
supported_dists_x86_64 = {
22
'alma' : ['8', '9'], # Alma
33
'amzn' : ['2', '2023'], # Amazon Linux 2
4-
'azurelinux' : ['3'], 'mariner' : ['2'], # Azure Linux
4+
'azurelinux' : ['3', '4'], 'mariner' : ['2'], # Azure Linux
55
'debian' : ['9', '10', '11', '12', '13'], # Debian
66
'opensuse' : ['15'], # openSUSE
77
'oracle' : ['7', '8', '9'], 'ol' : ['7', '8', '9'], # Oracle
@@ -13,7 +13,7 @@
1313

1414
supported_dists_aarch64 = {
1515
'alma' : ['8'], # Alma
16-
'azurelinux' : ['3'], 'mariner' : ['2'], # Azure Linux
16+
'azurelinux' : ['3', '4'], 'mariner' : ['2'], # Azure Linux
1717
'debian' : ['11', '12', '13'], # Debian
1818
'redhat' : ['8', '9', '10'], # RHEL
1919
'rocky' : ['8', '9', '10'], 'rocky linux' : ['8', '9', '10'], # Rocky

0 commit comments

Comments
 (0)