Commit e3c4614c authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(captiveportal) add acc_session_timeout to session info

(cherry picked from commit 6e9a10aa)
parent 7e570cfd
......@@ -58,15 +58,18 @@ if parameters['output_type'] != 'json':
'macAddress': 'mac_address',
'total_bytes': 'total_bytes',
'idletime': 'idletime',
'totaltime': 'totaltime'
'totaltime': 'totaltime',
'acc_session_timeout': 'acc_session_timeout'
}
print '%(sessionId)-30s %(userName)-20s %(ipAddress)-20s %(macAddress)-20s '\
+ '%(total_bytes)-15s %(idletime)-10s %(totaltime)-10s' % heading
heading_format = '%(sessionId)-30s %(userName)-20s %(ipAddress)-20s %(macAddress)-20s '\
+ '%(total_bytes)-15s %(idletime)-10s %(totaltime)-10s'
print (heading_format % heading)
for item in response:
item['total_bytes'] = (item['bytes_out'] + item['bytes_in'])
item['idletime'] = time.time() - item['last_accessed']
item['totaltime'] = time.time() - item['startTime']
print '%(sessionId)-30s %(userName)-20s %(ipAddress)-20s %(macAddress)-20s '\
+ '%(total_bytes)-15s %(idletime)-10d %(totaltime)-10d' % item
frmt = '%(sessionId)-30s %(userName)-20s %(ipAddress)-20s %(macAddress)-20s '\
+ '%(total_bytes)-15s %(idletime)-10d %(totaltime)-10d'
print (frmt % item)
else:
print(ujson.dumps(response))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment