From c4891a431815e560d3c9ff09ed40ad15330bf837 Mon Sep 17 00:00:00 2001 From: Florian Heigl Date: Thu, 23 Nov 2023 03:50:11 +0100 Subject: [PATCH] Update agent_unifi_controller: handle device names UniFi UI allows people to create device names with blanks - of course these don't end up as valid hostnames. This is a very simplistic fix that replaces blanks with underscores. It allows for piggyback processing of the devices. --- share/check_mk/agents/special/agent_unifi_controller | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/check_mk/agents/special/agent_unifi_controller b/share/check_mk/agents/special/agent_unifi_controller index e229e5e..541bb50 100644 --- a/share/check_mk/agents/special/agent_unifi_controller +++ b/share/check_mk/agents/special/agent_unifi_controller @@ -337,7 +337,7 @@ class unifi_device(unifi_object): def __str__(self): if self._piggy_back: - _piggybackname = getattr(self,self._API.PIGGYBACK_ATTRIBUT,self.name) + _piggybackname = getattr(self,self._API.PIGGYBACK_ATTRIBUT,self.name).replace(" ", "_") _ret = [f"<<<<{_piggybackname}>>>>"] else: _ret = []