Skip to content

Commit

Permalink
show more detail in checks tab #2014
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Oct 15, 2024
1 parent dfccbce commit 18cac8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/tacticalrmm/checks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,11 @@ def handle_check(self, data, check: "Check", agent: "Agent"):
if len(self.history) > 15:
self.history = self.history[-15:]

update_fields.extend(["history"])
update_fields.extend(["history", "more_info"])

avg = int(mean(self.history))
txt = "Memory Usage" if check.check_type == CheckType.MEMORY else "CPU Load"
self.more_info = f"Average {txt}: {avg}%"

if check.error_threshold and avg > check.error_threshold:
self.status = CheckStatus.FAILING
Expand Down

0 comments on commit 18cac8b

Please sign in to comment.