How to monitor instances using Boto3

0 votes

Hi Guys,

I have launched EC2 instances in AWS. I want to monitor the instances with the Boto3 module. How can I do that?

Oct 8, 2020 in AWS by akhtar
• 38,260 points
1,442 views

1 answer to this question.

0 votes

Hi@akhtar,

You can monitor your EC2 instances with the help of the boto3 module. The below-given script shows how to monitor instances.

import sys
import boto3
ec2 = boto3.client('ec2')
if sys.argv[1] == 'ON':
    response = ec2.monitor_instances(InstanceIds=['INSTANCE_ID'])
else:
    response = ec2.unmonitor_instances(InstanceIds=['INSTANCE_ID'])
print(response)
answered Oct 8, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I return XML from boto calls?

I don't think there's an officially supported ...READ MORE

answered Jul 20, 2018 in AWS by Cloud gunner
• 4,670 points
1,458 views
0 votes
1 answer

How to stop EC2 instances using Boto3?

Hi@akhtar, To change the state of an EC2 ...READ MORE

answered Oct 7, 2020 in AWS by MD
• 95,460 points
2,276 views
0 votes
1 answer

How to describe EC2 instances using Boto3?

Hi@akhtar, An EC2 instance is a virtual server ...READ MORE

answered Oct 8, 2020 in AWS by MD
• 95,460 points
6,781 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP