Skip to content

How to check if RDS and EC2 instances are either Amazon Linux 2023 or Amazon Linux 2 ?

0

Hi re:Post,

This is to determine if the CloudWatch agent is already available as a package on our instances.

From:

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.html

--> "The CloudWatch agent is available as a package in Amazon Linux 2023 and Amazon Linux 2"

I looked in instance's detail but I'm not able to determine what flavor of Linux the instance is.

" Platform details Linux/UNIX "

I'm probably looking right at but missing it...

Thank you for your time and help!

Best Regards,

Donald

1 Answer
2
Accepted Answer

Hello.

RDS is a managed database service, so the OS is managed by AWS.
Therefore, it is not possible to determine what OS you are using.

In the case of EC2, you can check the OS type by checking the AMI name or by connecting to EC2 using SSH and checking the contents of the "/etc/os-release" file.
a

cat /etc/os-release
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023.5.20240624"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"
DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"
SUPPORT_URL="https://aws.amazon.com/premiumsupport/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
VENDOR_NAME="AWS"
VENDOR_URL="https://aws.amazon.com/"
SUPPORT_END="2028-03-15"
EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • Hi Riku, Thank you for your quick reply and help! Is it possible to install and config the CloudWatch agent on an RDS instance?

    I'll see if we can get to a console to run "cat /etc/os-release". For EC2, the AMI name is not available? " AMI ID: ami-0cefd27b359d4e920

    AMI name EC2 can't retrieve the name because the AMI was either deleted or made private. "

    How do get around this condition and check for OS type?

    Best Regards, Donald

  • CloudWatch Agent cannot be installed on RDS. If you cannot check the AMI name, it is best to SSH into the OS and check "/etc/os-release".

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.