diff --git a/bbbmon/meetings.py b/bbbmon/meetings.py index 3da073a4d27640265149c3f8e1ac3a753087afa4..aa500868979e2c4c17a8306954d9f8a34fdc072c 100644 --- a/bbbmon/meetings.py +++ b/bbbmon/meetings.py @@ -198,7 +198,6 @@ def meetings_twolines(config: Config, watch: int, fancy: bool): if watch is not None: click.clear() - for i, endpoint in enumerate(config.endpoints): meeting = meetings[i] @@ -231,8 +230,16 @@ def meetings_twolines(config: Config, watch: int, fancy: bool): if not fancy: if config.on_server: # If on server get load - w = subprocess.run(["w | head -1 | awk '{print $10}' | sed -e 's/,$//'"], shell=True, stdout=subprocess.PIPE) - w = float(w.stdout.decode('utf-8').strip().replace(",", ".")) + w = subprocess.run(["w | head -1"], shell=True, stdout=subprocess.PIPE) + w = w.stdout.decode('utf-8').split("load average:") + if len(w) != 2: + w="-" + else: + w = w[1].strip().split(" ")[0] + try: + w = float(w.replace(",", ".")) + except: + w = "-" lines = [ "{} rec / ses ppl mod vid mic ear lod".format(endpoint.name[:3]), "stats {:>2} / {:<2} {:>3} {:>3} {:>3} {:>3} {:>3} {:.1f}"\ diff --git a/pyproject.toml b/pyproject.toml index 83d1f9adfe0450f419fb8e8124fc4f9040976cf5..646886aa8906d09cc6f78e0eba6fab4b1a55cb13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bbbmon" -version = "0.1.19" +version = "0.1.20" description = "A small CLI utility to monitor bbb usage" authors = ["David Huss <david.huss@hfbk-hamburg.de>"] maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"]