Skip to content
Snippets Groups Projects
Commit 90ab166c authored by Seblu's avatar Seblu
Browse files

command uptime

parent e5d6941d
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,19 @@ class Command(object):
self.printer.out("\033[H\033[2J", nl="")
cmd_clear.usage = "clear"
def cmd_uptime(self, argv):
'''Show connection uptime'''
if len(argv) == 1:
argv.append(self.cli.settings["login"])
tql = "a~(%s)$con"%"|".join(argv[1:])
try:
objs = self.cli.rpc.list(tql)
except RpcError as e:
raise cmdError("RPCError: %s"%str(e))
for o in objs:
self.printer.out("%s: %ss"%(o["a"],o["con"]))
cmd_uptime.usage = "uptime [login]"
class Alias(dict):
''' Alias wrapper'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment