Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
a9cd72bb
Commit
a9cd72bb
authored
Jan 01, 2016
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tighten the status text strings for free memory, add changelog entry
parent
59f8aa1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
CHANGELOG.md
CHANGELOG.md
+4
-0
status_checks.py
management/status_checks.py
+10
-17
No files found.
CHANGELOG.md
View file @
a9cd72bb
CHANGELOG
=========
Control Panel:
*
Report free memory usage.
Still In Development
--------------------
...
...
management/status_checks.py
View file @
a9cd72bb
...
...
@@ -206,24 +206,17 @@ def check_free_disk_space(rounded_values, env, output):
def
check_free_memory
(
rounded_values
,
env
,
output
):
# Check free memory.
percent_used
=
psutil
.
virtual_memory
()
.
percent
percent_left
=
100
-
percent_used
if
not
rounded_values
:
memory_msg
=
"The system has allocated
%
s
%%
of the memory."
%
str
(
round
(
percent_used
))
if
percent_left
>
20
:
output
.
print_ok
(
memory_msg
)
elif
percent_left
>
15
:
output
.
print_warning
(
memory_msg
)
else
:
output
.
print_error
(
memory_msg
)
percent_free
=
100
-
psutil
.
virtual_memory
()
.
percent
memory_msg
=
"System memory is
%
s
%%
free."
%
str
(
round
(
percent_free
))
if
percent_free
>=
30
:
if
rounded_values
:
memory_msg
=
"System free memory is at least 30
%
."
output
.
print_ok
(
memory_msg
)
elif
percent_free
>=
15
:
if
rounded_values
:
memory_msg
=
"System free memory is below 30
%
."
output
.
print_warning
(
memory_msg
)
else
:
memory_msg
=
"The system has less than
%
s
%%
memory left."
%
str
(
round
(
percent_left
))
if
percent_left
>
20
:
output
.
print_ok
(
"The system has more than 20
%
memory left"
)
elif
percent_left
>
15
:
output
.
print_warning
(
"The system has less than 20
%
memory left but more than 15
%
"
)
else
:
output
.
print_error
(
"The system has less than 15
%
memory left"
)
if
rounded_values
:
memory_msg
=
"System free memory is below 15
%
."
output
.
print_error
(
memory_msg
)
def
run_network_checks
(
env
,
output
):
# Also see setup/network-checks.sh.
...
...
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