From 40edb13762a7c46b23681aca62158fd249ff9b29 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 24 Oct 2019 20:31:49 +0200 Subject: final touches # added + add method to escape whitespaces in keys and values # changed * init client handler only once and not every time * don't try to create database on every run just on the first one # removed - vhosts are listed first and after that the respective nodes are listed --- ejabberdrpc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ejabberdrpc.py') diff --git a/ejabberdrpc.py b/ejabberdrpc.py index b2cc908..cee769b 100755 --- a/ejabberdrpc.py +++ b/ejabberdrpc.py @@ -109,7 +109,11 @@ class EjabberdMetrics(): def fetch_muc(self, vhost=None): host = "global" if vhost is not None: - host = "conference." + vhost + version = self._cmd("status", {}) + if "19.09" in version: + host = "conference." + vhost + else: + host = vhost result = self._cmd("muc_online_rooms", {"host": host}) if "rooms" in result: return len(result["rooms"]) -- cgit v1.2.3-54-g00ecf