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
20d20df8
Commit
20d20df8
authored
Feb 01, 2015
by
Ian Beringer
Committed by
Joshua Tauberer
Feb 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow for non-standard ssh port in status check
closes #313
parent
f945a1bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
status_checks.py
management/status_checks.py
+17
-3
No files found.
management/status_checks.py
View file @
20d20df8
...
...
@@ -43,6 +43,17 @@ def run_checks(env, output):
r1
.
get
()
.
playback
(
output
)
r2
.
playback
(
output
)
def
get_ssh_port
():
# Returns ssh port
output
=
shell
(
'check_output'
,
[
'sshd'
,
'-T'
])
returnNext
=
False
for
e
in
output
.
split
():
if
returnNext
:
return
int
(
e
)
if
e
==
"port"
:
returnNext
=
True
def
run_services_checks
(
env
,
output
):
# Check that system services are running.
...
...
@@ -58,7 +69,7 @@ def run_services_checks(env, output):
{
"name"
:
"Sieve (dovecot)"
,
"port"
:
4190
,
"public"
:
True
,
},
{
"name"
:
"Mail-in-a-Box Management Daemon"
,
"port"
:
10222
,
"public"
:
False
,
},
{
"name"
:
"SSH Login (ssh)"
,
"port"
:
22
,
"public"
:
True
,
},
{
"name"
:
"SSH Login (ssh)"
,
"port"
:
get_ssh_port
()
,
"public"
:
True
,
},
{
"name"
:
"Public DNS (nsd4)"
,
"port"
:
53
,
"public"
:
True
,
},
{
"name"
:
"Incoming Mail (SMTP/postfix)"
,
"port"
:
25
,
"public"
:
True
,
},
{
"name"
:
"Outgoing Mail (SMTP 587/postfix)"
,
"port"
:
587
,
"public"
:
True
,
},
...
...
@@ -94,9 +105,12 @@ def check_service(i, service, env):
"127.0.0.1"
if
not
service
[
"public"
]
else
env
[
'PUBLIC_IP'
],
service
[
"port"
]))
running
=
True
except
OSError
as
e
:
output
.
print_error
(
"
%
s is not running (
%
s)."
%
(
service
[
'name'
],
str
(
e
)))
if
service
[
'name'
]
==
'SSH Login (ssh)'
:
output
.
print_error
(
"
%
s is not running (
%
s). (Should be running on port
%
s)"
%
(
service
[
'name'
],
str
(
e
),
str
(
get_ssh_port
())))
else
:
output
.
print_error
(
"
%
s is not running (
%
s)."
%
(
service
[
'name'
],
str
(
e
)))
# Why is nginx not running?
if
service
[
"port"
]
in
(
80
,
443
):
...
...
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