Module: check_mk
Branch: master
Commit: 91376491eb53dca99bc808b0f9641d90d150e0ed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91376491eb53dc…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Apr 18 13:43:22 2019 +0200
agent_aws: Fixed two KeyError while collecting EC2 limits
Change-Id: I06a66184338527fc6682a7e8c03e8fa095fa0b42
---
cmk/special_agents/agent_aws.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmk/special_agents/agent_aws.py b/cmk/special_agents/agent_aws.py
index d9c335b..b2e8aa3 100644
--- a/cmk/special_agents/agent_aws.py
+++ b/cmk/special_agents/agent_aws.py
@@ -882,7 +882,7 @@ class EC2Limits(AWSSectionLimits):
def _compute_content(self, raw_content, colleague_contents):
reservations, reserved_instances, addresses, security_groups, interfaces,
spot_inst_requests, spot_fleet_requests = raw_content.content
instances = {inst['InstanceId']: inst for res in reservations for inst in
res['Instances']}
- res_instances = {inst['ReservedInstanceId']: inst for inst in
reserved_instances}
+ res_instances = {inst['ReservedInstancesId']: inst for inst in
reserved_instances}
self._add_instance_limits(instances, res_instances, spot_inst_requests)
self._add_addresses_limits(addresses)
@@ -1039,7 +1039,7 @@ class EC2Limits(AWSSectionLimits):
active_spot_fleet_requests = 0
total_target_cap = 0
for spot_fleet_req in spot_fleet_requests:
- if spot_fleet_req['State'] != 'active':
+ if spot_fleet_req['SpotFleetRequestState'] != 'active':
continue
active_spot_fleet_requests += 1