Skip to content
Snippets Groups Projects
Commit 7f5f53f1 authored by Jan Philipp Timme's avatar Jan Philipp Timme
Browse files

Update checkbbb.py for scalelite 1.3

parent 52ccac37
Branches
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ def getStatus():
fields = list(filter(None, fields))
numfields = len(fields)
if numfields == 7:
if numfields == 8:
hrfields = {}
fields[0] = re.split(r'\.',fields[0])[0]
hrfields["hostname"] = fields[0]
......@@ -35,6 +35,7 @@ def getStatus():
hrfields["users"] = fields[4]
hrfields["largestmeeting"] = fields[5]
hrfields["videos"] = fields[6]
hrfields["load"] = fields[7]
allservers.append(hrfields)
return allservers
......@@ -43,6 +44,7 @@ def generateCheckLine(bbb):
global totalMeetings
global totalAttendees
global totalVideousers
global totalLoad
global avgVideoPerMeeting
checkstate = 0
statusline = ""
......@@ -54,7 +56,8 @@ def generateCheckLine(bbb):
statusline += "numWithVideo=" + bbb["videos"] + " "
statusline += "[" + bbb["hostname"] + " M:" + bbb["meetings"] + " "
statusline += "Att:" + bbb["users"] + " "
statusline += "Vid:" + bbb["videos"] + "]"
statusline += "Vid:" + bbb["videos"] + " "
statusline += "Load:" + bbb["load"] + "]"
if bbb["state"] == "cordoned" and bbb["status"] == "online":
statusline = str(checkstate) + " " + "BBB_" + bbb["hostname"] + " "
......@@ -63,7 +66,8 @@ def generateCheckLine(bbb):
statusline += "numWithVideo=" + bbb["videos"] + " "
statusline += "****CORDONED IN SCALELITE**** [" + bbb["hostname"] + " M:" + bbb["meetings"] + " "
statusline += "Att:" + bbb["users"] + " "
statusline += "Vid:" + bbb["videos"] + "]"
statusline += "Vid:" + bbb["videos"] + " "
statusline += "Load:" + bbb["load"] + "]"
if bbb["state"] == "disabled" and bbb["status"] == "online":
checkstate = 1
......@@ -73,7 +77,8 @@ def generateCheckLine(bbb):
statusline += "numWithVideo=" + bbb["videos"] + " "
statusline += "****DISABLED IN SCALELITE**** [" + bbb["hostname"] + " M:" + bbb["meetings"] + " "
statusline += "Att:" + bbb["users"] + " "
statusline += "Vid:" + bbb["videos"] + "]"
statusline += "Vid:" + bbb["videos"] + " "
statusline += "Load:" + bbb["load"] + "]"
if bbb["state"] == "enabled" and bbb["status"] == "offline":
checkstate = 2
......@@ -102,6 +107,7 @@ def generateCheckLine(bbb):
totalMeetings += int(bbb["meetings"])
totalAttendees += int(bbb["users"])
totalVideousers += int(bbb["videos"])
totalLoad += float(bbb["load"])
return statusline
......@@ -111,7 +117,7 @@ def generateCheckLine(bbb):
totalMeetings = 0
totalAttendees = 0
totalVideousers = 0
totalLoad = 0.0
allservers = getStatus()
for bbb in allservers:
......@@ -126,6 +132,7 @@ statusline += "[scale001 totals "
statusline += "M:" + str(totalMeetings) + " "
statusline += "Att:" + str(totalAttendees) + " "
statusline += "Vid:" + str(totalVideousers) + "]"
statusline += "Load:" + str(totalLoad) + "]"
print(statusline)
overalltext = "0 BBB_Overall_Attendees count="+str(totalAttendees) + ";200;500 "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment