Search code examples
amazon-web-servicesamazon-ec2boto3amazon-cloudwatchaws-ssm

AWS EC2: Get the detailed MountPoint metrics without installing any agent on Existing Instances


Would like to gather the mountpoint metrics.

  1. free space, used space, for mount point /,/mnt,/test_mnt....
  2. Is it possible without installing agent
  3. if agent needs to be installed can we do it without ssh into vm

(these exsiting instances doesnot contain any agent pre-installed)

Tried with SSM Agent (need to install them manually through SSH or need to provide userdata-reboot required/Not suggested) Tried with cloud watch agent (need to install manually through SSH or it can be done through package manager where again it depends on SSM).


Solution

  • By design, no AWS services or systems can see anything "inside" a running EC2 instance unless you install some kind of an agent to allow that.

    By extension, it is impossible to install an agent without SSH unless you include the agent on the AMI that is used to launch the instance, or you use cloud-init to deploy it with the user data script at the time the instance is originally launched. (This only works at launch, not reboot.)

    A tool like Ansible could be used to automate the process of installing agents over SSH, so you do would not need to manually SSH to each machine, but the system running Ansible would still need the SSH keys and network connectivity to each target.