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

handler uptime return time in seconds

parent 4d841d18
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,7 @@ class CliHandler(RpcHandler):
def get_tag_uptime(self):
'''Return uptime output'''
try:
p = subprocess.Popen(["uptime"], close_fds=True, shell=False, stdout=subprocess.PIPE)
return p.stdout.read().rstrip("\n")
return int(float(open("/proc/uptime", "r").readline().split()[0]))
except Exception:
return ""
get_tag_uptime.ttl = 3
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