Added orchestration.Server remote status retrieval
This commit is contained in:
parent
7578c47c9a
commit
5565426b59
|
@ -18,14 +18,15 @@ def retrieve_state(servers):
|
|||
if ping.startswith('rtt'):
|
||||
ping = '%s ms' % ping.split('/')[4]
|
||||
else:
|
||||
ping = '<span style="color:red"><b>offline<b></span>'
|
||||
ping = '<span style="color:red"><b>Offline<b></span>'
|
||||
|
||||
uptime = join(uptime, silent=True)
|
||||
uptime_stderr = uptime.stderr.decode()
|
||||
uptime = uptime.stdout.decode().split()
|
||||
if uptime:
|
||||
uptime = 'Up %s %s load %s %s %s' % (uptime[2], uptime[3], uptime[-3], uptime[-2], uptime[-1])
|
||||
else:
|
||||
uptime = '<span style="color:red"><b>Timeout<b></span>'
|
||||
uptime = '<span style="color:red"><b>%s<b></span>' % uptime_stderr
|
||||
state[server.pk] = (ping, uptime)
|
||||
|
||||
return state
|
||||
|
|
Loading…
Reference in New Issue