Skip to content

Commit c270929

Browse files
committed
Add check for last_updated with capacity
1 parent 6527aa8 commit c270929

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

check_vmware_nsxt.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,12 @@ def build_output(self):
328328
def build_status(self):
329329
states = []
330330

331-
# TODO: check last_updated_timestamp
331+
now = datetime.datetime.now()
332+
last_updated = build_datetime(self.data['meta_info']['last_updated_timestamp'])
333+
334+
if (now-last_updated).total_seconds() / 60 > 5:
335+
states.append(WARNING)
336+
self.summary.append("last update older than 5 minutes")
332337

333338
for usage in self.data['capacity_usage']:
334339
severity = usage['severity'] # INFO, WARNING, CRITICAL, ERROR

0 commit comments

Comments
 (0)