##// END OF EJS Templates
system-info: added ulimit to system info.
marcink -
r2673:4b2a46a3 default
parent child Browse files
Show More
@@ -123,6 +123,9 b' class AdminSystemInfoSettingsView(BaseAp'
123 123 (_('Uptime'), val('uptime')['text'], state('uptime')),
124 124 ('', '', ''), # spacer
125 125
126 # ulimit
127 (_('Ulimit'), val('ulimit')['text'], state('ulimit')),
128
126 129 # Repo storage
127 130 (_('Storage location'), val('storage')['path'], state('storage')),
128 131 (_('Storage info'), val('storage')['text'], state('storage')),
@@ -23,6 +23,7 b' import os'
23 23 import sys
24 24 import time
25 25 import platform
26 import subprocess32
26 27 import pkg_resources
27 28 import logging
28 29
@@ -140,6 +141,29 b' def platform_type():'
140 141 return SysInfoRes(value=value)
141 142
142 143
144 def ulimit_info():
145 data = {}
146
147 text = 'ulimit -a unavailable'
148 try:
149 result = subprocess32.check_output(
150 ['ulimit -a'], timeout=10, stderr=subprocess32.STDOUT,
151 shell=True)
152
153 for line in result.splitlines():
154 key, val = line.split(' ', 1)
155 data[key.strip()] = val.strip()
156 text = ', '.join('{}:{}'.format(k,v) for k,v in data.items())
157 except Exception:
158 log.exception('ulimit check problem')
159
160 value = {
161 'ulimit': data,
162 'text': text,
163 }
164 return SysInfoRes(value=value)
165
166
143 167 def uptime():
144 168 from rhodecode.lib.helpers import age, time_to_datetime
145 169 from rhodecode.translation import TranslationString
@@ -687,6 +711,7 b' def usage_info():'
687 711 return SysInfoRes(value=value)
688 712
689 713
714
690 715 def get_system_info(environ):
691 716 environ = environ or {}
692 717 return {
@@ -699,7 +724,7 b' def get_system_info(environ):'
699 724 'platform': SysInfo(platform_type)(),
700 725 'server': SysInfo(server_info, environ=environ)(),
701 726 'database': SysInfo(database_info)(),
702
727 'ulimit': SysInfo(ulimit_info)(),
703 728 'storage': SysInfo(storage)(),
704 729 'storage_inodes': SysInfo(storage_inodes)(),
705 730 'storage_archive': SysInfo(storage_archives)(),
General Comments 0
You need to be logged in to leave comments. Login now