aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.04k stars 322 forks source link

SSM Agent not properly reporting Rocky Linux #405

Closed blaster556 closed 2 years ago

blaster556 commented 2 years ago

When running ssm-agent on Rocky Linux, the OsProductName and OsVersion are reported as unavailable. If you follow the code https://github.com/aws/amazon-ssm-agent/blob/a65a94f46200d68b4c2ed9d4bf26c59dce0eba49/agent/platform/platform_unix.go starting at line 70, you can see that the default is to set the name and version to 'not available'.

The next logic section at line 73 checks for /etc/centos-release existence, it does exist on Rocky, so the contents are read in. Line 85 checks for the existence of 'CentOS' in that file. Since CentOS does not exist in /etc/centos-release on Rocky, the entire function exits at this point, leaving the defaults set to unavailable.

This can be tested by removing the /etc/centos-release file and checking the SSM agent log file: 2021-09-23 21:09:59 INFO [ssm-agent-worker] [StartupProcessor] Executing startup processor tasks 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] getting platform details 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] fetching platform details from /etc/os-release 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] Command output &{Rocky Linux 8.4} 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] getting platform details 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] fetching platform details from /etc/os-release 2021-09-23 21:09:59 DEBUG [ssm-agent-worker] [StartupProcessor] Command output &{Rocky Linux 8.4} 2021-09-23 21:09:59 INFO [ssm-agent-worker] [StartupProcessor] Write to serial port: Amazon SSM Agent v3.1.282.0 is running 2021-09-23 21:09:59 INFO [ssm-agent-worker] [StartupProcessor] Write to serial port: OsProductName: Rocky Linux 2021-09-23 21:09:59 INFO [ssm-agent-worker] [StartupProcessor] Write to serial port: OsVersion: 8.4

OsProductName and OsVersion are now properly set.

danr-amz commented 2 years ago

Thank you for the investigation. At the moment, Rocky Linux is not officially supported by SSM Agent: https://docs.aws.amazon.com/systems-manager/latest/userguide/prereqs-operating-systems.html

blaster556 commented 2 years ago

But seeing as Amazon is an official sponser of Rocky Linux, I would suspect that it should be...

nazunalika commented 2 years ago

Hello. I'm from the Release Engineering team for Rocky Linux. The /etc/centos-release symlink was added for compatibility. I apologize that this is causing issues with SSM. We'll try to reach out to our AWS contacts and see if we can get information about this particular issue, and hopefully come to a resolution.

gianniLesl commented 2 years ago

This issue was fixed in version 3.1.630.0

Thor-Bjorgvinsson commented 2 years ago

@nazunalika, additional changes were needed before all features of the SSM Agent (e.g. auto-update) worked on Rocky Linux. We are updating our documentation to include that SSM Agent officially supports rocky linux from agent version 3.1.941.0.

Where can we submit a request to update the agent version in rocky repository?

nazunalika commented 2 years ago

@nazunalika, additional changes were needed before all features of the SSM Agent (e.g. auto-update) worked on Rocky Linux. We are updating our documentation to include that SSM Agent officially supports rocky linux from agent version 3.1.941.0.

Where can we submit a request to update the agent version in rocky repository?

We don't package amazon-ssm-agent in Rocky at this time. As it is not a package that comes from our upstreams (Red Hat, CentOS, Fedora), we do not build it. According to this page it is built and provided by AWS.

My suggestion is if Amazon or users would like it to be packaged and provided by Rocky in our extras repository, please open a ticket at https://bugs.rockylinux.org (requires registration at account services) and file it under Rocky Linux -> Packages -> All Versions