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

Fix load parsing

parent 19b57985
No related branches found
No related tags found
No related merge requests found
...@@ -231,15 +231,15 @@ def meetings_twolines(config: Config, watch: int, fancy: bool): ...@@ -231,15 +231,15 @@ def meetings_twolines(config: Config, watch: int, fancy: bool):
if config.on_server: if config.on_server:
# If on server get load # If on server get load
w = subprocess.run(["w | head -1"], shell=True, stdout=subprocess.PIPE) w = subprocess.run(["w | head -1"], shell=True, stdout=subprocess.PIPE)
w = w.stdout.decode('utf-8').split("load average:") w = w.stdout.decode('utf-8').strip().split("load average:")
if len(w) != 2: if len(w) != 2:
w = 0.0 w = 999.0
else: else:
w = w[1].strip().split(" ")[0] w = w[1].strip().split(" ")[0].rstrip(",")
try: try:
w = float(w.replace(",", ".")) w = float(w.replace(",", "."))
except: except:
w = 0.0 w = 666.0
lines = [ lines = [
"{} rec / ses ppl mod vid mic ear lod".format(endpoint.name[:3]), "{} rec / ses ppl mod vid mic ear lod".format(endpoint.name[:3]),
"stats {:>2} / {:<2} {:>3} {:>3} {:>3} {:>3} {:>3} {:.1f}"\ "stats {:>2} / {:<2} {:>3} {:>3} {:>3} {:>3} {:>3} {:.1f}"\
......
[tool.poetry] [tool.poetry]
name = "bbbmon" name = "bbbmon"
version = "0.1.21" version = "0.1.22"
description = "A small CLI utility to monitor bbb usage" description = "A small CLI utility to monitor bbb usage"
authors = ["David Huss <david.huss@hfbk-hamburg.de>"] authors = ["David Huss <david.huss@hfbk-hamburg.de>"]
maintainers = ["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