##// 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 (_('Uptime'), val('uptime')['text'], state('uptime')),
123 (_('Uptime'), val('uptime')['text'], state('uptime')),
124 ('', '', ''), # spacer
124 ('', '', ''), # spacer
125
125
126 # ulimit
127 (_('Ulimit'), val('ulimit')['text'], state('ulimit')),
128
126 # Repo storage
129 # Repo storage
127 (_('Storage location'), val('storage')['path'], state('storage')),
130 (_('Storage location'), val('storage')['path'], state('storage')),
128 (_('Storage info'), val('storage')['text'], state('storage')),
131 (_('Storage info'), val('storage')['text'], state('storage')),
@@ -23,6 +23,7 b' import os'
23 import sys
23 import sys
24 import time
24 import time
25 import platform
25 import platform
26 import subprocess32
26 import pkg_resources
27 import pkg_resources
27 import logging
28 import logging
28
29
@@ -140,6 +141,29 b' def platform_type():'
140 return SysInfoRes(value=value)
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 def uptime():
167 def uptime():
144 from rhodecode.lib.helpers import age, time_to_datetime
168 from rhodecode.lib.helpers import age, time_to_datetime
145 from rhodecode.translation import TranslationString
169 from rhodecode.translation import TranslationString
@@ -687,6 +711,7 b' def usage_info():'
687 return SysInfoRes(value=value)
711 return SysInfoRes(value=value)
688
712
689
713
714
690 def get_system_info(environ):
715 def get_system_info(environ):
691 environ = environ or {}
716 environ = environ or {}
692 return {
717 return {
@@ -699,7 +724,7 b' def get_system_info(environ):'
699 'platform': SysInfo(platform_type)(),
724 'platform': SysInfo(platform_type)(),
700 'server': SysInfo(server_info, environ=environ)(),
725 'server': SysInfo(server_info, environ=environ)(),
701 'database': SysInfo(database_info)(),
726 'database': SysInfo(database_info)(),
702
727 'ulimit': SysInfo(ulimit_info)(),
703 'storage': SysInfo(storage)(),
728 'storage': SysInfo(storage)(),
704 'storage_inodes': SysInfo(storage_inodes)(),
729 'storage_inodes': SysInfo(storage_inodes)(),
705 'storage_archive': SysInfo(storage_archives)(),
730 'storage_archive': SysInfo(storage_archives)(),
General Comments 0
You need to be logged in to leave comments. Login now