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
6258a7f3
Commit
6258a7f3
authored
Jun 18, 2015
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
status checks were broken if sshd was not present, fixes #444
parent
ab36cc89
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
status_checks.py
management/status_checks.py
+13
-2
No files found.
CHANGELOG.md
View file @
6258a7f3
...
...
@@ -19,6 +19,7 @@ DNS:
Control panel:
*
Resetting a user's password now forces them to log in again everywhere.
*
Status checks were not working if an ssh server was not installed.
System:
*
The munin system monitoring tool is now installed and accessible at /admin/munin.
...
...
management/status_checks.py
View file @
6258a7f3
...
...
@@ -42,16 +42,22 @@ def run_checks(rounded_values, env, output, pool):
def
get_ssh_port
():
# Returns ssh port
try
:
output
=
shell
(
'check_output'
,
[
'sshd'
,
'-T'
])
returnNext
=
False
except
FileNotFoundError
:
# sshd is not installed. That's ok.
return
None
returnNext
=
False
for
e
in
output
.
split
():
if
returnNext
:
return
int
(
e
)
if
e
==
"port"
:
returnNext
=
True
# Did not find port!
return
None
def
run_services_checks
(
env
,
output
,
pool
):
# Check that system services are running.
...
...
@@ -82,6 +88,7 @@ def run_services_checks(env, output, pool):
fatal
=
False
ret
=
pool
.
starmap
(
check_service
,
((
i
,
service
,
env
)
for
i
,
service
in
enumerate
(
services
)),
chunksize
=
1
)
for
i
,
running
,
fatal2
,
output2
in
sorted
(
ret
):
if
output2
is
None
:
continue
# skip check (e.g. no port was set, e.g. no sshd)
all_running
=
all_running
and
running
fatal
=
fatal
or
fatal2
output2
.
playback
(
output
)
...
...
@@ -92,6 +99,10 @@ def run_services_checks(env, output, pool):
return
not
fatal
def
check_service
(
i
,
service
,
env
):
if
not
service
[
"port"
]:
# Skip check (no port, e.g. no sshd).
return
(
i
,
None
,
None
,
None
)
import
socket
output
=
BufferedOutput
()
running
=
False
...
...
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