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 in AWS by akhtar
• 33,470 points
38 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 by MD
• 79,390 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,650 points
402 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 in AWS by MD
• 79,390 points
45 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 in AWS by MD
• 79,390 points
323 views