Module: check_mk
Branch: master
Commit: 87f04884576af3024ec2ff8ecb0f8d5ccab13f0a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=87f04884576af3…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jan 7 11:44:50 2019 +0100
agent_aws: Started AWS/Glacier checks
Change-Id: Ie5b1dbff31c5724aaedd48f041e5e465b548b8a4
---
agents/special/agent_aws | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/agents/special/agent_aws b/agents/special/agent_aws
index 7298f38..5d11eb3 100755
--- a/agents/special/agent_aws
+++ b/agents/special/agent_aws
@@ -798,13 +798,28 @@ class Glacier(AWSSection):
return 300
def _get_raw_result(self):
- pass
+ response = self._client.list_vaults()
+ try:
+ vaults = {r['VaultName']: r for r in response['VaultList']}
+ except KeyError, e:
+ logging.info("%s: KeyError %s; Available are %s", self.name, e,
response.keys())
+ vaults = {}
+
+ for vault_name, vault in vaults.iteritems():
+ response = self._client.list_jobs(vaultName=vault_name)
+ try:
+ jobs = response['JobList']
+ except KeyError, e:
+ logging.info("%s: KeyError %s; Available are %s", self.name, e,
response.keys())
+ jobs = []
+ vault['Jobs'] = jobs
+ return vaults
def _extract_content_from(self, raw_result):
- pass
+ return raw_result
def _format_content(self, content):
- pass
+ return [AWSSectionResult("", content)]
#.
@@ -872,6 +887,7 @@ class AWSSections(object):
s3_client = self._init_client('s3')
elb_client = self._init_client('elb')
cloudtrail_client = self._init_client('cloudtrail')
+ glacier_client = self._init_client('glacier')
cloudwatch_client = self._init_client('cloudwatch')
#---distributors----------------------------------------------------
@@ -892,6 +908,7 @@ class AWSSections(object):
ec2 = EC2(cloudwatch_client)
elb = ELB(cloudwatch_client)
ebs = EBS(cloudwatch_client)
+ glacier = Glacier(glacier_client)
#---register sections to distributors-------------------------------
ec2_summary_distributor.add(ec2)
@@ -914,6 +931,7 @@ class AWSSections(object):
self._sections.append(elb)
self._sections.append(ebs)
self._sections.append(cloudtrail)
+ self._sections.append(glacier)
def _init_client(self, client_key):
try: