Module: check_mk
Branch: master
Commit: 337d7f7d3bdbfcc6e71774289be7cea5085d33af
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=337d7f7d3bdbfc…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Jan 8 10:59:13 2019 +0100
agent_aws: Improved persisted section header
Change-Id: I3c0e2c07ddcf0e7446cc2a56871798e8db2514c1
---
agents/special/agent_aws | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/agents/special/agent_aws b/agents/special/agent_aws
index d6b66f8..d921d92 100755
--- a/agents/special/agent_aws
+++ b/agents/special/agent_aws
@@ -924,11 +924,15 @@ class AWSSections(object):
logging.info(msg)
raise AWSSectionError(msg)
+ persist_suffix = ""
+ if section_interval > 60:
+ persist_suffix = ":persist(%s)" % int(now + section_interval +
60)
+
if any([r.content for r in result]):
- self._write_section_result(section_name, int(now + section_interval +
60), result)
+ self._write_section_result(section_name, persist_suffix, result)
- def _write_section_result(self, section_name, until, result):
- section_header = "<<<aws_%s:persist(%s)>>>\n" %
(section_name, until)
+ def _write_section_result(self, section_name, persist_suffix, result):
+ section_header = "<<<aws_%s%s>>>\n" % (section_name,
persist_suffix)
for row in result:
write_piggyback_header = row.piggyback_hostname\
and row.piggyback_hostname != self._hostname