Skip to content
Snippets Groups Projects
Commit 9931711b authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Fix maybe w -s output?

parent 2e38ecc9
No related branches found
No related tags found
No related merge requests found
......@@ -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}"\
......
[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>"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment