From 6969376c48e018c7267b20efd5ffa3704f5e043c Mon Sep 17 00:00:00 2001 From: loopway Date: Sat, 17 Aug 2024 00:33:35 +0200 Subject: [PATCH] timemachine: removesuffix .backup remove .backup suffix from tmutil latestbackup output --- cmk/plugins/collection/agent_based/timemachine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/plugins/collection/agent_based/timemachine.py b/cmk/plugins/collection/agent_based/timemachine.py index 1535745af5a..0d72eb6549c 100644 --- a/cmk/plugins/collection/agent_based/timemachine.py +++ b/cmk/plugins/collection/agent_based/timemachine.py @@ -55,7 +55,7 @@ def _check(now: datetime.datetime, params: Mapping[str, Any], section: str) -> C ) return - raw_backup_time = section.split("/")[-1] + raw_backup_time = section.split("/")[-1].removesuffix('.backup') backup_time = datetime.datetime.strptime(raw_backup_time, "%Y-%m-%d-%H%M%S") backup_age = (now - backup_time).total_seconds()