Gaishi
Gaishi

Reputation: 13

AWS: how to check if there is any EC2 Instance has not been rebooted for over 90 days?

I'd like to know how to check if there is any EC2 Instance has not been rebooted for over 90 days. I know I can check it in CloudTrail event history if it is less than 90 days, and I can also check it using linux command if I am using linux AMI. But is there any way I can do it inside AWS console?

Thank you all in advance.

Upvotes: 0

Views: 1695

Answers (3)

Azize
Azize

Reputation: 4476

The best way to have 100% sure is looking at uptime inside your OS.

You can use AWS Systems Manager Run Command to get the result of uptime from all your instances remotely. The link below explain how to do it.

https://aws.amazon.com/getting-started/hands-on/remotely-run-commands-ec2-instance-systems-manager/

Upvotes: 1

Asri Badlah
Asri Badlah

Reputation: 2123

  1. Open the CloudTrail console, and then choose Event history.

  2. In Filter, select the drop-down menu, and then choose Event name.

  3. In the Enter event name text box, enter (StopInstances), and then choose the event name.

  4. In Time range, enter the desired time range (up to 9o days), and then choose Apply.

Upvotes: 0

samtoddler
samtoddler

Reputation: 9605

For doing inside the console you can check under Monitor and Troubleshoot -> Get System Logs

You can use get-console-output aws cli command and get the system logs which are actually just the output of dmesg command.

you'll get something like this

  [153.460957] cloud-init[2765]: RUNNING HANDLER [_system : restart network] ************************************

Then [153.460957] this is dmesg specific time stamp you can convert that to human readable by following How do I convert dmesg timestamp to custom date format?

Upvotes: 0

Related Questions