BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7dbc3d97
Commit
7dbc3d97
authored
Jun 30, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch permission denied errors and ignore the disk
parent
6e82c0e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
system_info_controller.rb
app/controllers/admin/system_info_controller.rb
+34
-7
No files found.
app/controllers/admin/system_info_controller.rb
View file @
7dbc3d97
class
Admin
::
SystemInfoController
<
Admin
::
ApplicationController
def
show
excluded_mounts
=
[
"nobrowse"
,
"read-only"
,
"ro"
EXCLUDED_MOUNT_OPTIONS
=
[
'nobrowse'
,
'read-only'
,
'ro'
]
EXCLUDED_MOUNT_TYPES
=
[
'autofs'
,
'binfmt_misc'
,
'cgroup'
,
'debugfs'
,
'devfs'
,
'devpts'
,
'devtmpfs'
,
'efivarfs'
,
'fuse.gvfsd-fuse'
,
'fuseblk'
,
'fusectl'
,
'hugetlbfs'
,
'mqueue'
,
'proc'
,
'pstore'
,
'securityfs'
,
'sysfs'
,
'tmpfs'
,
'tracefs'
,
'vfat'
]
def
show
system_info
=
Vmstat
.
snapshot
mounts
=
Sys
::
Filesystem
.
mounts
@disks
=
[]
mounts
.
each
do
|
mount
|
options
=
mount
.
options
.
split
(
',
'
)
mount_options
=
mount
.
options
.
split
(
',
'
)
next
unless
excluded_mounts
.
each
{
|
em
|
break
if
options
.
include?
(
em
)
}
next
if
(
EXCLUDED_MOUNT_OPTIONS
&
mount_options
).
any?
next
if
(
EXCLUDED_MOUNT_TYPES
&
[
mount
.
mount_type
]).
any?
begin
disk
=
Sys
::
Filesystem
.
stat
(
mount
.
mount_point
)
@disks
.
push
({
bytes_total:
disk
.
bytes_total
,
...
...
@@ -22,6 +47,8 @@ class Admin::SystemInfoController < Admin::ApplicationController
disk_name:
mount
.
name
,
mount_path:
disk
.
path
})
rescue
Sys
::
Filesystem
::
Error
end
end
@cpus
=
system_info
.
cpus
.
length
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment